This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SPI driver for STM32F4xx

For those who might want to use it - middleware SPI driver for STM32F4xx using DMA transfer is very buggy:

- DMA stream numbers for SPI2 are completely wrong. Instead of streams 3 and 4, it uses streams 2 and 3

Following errors apply both to SPI_SendData and SPI_ReceiveData

- DMA initialization sets peripheral flow control bit, which is wrong for SPI (should be reset)
- DMA peripheral address initialization is wrong -> instead of pointer to DR, it stores it's contents
- DMA enable for tx uses pointer to wrong register (rx), so tx channel is never enabled

First issue is more complicated to fix, since stream numbers are also defined in RTE_Device.h file,
so both SPI_STM32F4XX.c and RTE_Device.h must be modified.

Interesting is that it's version 1.04 and nobody noticed those errors before...