Hi all,
I run into a problem that MibSPI RAM to L2 RAM DMA does not work. Thus, I am trying a simple case which transfers A array to B array.The MCU is RM57L843. I am stuck at here for days. Any help appreciated.
Here is a simple try out for DMA experiment.
I am expecting when set the software trigger to channel 1, then data should be transferred from array a to array b. However, there is no such thing happened. The array B keeps untouched.
uint16 a[22],b[22];
int i = 0;
// assign values to array A
for (i = 0 ; i < 22; i ++ )
{
a[i] = i;
}
// Initialize DMA Channel 1
g_dmaCTRLPKT1.SADD = (uint32)a; /* source address */
g_dmaCTRLPKT1.DADD = (uint32)b; /* destination address */
g_dmaCTRLPKT1.CHCTRL = 0; /* channel control */
g_dmaCTRLPKT1.FRCNT = 1; /* frame count */
g_dmaCTRLPKT1.ELCNT = 22; /* element count */
g_dmaCTRLPKT1.ELDOFFSET = 0; /* element destination offset */
g_dmaCTRLPKT1.ELSOFFSET = 0; /* element source offset */
g_dmaCTRLPKT1.FRDOFFSET = 0; /* frame destination offset */
g_dmaCTRLPKT1.FRSOFFSET = 0; /* frame source offset */
g_dmaCTRLPKT1.PORTASGN = PORTA_READ_PORTA_WRITE;
g_dmaCTRLPKT1.RDSIZE = ACCESS_16_BIT; /* read size */
g_dmaCTRLPKT1.WRSIZE = ACCESS_16_BIT; /* write size */
g_dmaCTRLPKT1.TTYPE = FRAME_TRANSFER ; /* transfer type */
g_dmaCTRLPKT1.ADDMODERD = ADDR_INC1; /* address mode read */
g_dmaCTRLPKT1.ADDMODEWR = ADDR_INC1; /* address mode write */
g_dmaCTRLPKT1.AUTOINIT = AUTOINIT_OFF; /* autoinit */
dmaREG->GCTRL |= 0x00000001U; /* DMA software reset */
dmaSetCtrlPacket(DMA_CH1,g_dmaCTRLPKT1);
dmaEnable();
while(1)
{
dmaSetChEnable(DMA_CH1, DMA_SW); // trigger DMA transfer
Delay(400000);
}
Here shows the result, which B does not get anything from A.
I think the configuration part is correct as there the Channel configuration is set.
The part I do not understand is the CSADDR register. I should be the current source address. However, I have no idea why the number is not even close to expected source address.
For more in detail, I paste the register values after Delay(400000);