Hi All
Does some one have a quick answer to finding the address of the last variable used in the system RAM?
My memory layout is .vectTable .bss, .data, .sysmem.
.vectTabel is forced to the start of SRAM and the others follow. Sometimes .sysmem is not used and the actual ordering of the area in the memory are possibly not actually defined.
There is no stack section since the stack pointer is simply set to the top of SRAM.
This means that there is space between the end of variables in the sections mentioned above and the stack pointer (minus some stack area space) which is to be used dynamically for other purposes. Therefore the first address of this space between the two is required.
Ex. With GCC I simply put a linker symbol after the other areas. With some compilers I use something like (sfe(.bss)) to get the location. The TI linker document suggests that there is an "end" symbol but this is not recognised when building for the Stellaris M3. I also tried the "." directive but this didn't help since it was always at the start of a section and there was no guaranty which would actually end up at the highest location.
Finally I can calculate the value by interpreting the CINIT table which the start-up code uses to initialise variables. But this is the last resort since it may fail if the table's content changes in new compiler version.
Any simple one line solution?
Regards
Mark