Hi, I have a system profile structure (set of system properties), saved in a serial dataflash. Size of a profile is about 16K. At power-up I need to extract from this profile another structure - slave profile (6K), and send it to the slave microcontroller over CAN. In order to do that at a certain point I need to initialize both structures in ram. And this is the only time when these structures are used.
The question is - what is the optimum way to allocate memory for these structures ? I am using STM32F107 with 64K of ram. If I initialize structures locally, in a 'parsing / slave initializing' function, I need to assign additional 22K to the stack, and I loose them for the application. By initializing these structures globally I also loose 22K of ram.
Would really appreciate considerations on this subject.
Gennady
It would be worth spending some time studying the Linker manual to see if it has any useful features which could help here.
I just tried a very quick search for "overlay", and found this:
http://www.keil.com/support/man/docs/armlink/armlink_cchihacc.htm
"You can use the OVERLAY attribute in a scatter-loading description file to place multiple execution regions at the same address"
As you say that the "profile" stuff is only ever used at startup, it sounds like your "overlay manager" could be quite simple - possibly it wouldn't actually need to do anything at all...?
Thank you, I will take a look at that, maybe that is what I need.