2025-11-24 3:32 AM
I'm using a custom board with an STM32WB5MMG acting as an SPI slave. The board should receive data frames from a master via SPI, and send them to the computer via BLE. The SPI works fine, but as soon as the BLE advertising starts, the SPI reception breaks. I'm using SPI1 with a circular DMA to identify terminators of single data frames sent by the master. I've already tried 2 configurations:
My hypothesis is that the BLE introduces a latency on the CPU that causes the SPI reception to be slower than the transmission from the master, that causes mis-alignment of data frames, which means that the terminators are not identified anymore. Is this possible?
Also, a weird thing that I noticed, is that as soon as the terminators are not identified anymore, i.e. the data reception stops working properly, the MOSI line goes instantly low and stays low. This does not make any sense to me, because the MOSI line should be driven by the master, not the slave. Why does this happen?
More in general, what could cause SPI1 in slave mode to stop receiving full frames once BLE advertising is running?