I’m using EDMA to read the McSPI RX register and store in a global memory buffer and it works fine. To avoid initializing the ParamSet every transfer, I then set EDMA3CC_OPT_STATIC in the “opt” parameter and now the destination address no longer increments. I can determine this because only the first byte in the destination buffer gets updated and the value stored is the last byte received. This test transfer is very small (3 bytes) to make it easy to see on a scope/analyzer. What is going on?
EDMA3CCPaRAMEntry mSpiRxParamSet
static void InitSpiRxParamSet(uint32_t length)
{
uint32_t opt;
// Source is SPI Rx FIFO
mSpiRxParamSet.srcAddr = (uint32_t)MCSPI_RX0_REG;
// Destination is Rx buffer
mSpiRxParamSet.destAddr = (uint32_t)gSpiMasterRxBuf;
mSpiRxParamSet.aCnt = 1; // 1 byte per event
mSpiRxParamSet.bCnt = length; // bCnt * cCnt = Total bytes
mSpiRxParamSet.cCnt = 1;
// Source is register so don't increment
mSpiRxParamSet.srcBIdx = 0;
mSpiRxParamSet.srcCIdx = 0;
// Destination is memory so increment
mSpiRxParamSet.destBIdx = 1;
mSpiRxParamSet.destCIdx = 0;
mSpiRxParamSet.linkAddr = 0xFFFF; // No link
mSpiRxParamSet.rsvd = 0;
mSpiRxParamSet.bCntReload = 0;
opt = 0; // "A-synchronized" transfer (requires multiple “B” events)
opt |= (EDMA3CC_OPT_STATIC); // Causes destination to not increment
// Flag to set in IPR/IPRH when transfer completes
opt |= (EDMA_SPI_RX_CHAN << EDMA3CC_OPT_TCC_SHIFT);
// Set IPR/IPRH only when entire transfer completes
opt |= (1 << EDMA3CC_OPT_TCINTEN_SHIFT);
mSpiRxParamSet.opt = opt;
// Write ParamSet
EDMA3SetPaRAM(SOC_EDMA30CC_0_REGS, EDMA_SPI_RX_CHAN, &mSpiRxParamSet);
// Enable EDMA
EDMA3EnableTransfer(SOC_EDMA30CC_0_REGS, EDMA_SPI_RX_CHAN, EDMA3_TRIG_MODE_EVENT);
}