Hi everyone!
I'm an electronics engineering student, and I've been working on a project to understand STM32 microcontrollers at a lower level by writing peripheral drivers in C without using the STM32
https://github.com/rebaikhalil/stm32-bare-metal-drivers-
I'm using an STM32F407VET6 and learning to work directly with memory-mapped registers, the reference manual, and the MCU's hardware architecture.
My goal isn't just to make the peripherals work, but to understand the hardware and develop better embedded C practices.
I'd really appreciate feedback from more experienced embedded developers, especially on:
Code quality: Are my register definitions, bit manipulation macros, and structures well designed?
Driver architecture: Is the current project structure reasonable, or should I separate hardware-specific code from the driver API?
Correctness and portability: Are there any potential bugs, undefined behaviour, or compiler-related issues I should watch out for?
Testing: How would you recommend testing register-level drivers systematically, beyond simply checking that they work on the physical board?
Next steps: Which drivers or concepts should I focus on next to improve my understanding of embedded systems?
I'm still learning, so constructive criticism is very welcome. I'd rather identify weaknesses in my approach now than build more code on top of bad practices.
Thanks for taking the time to look at my project!