SPI dma reads start at index 1 after first read
I'm trying to read and write SPI bytes from an STM32F446RE chip with DMA. The STM32f4 is the slave and a RPi is the master. The first SPI read works fine (data read into buffer starting at index 0), but subsequent reads have the data starting at index 1 instead of index 0. I tried resetting the SPI peripheral with this bit of code I found on the forums:
#define RESETSPI {\
HAL_SPI_Abort(&hspi2);\
__HAL_RCC_SPI2_FORCE_RESET();\
__HAL_RCC_SPI2_RELEASE_RESET();\
}
This fixes the reading off by 1, but it results in the last byte sent back to the PI to be wrong.
Does anyone know what might be happening or how I might address it?
