IRQ from SPI DMA Rx Complete before end (too early)
I use an SPI interface with Rx and Tx DMA to transfer a 22 byte buffer from a spi slave. Chip select is handeled with
LL_GPIO_ResetOutputPin(TDK_nCS_Port, TDK_nCS_Pin);
set to high again to end transfer I wanted to use:
// SPI5 - IMU TDK Rx
void DMA2_Stream3_IRQHandler(void) {
if (LL_DMA_IsActiveFlag_TC3(DMA2)) {
LL_DMA_ClearFlag_TC3(DMA2);
Imu_Icm42688_DMA_RxCompl();
} else if (LL_DMA_IsActiveFlag_TE3(DMA2)) {
LL_DMA_ClearFlag_TE3(DMA2);
Imu_Icm42688_DMA_Error();
}
}
I can accept that using TxComplete is not working as it fires when last byte is written to interface buffer (therefore not yet sent). But why on earth can the RxComplete IRQ fire too early. See image below for..

