cancel
Showing results for 
Search instead for 
Did you mean: 

F405 Bare Metal SPI

tdorval23
Visitor

Hi, I've been trying to get a ground-up bare metal implementation of SPI working on one of the STM32 boards I own, but I can't seem to make progress on any of them. I lack an ST Link for the 405, so I can't step through my program and see how the registers are configured sadly, so I figured I'd ask here to see if anyone has experience doing something similar. I've attached the relevant GPIO and SPI c code to this post, as well as the main function for my project. Any help would be much appreciated, thanks.

1 REPLY 1
darenluie
Associate II

You’re on the right track, but SPI on the F4 can be sensitive to small setup details. Most problems come from the wrong AF pin mapping or missing SSM/SSI settings when using software NSS. Try a simple loopback test by connecting MOSI to MISO to confirm your setup. If you share which pins you’re using, it’ll be easier to spot any config issues.