Hello,
I would like to store the firmware size in ROM. Can keil calculate the firmware size and store it in a variable post compilation. This would allow me to just grab the variable without have to create a function to calculate the firmware size.
Thanks,
Eric Micallef
Do I have to add anything to the linker options in the flash configuration settings?
If you have a scatter file check what the name of the load region is, I used the generic one Keil uses for IROM1 in the auto generated files. I'm just cutting and pasting into an STM32 project building in uV 5.22, no magic involved.
Auto generated .SCT file, note "LR_IROM1", the final size of the output being computed
; ************************************************************* ; *** Scatter-Loading Description File generated by uVision *** ; ************************************************************* LR_IROM1 0x08000000 0x00030000 { ; load region size_region ER_IROM1 0x08000000 0x00030000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) } RW_IRAM1 0x20000000 0x00005000 { ; RW data .ANY (+RW +ZI) } }
Ah, I was not using a scatter file. Can you explain what a scatter file does for me? All this reading from keils forum it looks like all a scatter file does is breakdown the regions of where data is being dumped?
You shouldn't need one, look for a project.sct type file in the output directory where it puts the .AXF, .HEX and .MAP files.
The region naming is important for the symbol to work