We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I compiled some code for an Atmel AT91RM9200 powered board and I got the following result:
Program Size: Code=44340 RO-data=520 RW-data=2024 ZI-data=349720
My question is: Why do I get such a big size for the ZI data? Does this have to do with the scatter file?
The scatter file looks like this:
LR_FLASH 0x10000000 0x200000 { ; load region size_region ER_FLASH 0x10000000 0x200000 { ; load address = execution address cstartup_keil.o (reset, +First) ; *(InRoot$$Sections) } ER_SRAM 0x30000000 0x80000 { ; RW data * (+RO) * (+RW +ZI) } ARM_LIB_HEAP 0x30060000 EMPTY 0x20000-0x8000{} ARM_LIB_STACK 0x3080000 EMPTY -0x8000{} }
Thanks.
Are you sure that you get these 204000 bytes in your binary? The text line you posted says: "ZI-data=349720".
The startup code will zero-fill such a large block of memory on startup - unless possibly if the ZI-data is in flash. Put having ZI-data in flash would definitely sound like a bad mistake.
One more thing: Are you sure that you separate a large binary because of debug information, from a large binary because it contains a lot of code/data for your application?
My bad. I thought the axf generated by Keil would be the same as the final binary, but after running the fromelf utility, the 478kB axf got down to 35kB bin which is exactly the text section + RO data + RW data. No ZI data included in the bin.