2016-11-13 11:53 PM
Hello,
On my currently developing device and I issued a problem. I'm using CubeMX 4.17, F0 package 1.6 and F4 package 1.13.1.I developed the code for F4 - SPI1 communicating with NRF24L01+ module using HAL library and DMA and everything works. Then I created new project for F0 and ported some code from F4. I notice an issue. On first SPI transaction HAL_SPI_TransmitReceive_DMA() clock is HIGH when IDLE (CPOL is set to LOW). I tried changing CPOL to HIGH but situation is the same. Following transactions are OK.First transaction:http://i.imgur.com/nQJ3hTx.pngSecond:http://i.imgur.com/95UEBs8.pngSPI configuration:http://i.imgur.com/yEPiFJZ.pnghttp://i.imgur.com/U8m4rXS.pngSo I'm making first dummy transaction and then I'm palying with SPI the way I want. Do you know where the proble might be? #!f0-!spi2016-12-08 05:52 AM
Hi
,It could be that the F0 SPI driver that you are using is a kind old and/ or the function '
HAL_SPI_TransmitReceive_DMA()'
there is not the same as the one in F4 driver. You can open both F4 and F0 driver and compare theHAL_SPI_TransmitReceive_DMA()
function . Ensure to use the last versions.-Walid F-
2016-12-10 09:13 AM
Could you try to write 0xFF on the SPI DR after the clock of the peripheral is enabled and before the SPI is enabled? So that the DR is not starting with a default value of 0x00?