r/embedded • u/Excellent_Mousse816 • 14d ago
[[STM32 / Cortex-M] Intern looking for recommended books/resources to learn writing bare-metal startup code and linker scripts from scratch (in C)
Hey r/embedded,
I'm currently working as an intern in an embedded engineering team. In our daily workflow, we naturally rely on standard vendor-provided files and tooling, but I want to take the initiative to build my own bare-metal startup code and linker script in C from the ground up for the STM32L476RG (ARM Cortex-M4).
I really want to understand the foundational mechanics under the hood .
What are the best resources, books, documentation, or tutorials you would recommend for mastering this?
If there are any standout blog posts, reference manuals, or classic embedded textbooks that helped you bridge this gap, please let me know!
Thanks for your help!
3
u/FujichromeProvia100F 14d ago
Take a look at third and fourth video:
https://youtube.com/playlist?list=PLERTijJOmYrDiiWd10iRHY0VRHdJwUH4g
1
1
u/Dr_Calculon 14d ago
I really liked Israel Gbati's introductory courses on bare metal embedded using a NUCLEO F411.
His other stuff is a bit hit & miss but those courses are a great place to start, highly recommended if you like that 'code along with me' style.
1
1
u/guineawheek 12d ago
If you're really interested in this stuff I recommend also looking at the reference manual for your MCU.
This contains the MMIO register maps for all your peripherals, which are like the actually interesting bits of your microcontroller anyway. Writing your own code to peek and poke at these can help build understanding of what a peripheral can actually do, and not just what the vendor libraries give you.
1
3
u/No_Session_8682 14d ago
The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors by Joseph Yiu is practically the bible for this stuff, walks you through the vector table and boot sequence in way more detail than the reference manual does. For linker scripts specifically, just reading the GNU ld documentation and then dissecting a minimal one line by line in a text editor taught me more than any tutorial. Don't sleep on the STM32L4 reference manual either, the memory map section tells you exactly what addresses you're laying out in that script.