Re: Getting the code size of a function in C
- From: Grant Edwards <grante@xxxxxxxx>
- Date: Tue, 01 Nov 2005 21:31:35 -0000
On 2005-11-01, Tauno Voipio <tauno.voipio@xxxxxxxxxxxxx> wrote:
>>>The amount of code needed in RAM for Flash writing is pretty
>>>small: about 250 bytes on an ARM for garden-variety AMD
>>>Flashes.
>>
>> But where is the "flash writing" code getting the data?
>>
>> In cases I've dealt with the "flash writing" code has to
>> impliment some sort of communications protocol in order to
>> receive the data to be programmed into flash. In the product
>> I'm working with right now, it takes 3KB of code to do a flash
>> update. That's a pretty significant chunk out of my 32KB of
>> RAM.
>
> You do not need to keep the whole chunk in RAM at the same
> time. Also, only the inner loop of a Flash writer is necessary
> to be kept in RAM, the rest can reside in the Flash.
You're right. I could split up the loader and keep part of it
in flash, but it's extra work and it doesn't buy me anything.
Once the decision is made to update flash, the entire RAM space
becomes available. The data that's there belongs to an
application that's being erased. It's a lot simpler to just
copy the entire loader into RAM and run it from there. Up
until that point, the loader is using 0 bytes of RAM.
> The code responsible for the handling from the unlock sequence
> till the chip responds ready to poll has to be in RAM, but
> this is for erasing a segment or writing a single byte. The
> rest of code can be safely in the Flash without any problems.
It could, but there's no advantage to doing so.
> The incoming data is usually transferred in some kind of
> chunks (e.g. 128 bytes with Xmodem). It's no too difficult to
> keep one chunk in the RAM and read more when that's written.
Right.
--
Grant Edwards grante Yow! The Osmonds! You are
at all Osmonds!! Throwing up
visi.com on a freeway at dawn!!!
.
- Follow-Ups:
- Re: Getting the code size of a function in C
- From: Mike Harrison
- Re: Getting the code size of a function in C
- References:
- Getting the code size of a function in C
- From: Tosca Berisha
- Re: Getting the code size of a function in C
- From: Tauno Voipio
- Re: Getting the code size of a function in C
- From: Grant Edwards
- Re: Getting the code size of a function in C
- From: Tauno Voipio
- Re: Getting the code size of a function in C
- From: Grant Edwards
- Re: Getting the code size of a function in C
- From: Tauno Voipio
- Getting the code size of a function in C
- Prev by Date: Re: Getting the code size of a function in C
- Next by Date: Re: Getting the code size of a function in C
- Previous by thread: Re: Getting the code size of a function in C
- Next by thread: Re: Getting the code size of a function in C
- Index(es):
Relevant Pages
|