I am attempting to setup an eDMA transfer of the SARADC conversion results to a ram buffer. The transfer seems to work just once and the I get a SBE error flag in the ES register. Any ideas on what I might have wrong here? See setup code below.
void DMA_0_Init(void)
{
// DMAMUX_1 configuration for ADC_0 trigger
DMAMUX_0.CHCFG[0].B.ENBL = 1;
DMAMUX_0.CHCFG[0].B.SOURCE = 0x1;
DMAMUX_0.CHCFG[0].B.TRIG = 0;
// DMA config
DMA_0.ERQL.B.ERQ0 = 0x1;
DMA_0.CR.B.EMLM = 0x0;
//TCD config for channel[16]
// TCD[16] Word 0 config
DMA_0.TCD[0].WORD_0.B.SADDR = SARADC0_BASE + 0x102; //Source Address ADC_0 this is the CDR Register BASE + Offset of 0x100
// TCD[16] Word 1 config SMOD(0) | SSIZE(32-bit) | DMOD(0) | DSIZE(32-bit)
DMA_0.TCD[0].WORD_1.B.SMOD = 0x0;
DMA_0.TCD[0].WORD_1.B.SSIZE = 0x1;
DMA_0.TCD[0].WORD_1.B.SOFF = 0x4;
DMA_0.TCD[0].WORD_1.B.DMOD = 0x0;
DMA_0.TCD[0].WORD_1.B.DSIZE = 0x1;
// TCD[16] Word 2 config NBYTES - Minor Byte Transfer Count
// Number of bytes to be transferred in each service request of the channel
DMA_0.TCD[0].WORD_2.NBYTES.R = 0x2;
/* TCD[16] Word 3 config SLAST - TCD Last Source Address Adjustment */
/* Set to 0 to reset to SARADC CDATA[0] */
DMA_0.TCD[0].WORD_3.B.SLAST = 0x0;
// TCD[16] Word 4 config DADDR - TCD Destination Address
DMA_0.TCD[0].WORD_4.B.DADDR = (uint32_t)&g_ADC_0_Result; /* Destination Address uint16_t 32 Element array */
// TCD[16] Word 5 config CITER - TCD Current Minor Loop Link, Major Loop Count
// ELINK | CITER
DMA_0.TCD[0].WORD_5.B.CITER = 0x20; //Destination Address
DMA_0.TCD[0].WORD_5.B.CITER_E_LINK = 0x0;
DMA_0.TCD[0].WORD_5.B.DOFF = 0x2;
// TCD[16] Word 6 config DLAST_SGA - TCD Last Destination Address Adjustment/Scatter Gather Address
DMA_0.TCD[0].WORD_6.B.DLAST_SGA = 0x0; // Destination last address adjustment
// TCD[0] Word 7 config BITER - TCD Beginning Minor Loop Link, Major Loop Count
// ELINK | BITER
DMA_0.TCD[0].WORD_7.B.BITER_E_LINK = 0x0;
DMA_0.TCD[0].WORD_7.B.BITER = 0x20; // Destination last address adjustment
}//DMA_0_Init
Hi, apparently you have incorrectly defined source address. Try to define it the same way as destination (re-typed pointer).
Not sure I understand what you mean here. The source is a constant register address. Also all of the example that I came across for eDMA had the source address defined in a similar manner (DEFINED constant). I would also not expect the transfer to work at all if this was the issue?
FYI:I started with this example: https://community.nxp.com/docs/DOC-334154
It seems that the SADDR and DADDR are not resetting as I would like. How do you use SLAST to "restore" source address? Or is ti required to setup an ISR to reset the source and destination address?