Hello, I want to track boundaries for Heap and Stack in my RAM, I tried reading .axf file using 'readelf' but unable to find.
Please find screenshot of readelf output and memory map of MCU arm cortex m4 in below links.
https://ibb.co/ctmtvcS https://ibb.co/98fh6z5
Thanks
In my .map file I can't find combined allocated address for heap and stack. Any help.
So can you find them separately?
Can you find the symbols mentioned in Westonsupermare's post?
Have you studied the documents I posted earlier?
Have you tried searching? eg, searching for "keil linker map file" found this:
http://www.keil.com/forum/63417/map-file/ - which gives several references about the Map file ...
From .MAP, with names EXPORTed
HEAP 0x20000028 Section 32768 startup_stm32f767xx.o(HEAP) STACK 0x20008028 Section 4096 startup_stm32f767xx.o(STACK) ... __Vectors_Size 0x000001f8 Number 0 startup_stm32f767xx.o ABSOLUTE Stack_Size 0x00001000 Number 0 startup_stm32f767xx.o ABSOLUTE __Vectors 0x08000000 Data 4 startup_stm32f767xx.o(RESET) ... __heap_base 0x20000028 Data 0 startup_stm32f767xx.o(HEAP) Stack_Mem 0x20008028 Data 4096 startup_stm32f767xx.o(STACK) __heap_limit 0x20008028 Data 0 startup_stm32f767xx.o(HEAP) __initial_sp 0x20009028 Data 0 startup_stm32f767xx.o(STACK)
Couldn't you measure stack usage by counting up unused words from the bottom? Zero or write a pattern you can check for later, use that to figure high/low water marks. For the heap walk the allocator structures/pointers. Are these concepts not explained in micro-controller programming courses?
Dynamic stack use tracking & watermarking is covered in the App Note I linked earlier ...