RE: Program Memory

"'Tom Collins' tom-lnEA/wrDJtNWk0Htik3J/[email protected] [rabbit-semi]" <[email protected]> Wed, 21 Sep 2016 12:41:02 -0700
Newsgroups gmane.comp.hardware.rabbit-semiconductor
Message-ID <[email protected]>
Hopefully this will provide enough information to help with your situation.

 

First off, even though the board has a 512KB flash, the very top of the flash holds a System ID Block with board information, including its MAC address.  Below that, there are typically mirrored UserBlocks for program storage.

 

It is possible to resize the UserBlock to free up more space.  I might be able to track down the technique I used on an RCM2200 product – as I recall it required customers to install a specific firmware build that would do the resizing, and then there would be enough room to install later firmware versions.

 

I’m not sure how RFU counts bytes, but it does need to bootstrap the processor in a multi-step process that involves sending a pilot BIOS capable of receiving firmware and writing it to flash.  That likely explains the larger byte count.  Anyone curious about the bootstrap process might want to read the documentation I wrote for how Dynamic C 10 does it (https://github.com/digidotcom/DCRabbit_10/commit/0d642ee1028b007d5fe1856c2248ede3ba48f13d).  I imagine DC 9 is similar.

 

Your last working build was 447.21KB.  The build that broke was 452.98KB.  If the RCM3900 uses a mirrored 16KB UserBlock (with the SystemIDBlock potentially embedded at the top), that would allow for a 448KB program.

 

My guess is that the compiler isn’t giving you a warning because you have MAX_USERBLOCK_SIZE set to something other than the default of 0x8000 (32KB), but your board actually has 32KB allocated for the UserBlock.

 

-Tom

 

From: [email protected] [mailto:[email protected]] 
Sent: Wednesday, September 21, 2016 8:54 AM
To: [email protected]
Subject: [rabbit-semi] Program Memory

 

  

I think some of this has been talked about before, but I'm not finding any answers, just flames.

 

I have an application that runs on an RCM3900. Over the years the size of the app has increased
little by little as features were added.

 

Yesterday I made the latest change, programmed a module, and nothing. Program wouldn't run. I 
backed out the change and it runs. I add the change back in and remove a different feature. It runs.

According to DC, the total code size without the new changes, and that runs, is 457939. When I download
the program, the RFU says it's sending 494520 bytes. 

 

When I add the new feature back in, DC reports total code size of 463850 bytes. RFU says it's sending
500164 bytes. 

 

First question, what makes up the difference between what DC reports and the RFU reports for size?
Is the extra 36k the RabbitBios and that it's not included in the total code size DC reports?

 

Second question, since program memory is 512K, which is really 524288 bytes, why does the program quit
running when I get close to 500k bytes? Is this a compiler bug or is there something put there by DC?

 

Note, I'm using DC 9.62, runtime checking disabled, and debug disabled.