Summary
In this chapter, we deeply explored the core components of embedded bare-metal programming, focusing on the microcontroller’s memory model, writing linker scripts, and startup files. We began by exploring the STM32 microcontroller’s memory layout, emphasizing the importance of flash memory and SRAM for storing executable code and runtime data.
We then dedicated a significant portion of the chapter to constructing and understanding linker scripts. Through this, we understood these scripts’ critical role in the firmware build process by mapping the compiled firmware sections to the microcontroller’s specific memory regions to ensure the executable operates correctly. We learned about the various directives within a linker script, such as MEMORY
and SECTIONS
. These directives are crucial for defining the memory layout and specifying where and how program sections are placed in memory.
Our discussion on linker scripts extended to the practicalities...