I am using STM32H7 HAL_SPI_transmitreceive_DMA, where are all internal buffers and how to refresh data?
Hi,
I am using an STM32H753 connected to a raspberry PI via SPI. The STM32 is connected as slave. With CubeMX I configured the STM32 to be an SPI Slave with both DMAs configured as circular. I am having a struct with live data (refreshed every 10ms) and the raspberry can ask anytime for the data. For this, I am starting TM32H7 HAL_SPI_transmitreceive_DMA before the main loop. After placing the struct with live data into the D2-Memory, I could get correct data via DMA on the raspberry.
Unfortunately it seems that there is a buffer anywhere, which buffers a part of the struct. So when I stop requesting data from the STM32 and ask after 5 minutes again, the first data I get is 5 minutes old.
Is there a way to trigger a refresh of the data for SPI? I tried different things, like taking only software NSS, use the CS-Pin as interrupt source and then start a HAL_SPI_transmitreceive_IT or HAL_SPI_transmitreceive_DMA with non-circular buffer and then clear the SPI_CR1_SSI Bit in CR1 register, but it seems to slow, so that I only get corrupted data.
Can somebody tell me the fastest way to refresh the buffered data (I actually don't know whether it is an SPI or an DMA buffer problem)? I don't refresh the data when the CS-Pin is low, so there should always be valid data and I don't need any buffers at all.
edit: The old data ist still in Buffer when I do not use the DMA, so I would guess it is something SPI related.
