2025-08-29 8:46 AM - edited 2025-08-29 8:47 AM
Each time I enable SPI, it works fine.
However, whenever I include USART, SPI freezes, and this issue affects multiple chips I've tested.
SPI and USART both work well individually.
The problem seems to stem from CubeMX, which doesn't generate the code correctly.
Coding directly in Keil or CubeIDE might solve the issue, but it's time-consuming—which is exactly why we use CubeMX in the first place.
Does anyone know if this could be a simple issue, like an interrupt conflict or shared resource problem?
I looked at bunch of options like making sure the interrupt priority for USART and SPI is different.
Making sure SPI does not kick in while USART (DMA) is still processing data, ect
It's definitely a CubeMX code generation issue.
Any suggestions on how to make SPI and USART work together?
2025-08-29 9:07 AM
@MNapi wrote:whenever I include USART, SPI freezes
What, exactly, "freezes" ?
On what hardware?
I have used SPI and USART via CubeMX with no problem - so it must be something you're doing.
Show a minimum but complete example which illustrates the issue.
How to write your question to maximize your chances to find a solution