some circumstances the 405 is equally buggy as the 401!
Work around an intermittent stall/timeout by busy-waiting Upstream's
packet length transmission and reception, instead of DMA-ing it like the
packet body. Ugh...
CurrentWorkingPacket->Length16=0;//Our RX buffer is used by HAL_SPI_TransmitReceive_DMA as dummy TX data, we set Length to 0 so downstream will know this is a dummy packet.
SPI1_NSS_ASSERT;
if(HAL_SPI_TransmitReceive_DMA(&Hspi1,
if(HAL_SPI_TransmitReceive(&Hspi1,
(uint8_t*)&CurrentWorkingPacket->Length16,
(uint8_t*)&CurrentWorkingPacket->Length16,
2)!=HAL_OK)//We only need to write one word, but the peripheral library freaks out...
2,
SPI_TIMEOUT_VALUE)!=HAL_OK)//We only need to write one word, but the peripheral library freaks out...