2022-09-30 02:50 AM
How does the STM32 knows where should the .BSS section be addressed,and what's the range,when the chip startup initially? We know that firmware downloaded into the flash contains section information like .text ,.data ect,while .bss section should be build up dynamiclly by the system,but how does the chip knows about the address and range for the .BSS section?!
Solved! Go to Solution.
2022-09-30 12:40 PM
The STM32 knows nothing..
The linker manages the symbols and the packing of the load regions, code in startup.s moves and clears data into RAM from it's holding location in FLASH
The Linker Script .LD (or Scatter File in Keil) describes the size of available resources, and the linker builds the package tracking and fixing up the symbols.
The Linker Script in GNU lays down marker symbols as to where data in flash is parked, and the address space utilization in RAM
Sort of concepts probably covered in under-grad Assemblers, Compilers, Linkers, and Loaders type classes/texts
2022-09-30 04:36 AM
The information is in the firmware itself: If you have any variable that "lives" inside your bss section, then the exact address of that variable is embedded (by the linker) when you compile your hex/bin/elf/dfu file.
The linker script provides the necessary information to the linker (and is typically device specific).
2022-09-30 08:19 AM
The BSS section is not dynamic, it is computed at link time.
The linker script know the RAM characteristics: start address and size, and the linker script know how to place each section. So all sections addresses are computed at link time.
It is instructive to study the default linker script of your project with the GNU ld manual at hand
2022-09-30 12:40 PM
The STM32 knows nothing..
The linker manages the symbols and the packing of the load regions, code in startup.s moves and clears data into RAM from it's holding location in FLASH
The Linker Script .LD (or Scatter File in Keil) describes the size of available resources, and the linker builds the package tracking and fixing up the symbols.
The Linker Script in GNU lays down marker symbols as to where data in flash is parked, and the address space utilization in RAM
Sort of concepts probably covered in under-grad Assemblers, Compilers, Linkers, and Loaders type classes/texts
2022-10-07 08:17 PM
Great! Thank you�?
2022-10-07 08:17 PM
Great! Thank you�?
2022-10-07 08:17 PM
Great! Thank you�?