oh, i get it
if you diable the minor loop remapping,the you shoud config DMA_TCD0_DOFF=4.
Or if you enable the minor loop remapping,then you should config the NBYTES_MLOFFYES
as showed the flowing two:
SIM_SCGC6 |= 0x2; //DMAMUX Module Turn On
SIM_SCGC7 |= 0x2; //DMA Module Turn On
DMAMUX_CHCFG0 = 0x8C; //I2S Source: Slot 12 & Activate
DMA_TCD0_CSR &= 0xBF; //Inactive
NVIC_EnableIRQ(DMA0_IRQn); //Enable IRQ DMA Channel 0
//DMA_CR = 0x80; //Enable Minor Looping
DMA_TCD0_SADDR = (uint32_t)&I2S0_RDR0; //Data Source
DMA_TCD0_DADDR = (uint32_t) BUFFER_A; //Destination
DMA_TCD0_SOFF = 0; //No Source Offset
DMA_TCD0_SLAST = 0; //Nothing Added to Source Address after Major Loop
DMA_TCD0_DLASTSGA = -4096; //Value Added to Destination Address after Major Loop
DMA_TCD0_DOFF = 4; //4 Byte Destination Offset
//DMA_TCD0_NBYTES_MLOFFYES = 0x40001004; //DMLOE Set, MLOFF = 4 bytes, NBYTES = 4
DMA_TCD0_NBYTES_MLNO = 4; //4 Bytes Transfered in each Minor Loop
DMA_TCD0_BITER_ELINKNO = 1024; //1024 Bins
DMA_TCD0_CITER_ELINKNO = 1024; //1024 Bins
DMA_TCD0_ATTR = 0x202; //32-Bit Transfer Size
DMA_TCD0_CSR = 0x2; //Interrupt Major Iteration
DMA_SERQ = 0x0; //Channel 0 Enable
DMA_TCD0_CSR |= 0x41; //Enable!
SIM_SCGC6 |= 0x2; //DMAMUX Module Turn On
SIM_SCGC7 |= 0x2; //DMA Module Turn On
DMAMUX_CHCFG0 = 0x8C; //I2S Source: Slot 12 & Activate
DMA_TCD0_CSR &= 0xBF; //Inactive
NVIC_EnableIRQ(DMA0_IRQn); //Enable IRQ DMA Channel 0
DMA_CR = 0x80; //Enable Minor Looping
DMA_TCD0_SADDR = (uint32_t)&I2S0_RDR0; //Data Source
DMA_TCD0_DADDR = (uint32_t) BUFFER_A; //Destination
DMA_TCD0_SOFF = 0; //No Source Offset
DMA_TCD0_SLAST = 0; //Nothing Added to Source Address after Major Loop
DMA_TCD0_DLASTSGA = -4096; //Value Added to Destination Address after Major Loop
//DMA_TCD0_DOFF = 4; //4 Byte Destination Offset
DMA_TCD0_NBYTES_MLOFFYES = 0x40001004; //DMLOE Set, MLOFF = 4 bytes, NBYTES = 4
//DMA_TCD0_NBYTES_MLNO = 4; //4 Bytes Transfered in each Minor Loop
DMA_TCD0_BITER_ELINKNO = 1024; //1024 Bins
DMA_TCD0_CITER_ELINKNO = 1024; //1024 Bins
DMA_TCD0_ATTR = 0x202; //32-Bit Transfer Size
DMA_TCD0_CSR = 0x2; //Interrupt Major Iteration
DMA_SERQ = 0x0; //Channel 0 Enable
DMA_TCD0_CSR |= 0x41; //Enable!