AnsweredAssumed Answered

STM32CubeMX 4.8.0 Bug: SPI Baud Prescaler (Fixed)

Question asked by jb on Jun 16, 2015
(I managed to fix this as I was writing this post)

STM32CubeMX 4.8.0 was generating the incorrect prescaler value for SPI3 after upgrading.

.ioc contained:

SPI3.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_8
SPI3.BaudRatePrescaler-Full_Duplex_Master=SPI_BAUDRATEPRESCALER_32
SPI3.CalculateBaudRate=3.0 MBits/s
SPI3.CalculateBaudRate-Full_Duplex_Master=1.3125 MBits/s
SPI3.IPParameters=BaudRatePrescaler-Full_Duplex_Master,TIMode-Full_Duplex_Master,Mode-Full_Duplex_Master,CalculateBaudRate-Full_Duplex_Master,BaudRatePrescaler,NSS-Full_Duplex_Master,Mode,CalculateBaudRate
SPI3.Mode=SPI_MODE_MASTER
SPI3.Mode-Full_Duplex_Master=SPI_MODE_MASTER
SPI3.NSS-Full_Duplex_Master=SPI_NSS_SOFT
SPI3.TIMode-Full_Duplex_Master=SPI_TIMODE_DISABLED


main.c was generating:

hspi3.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_32;

The SPI3 Configuration dialog is showing:
Prescaler: 8
Baud Rate: 3.0 MBits/s

The fix was to manually delete the SPI3 configuration lines containing "-Full_Duplex_Master" and reload the .ioc

The I2S configuration contained similar duplications, but didn't cause any code generation problems.

Outcomes