The initialization of the variable is done during the normal ANSI startup code. But the initialization (0x12345678) *is* constant, and can live in FLASH memory. This variable ‘myVar’ is not constant, so it will end up in RAM. ![]() This is best explained with the following (global/extern) variable:Īdding above variable to my application will increase the ‘data’ portion by 4 bytes: text data bss In summary: ‘text’ is what ends up typically in FLASH and has code and constant data. That variable ‘table’ will be in FLASH, initialized with the values specified in the source.Īnother thing which is included in ‘text’ is the interrupt vector table (more on this later). ![]() Sources/main_c.oīut it does not only contain functions, it has constant data as too. text segment, as I can see in the map file generated by the linker: *(.text*) Likewise, my new function ‘foo’ gets added to the. To my program, the ‘text’ part increases so: text data bss * dummy function to show how this adds to 'text' */ ![]() Note: I’m using the ARM GNU ‘printsize’ utility for gcc, with an example for Kinetis-L (KL25Z). I have been asked by a reader of this blog what these item numbers really mean. In “ Code Size Information with gcc for ARM/Kinetis” I use an option in the ARM gcc tool chain for Eclipse to show me the code size: text data bss dec hex filename
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |