Resources to write driver for STM32 Peripherals?

Hello Everyone, I have been learning to work with my STM32F429I DISCOVERY board. I learned to work with SPI ,I2C and USART communication peripherals using the HAL API . I now want to learn the driver development for the same communication peripherals.

Would Like to know how should I go about it. I have found 1-2 good videos on YouTube related to it.

Let me know if anyone knows more good resources for getting started with driver development .

Phil’s Lab YouTube channel has at least one video dedicated to writing STM32 drivers, if I remember correctly. Many of his other videos also touch on the code, but perhaps more above the driver level.

Yes, I checked it out, I was looking for a more structured course on Bare Metal Programming and bought one course in UDEMY by Israel Gbati. Loving it so far !

I do a little coding, so thanks for the hint :blush:

1 Like

Wow, you got the good one!

I’d start by looking here:

More specifically, if you really don’t want to use HAL (which I totally understand), then you should take a look at the Reference Manual for that particular chip. Specifically, you’ll find the rubber meets the road in the register description section of whatever peripheral’s section you’re reading in the RM.

If you’re not a religious man (or, even if you are…), this is your bible now.

Praise the silicon gods!


haha, Thanks Dale, The instructor of the course have been teaching using the Reference manual, LOVING IT, a lot of things are clear to me now!

Checkout the Eddie Amaya’s tutorials on YouTube:
Eddie Amaya’s STM32 Playlists on YouTube

And his blog with much of the same material:
Eddie’s Blog

I still use HAL some, but Eddie makes things seem so simple - highly recommended.


1 Like

Thanks for sharing !


I have found “Embedded Systems with Arm Cortex M” to be a really good resource. Coupled with the reference manual and datasheet or your flavor processor, you’d be well on your way.


1 Like

I’ve been writing my own drivers ever since university, that’s how they taught us. I wasn’t aware of HAL until recently, and to be honest, it seems like more work for me now to learn how to use HAL than just opening the ref manual.

However, my memory is crap, and I often forget how/why/what registers I needed to use, and when I come back to an old project, I just simply can’t remember. Most recently, I’ve been writing some drivers for the UART, PWM, PLL, and a numerically controlled oscillator, which is a neat trick I recently stumbled upon for generating sine/cosine waves by multiplication of phasors. I decided this time to write some notes as I go, they’re mainly innate ramblings of what I did (rather than a tutorial). But, in case they’re even slightly helpful (I’ve hit my head against the keyboard a lot whilst writing STM32 drivers without libs, because the RM can tend to leave out important details, or they’re so buried it’s hard to find):

In any case, I hope it helps. The readme explains the most recent additions to my drivers, I haven’t added the NCO or a few other things yet, but it might help in a pinch!


1 Like

Hey, Thanks for sharing your GitHub repo Max! Just checked out the code for uart driver, explanations in the comment is very detailed, I am using an discovery board and having issues in verifying which USART is connected to the COM port, can you help? what’s your email id?