2017-09-04 06:18 AM
Hello,
I need small clarifications about .data section placement in the STM32F446x mcu.
Let say i have a global array in the program and if i run the program on MCU,
The arry can be located at 0x20000000 address onwards .
How did that array came to that location ? I dont see any code in my project (built using KEIL) which copies data section from flash to SRAM.
and as far i know, code region will be mapped to flash memory and not to SRAM.
Can anybody please help me to understand how did .data section moves from flash to SRAM ? is it done through sofware or hardware remapping ? Thanks
#stm32f4 #stm32f466Solved! Go to Solution.
2017-09-04 08:47 AM
The linker determines where code/data is placed, the 'Load Region' from the Keil Scatter File (linker script) via the Target address options, packs the static RAM data into FLASH. The code within __main (called from startup_stm32f4xx.s) zeros and copies statics into RAM from FLASH, and then executes your main() function.
2017-09-04 08:47 AM
The linker determines where code/data is placed, the 'Load Region' from the Keil Scatter File (linker script) via the Target address options, packs the static RAM data into FLASH. The code within __main (called from startup_stm32f4xx.s) zeros and copies statics into RAM from FLASH, and then executes your main() function.
2017-09-04 09:22 PM
Thanks Clive,
Understood.
2017-09-05 03:46 AM
This is the ARM linker. You can find the documentation here:
http://www.keil.com/support/man/docs/armlink/armlink_pge1362065968963.htm
2017-09-07 11:26 PM
Thanks . i got it