jlaitine opened a new pull request #1165: URL: https://github.com/apache/incubator-nuttx/pull/1165
## Summary Here are fixes for the two remaining issues which I have had with stm32h7 spi driver: 1. TX DMA completes before the data has been actually sent out from the SPI fifo. This is expected, but the exchange should actually wait for spi tx to finish instead of dma to the fifo to finish. This replaces the dma completion event with the SPI TXC event for detecting end of transmission. The problem comes visible when using simplex-tx mode, where we don't have any rx dma. In normal exchange, the rx dma completion automatically means that also tx has completed. 2. Enabling SPI RX dma is now done also for simplex TX, which is wrong. Also there are code paths (trigger) where enabling RX and TX buffers is not done at all. So, I re-arranged the TXDMAEN and RXDMAEN bit setting. 3. Enabling / disabling the SPI block causes glitches on the bus, which breaks some of my sensors. Luckily, there is an easy solution for this; SPI_CFG2_AFCNTR keeps the state of the signals. ## Impact ## Testing Tested on 2 different SPI sensors connected to an stm32h7 board + simplex rx/tx communication between two stm32h7 boards. Tested with both in-driver buffers enabled and disabled and on 2 separate SPI busses. Also tested having two spi devices with different clock speeds connected to the same bus and periodically using both. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org