Hello,
I've spent some time with an irritating problem - not a showstopper, I can live with it - but irritating!!! Main question is that how to finalize SPI/EDMA transfer frame in a controlled way. EDMA-finishing interrupt server is the main problem
Below is the interrupt server code and below that scope view where blu-SIMO, grn-CLK, red-EdmaIsr and yel-Edma3CCErrHandlerIsr. TX- int is not interesting to me because RX is not completed yet that time- so I would only need RX-int (EDMA3_CHA_SPI0_RX) . I've tried to get rid of the TX-int (EDMA3_CHA_SPI0_TX) but not managed, I need to acknowledge it somehow, below is the minimum I've found. . I've tried to get rid of the Edma3CCErrHandlerIsr after every TX-int but not managed.
I can let the Edma3CCErrHandlerIsr to shoot these extra interrupts but they are waste of resources and I would like to know if this problem will one day stop the SPI-EDMA totally.
No-one but these IR- servers is touching SPI in the mean time, the length of the data does not change anything. All flags have been deactivated before lounching the xfer, if not properly would cause this problem earlier than the last byte??
Thank you and best regards,
Risto
void EdmaIsr(void)
{
UL ulIPR;
GPIOPinWrite(SOC_GPIO_0_REGS, LED_3_IO_NUM, 1);
ulIPR = EDMA3GetIntrStatus(SOC_EDMA30CC_0_REGS);
IntEventClear(SYS_INT_EDMA3_0_CC0_INT1);
if(ulIPR & (1<<EDMA3_CHA_SPI0_TX))
EDMA3ClrIntr(SOC_EDMA30CC_0_REGS, EDMA3_CHA_SPI0_TX);
if(ulIPR & (1<<EDMA3_CHA_SPI0_RX))
{
SPIIntDisable(SOC_SPI_0_REGS, SPI_DMA_REQUEST_ENA_INT);
g_poMessageManager->IntServerSpiEdma();
}
GPIOPinWrite(SOC_GPIO_0_REGS, LED_3_IO_NUM, 0);
}
void Edma3CCErrHandlerIsr(void)
{
UI uiCCerrStat,
uiEventErrStat;
GPIOPinWrite(SOC_GPIO_0_REGS, LED_2_IO_NUM, 1);
g_uiEdmaErrors++;
IntEventClear(SYS_INT_EDMA3_0_CC0_ERRINT);
// EDMA3CC_CCERR - page 526
uiCCerrStat = EDMA3GetCCErrStatus(SOC_EDMA30CC_0_REGS);
// EDMA3CC_EMR - Event Missed Register, page 522
uiEventErrStat = EDMA3GetErrIntrStatus(SOC_EDMA30CC_0_REGS); // debug
EDMA3ClrMissEvt(SOC_EDMA30CC_0_REGS, EDMA3_CHA_SPI0_TX);
uiEventErrStat = EDMA3GetErrIntrStatus(SOC_EDMA30CC_0_REGS); // debug
GPIOPinWrite(SOC_GPIO_0_REGS, LED_2_IO_NUM, 0);
}
blu-SIMO,
grn-CLK,
red-EdmaIsr and
yel-Edma3CCErrHandlerIsr