SPI full duplex slave does not send data
Hi all,
I have a setup with Pi and STM board. The Pi acts like an SPI master, the STM is setup as SPI full duplex slave.
The SPI input and outputbuffer are the same size, what i want is that when i receive x bytes from the pi, i send back the first x bytes of the SPI output buffer back .
I can receive data from the Pi with no issue's, but when i put data into the DMA SPI outputbuffer , this data is not send by the slave(STM) the next time the Pi initiate an SPI communication.
I use HAL library and setup the STM like this :
in main(void) ->
uint8_t cnt=0;
spi_buf_out[cnt]=cnt++;
spi_buf_out[cnt]=cnt++;
spi_buf_out[cnt]=cnt++;
spi_buf_out[cnt]=cnt++;
spi_buf_out[cnt]=cnt++;
spi_buf_out[cnt]=cnt++;
spi_buf_out[cnt]=cnt++;
spi_buf_out[cnt]=cnt++;
spi_buf_out[cnt]=cnt++;
spi_buf_out[cnt]=cnt++;
HAL_SPI_TransmitReceive_DMA(&hspi2,spi_buf_out,spi_buf_in,SPI_SIZE);At the logic analyser i see correct data at MOSI and MISO lines when the pi sends the first SPI package.
But at the next SPI packages from the master (Pi), there is no data anymore at MISO (spi_buf_out), this line stays 0.
How do i instruct the HAL library to send back the contents of spi_buf_out every time the Pi starts a SPI communication?
Thank you
Steve
