2016-08-17 12:01 AM
After generating code using CubeMX 4.14.0 for an STM32F030C6, I noticed a bug in using the blocking (non interrupt or DMA) functions for SPI.
When switching between using the functions HAL_SPI_Transmit and HAL_SPI_TransmitReceive, the function HAL_SPI_TransmitReceive writes only zeroes in the RX array when it is called after HAL_SPI_Transmit. Actual received bits are confirmed on an oscilloscope.This was tested while communicating with serial flash IS25LQ010B-JNLE, but it is very likely unrelated to the answering device.If only the function HAL_SPI_TransmitReceive is used, it works every time. No problem. #bug #stm32 #cubemx #spi2016-08-18 01:58 AM
Hi aap.broodje,
I don't understand why you are putting the transmit function and after that the transmit receive. Maybe, in that case, first transfer is still ongoing which makes problems for you. The transmitReceive funtion can do all the job of transfer and receive. Tray always to use the last version of CubeMx (4.16.0 now) and last version of Cube Library (V1.6.0 now) I recommend to take a look the the ''SPI_FullDuplexDMA'' example in the at this path :STM32Cube_FW_F0_V1.6.0\Projects\STM32F0308-Discovery\Examples\SPI\SPI_FullDuplex_ComDMA -Hannibal-