This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LC4357: DMA and DCAN: copying of IF3ARB register

Part Number: TMS570LC4357

Hello,

Is it possible to use DMA to copy IF3ARB, IF3DATA and IF3DATB registers during one DMA request?

Right now I have configured several DCAN MessageBoxes to receive different filtered messages (Each MessageBox receives different set of messages). I'm able to copy data of these messages, but I need to determine Ids of these messages as processing of these messages differs based on it.

My setting of IF3OBS register and DMA is:

// Read ARB, DATA A & B - 8 bytes */
        canREG1->IF3OBS = 0x1A;

        canREG1->IF3UEy[0]= 0xFFFFFFFF;
        canREG1->IF3UEy[1]= 0xFFFFFFFF;

dmaReqAssign(DMA_CH0,16);

        dma_control.SADD      = (uint32)(&(canREG1->IF3DATx[0]));
        //dma_control.SADD      = (uint32)(&(canREG1->IF3ARB[0]));
        dma_control.DADD      = DESTINATION_ADDRESS;
        dma_control.CHCTRL    = 0x00000000;
        dma_control.FRCNT     = 0x00000001;
        dma_control.ELCNT     = 0x00000002;
        //dma_control.ELCNT     = 0x00000001;
        dma_control.ELDOFFSET = 0x00000000;
        dma_control.ELSOFFSET = 0x00000000;
        dma_control.FRDOFFSET = 0x00000060;
        dma_control.FRSOFFSET = 0x00000000;
        dma_control.PORTASGN  = PORTB_READ_PORTA_WRITE;
        dma_control.RDSIZE    = ACCESS_32_BIT;
        dma_control.WRSIZE    = ACCESS_32_BIT;
        //dma_control.RDSIZE    = ACCESS_64_BIT;
        //dma_control.WRSIZE    = ACCESS_64_BIT;
        dma_control.TTYPE     = FRAME_TRANSFER;
        dma_control.ADDMODERD = ADDR_FIXED;
        dma_control.ADDMODEWR = ADDR_INC1;
        dma_control.AUTOINIT  = AUTOINIT_ON;

        dmaSetCtrlPacket(DMA_CH0, dma_control);

        dmaSetChEnable(DMA_CH0, DMA_HW);

But I can't figure out to what address should be source address pointed to so I can start by reading at IF3ARB register address. I have also problem with setting of Frame and Element counts as there is IF3MCTL register in between IF3ARB and IF3DATA registers. I would normally try to copy all these register but my destination memory is limited and I'm reaching hard limit.

Is copying of all of these registers possible in one DMA request or would I need to configure more DMA requests?

Thanks for your support,

Marek A.

  • Hello Marek,

    I don't think you can transfer IF3ARB and IF3DATA[1:0] but skipping IF3MCTL in one transfer request. If you have limited memory and don't like to transfer all the 4 registers (IF3ARB, IF3MCTL, IF3DATA[1:0]), you need to use 2 requests, one for ARB and one for DATA.