2020-01-04 04:39 PM
I think I have discovered a bug in the way CubeMX behaves when both SPI and DMA are enabled. I am using the P-NUCLEO-WB55 board. If you look at the SPI_FullDuplex_ComDMA_Master example application, this runs fine on the P-NUCLEO-WB55 with a jumper between MISO and MOSI. However, if you exchange two lines in main.c so that we have:
MX_GPIO_Init();
MX_SPI1_Init();
MX_DMA_Init();
instead of:
MX_GPIO_Init();
MX_DMA_Init();
MX_SPI1_Init();
then the example fails. However, this is exactly what CubeMX does if we follow these steps:
The problem does not occur if we don't save and generate code after enabling SPI1, i.e.:
In this case, the system correctly calls MX_DMA_Init() before MX_SPI1_Init(). I see two possible solutions to the problem:
Solved! Go to Solution.
2020-01-05 02:49 AM
2020-01-05 02:49 AM
2020-01-05 09:10 AM
Thanks! The workaround at the top of that thread did the trick for me, though I had to be a bit clever to get the IDE to save the new settings--the save buttons remained grayed out even after I changed the initialization order, so I had to change/revert a pin assignment.