Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: memory allocation..

2004-07-13 by ian48harry

Guys:

For this and earlier FLASH programming threads.

Don't forget that you can program the FLASH without using the built 
in capability from boot.  The programming spec is well defined and 
can be included in your own code to either program new sections and 
updates of code or to load data into FLASH.

Ian

--- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@a...> 
wrote:
> At 04:32 AM 7/13/04 -0700, you wrote:
> >Option1)
> >Set the heap address in the linker file.
> 
> That won't work for using malloc to store data in flash
> 
> >
> >Option2)
> >Write your own malloc/free functions. Pass them an array address 
which can 
> >be placed anywhere in the unused memory area.
> 
> This might.  To store data in flash using malloc/free you not only 
would 
> have to write your own malloc & free but ensure (somehow) that you 
never 
> wrote to the flash except through a routine that programmed the 
flash using 
> the IAP facilities.  You would also need to keep track of three 
kinds of 
> buffers in use, not in use but programmed, not in use and 
available. You 
> would need to add logic to clean up the flash area if the micro was 
reset 
> or powered of with the memory structures in an inconsistant state 
and do 
> appropriate moving of data when you had to erase sectors etc...  
Also 
> writing would take considerably longer than reading.
> 
> Using flash to store data really has more in common with a file 
system than 
> malloc/free.
> 
> Robert
> 
> " 'Freedom' has no meaning of itself.  There are always 
restrictions,
> be they legal, genetic, or physical.  If you don't believe me, try 
to
> chew a radio signal. "
> 
>                          Kelvin Throop, III

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.