Question
The first SPI message is weird in SPI slave using DMA
This is my code in the SPI slave:
#define SPI_PACKET_LEN 8
static uint8_t spiRxBuf[SPI_PACKET_LEN];
static uint8_t spiTxBuf[SPI_PACKET_LEN];
void task()
{
// spiTxBuf has all zeros, but the master sees "00 00 00 00 FF FF FF FF"
HAL_SPI_TransmitReceive_DMA(spiHandle, spiTxBuf, spiRxBuf, SPI_PACKET_LEN);
for (;;)
{
if semaphore acquired
{
HAL_SPI_TransmitReceive_DMA(spiHandle, spiTxBuf, spiRxBuf, SPI_PACKET_LEN);
}
}
...
Only the first 8 bytes is weird. This is the message the master can see for the first message:
1600672090.098 TX: FC 00 00 00 00 00 3C 14
1600672090.100 RX: 00 00 00 00 FF FF FF FF
When I use "interrupt", the RX are all zeros. Why is that in DMA?
All the rest message are working fine. Only the first RX is weird. I uses only 8 bytes message all the time.
