CubeMX standard config for MasterKeepIOState when SPI Mode 3 and Software NSS
It seems like CubeMX sets this default value
hspi1.Init.MasterKeepIOState = SPI_MASTER_KEEP_IO_STATE_DISABLE;when doing software NSS and SPI Mode 3 like:
hspi1.Init.CLKPolarity = SPI_POLARITY_HIGH;
hspi1.Init.CLKPhase = SPI_PHASE_2EDGE;
hspi1.Init.NSS = SPI_NSS_SOFT;This results in a non working SPI at least on STM32H652 (did not check the signals with Oscilloscope, but I assume the CLK and/or MOSI float back to an undefined value after the first transaction, breaking the next one). This can be fixed by doing:
hspi1.Init.MasterKeepIOState = SPI_MASTER_KEEP_IO_STATE_ENABLE;Wouldn't it be recommended CubeMX defaults the IO_STATE_ENABLE in this case?
This one Bit just cost me 5 Hours of headache :\
