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.

RM48L952: CAN Message Identifiers using DMA

Part Number: RM48L952
Other Parts Discussed in Thread: HALCOGEN

Hello All,

I am trying to do CAN reception using DMA on the TI RM48L952. I've been able to configure the CAN1 channel to receive messages in multiple mailboxes using HALCOGEN and have been able to verify the messages are received if they are enabled. My question is is there a way to be able to tell the CAN ID for a message or configure all data for mailbox1 to go to a specific RAM address and mailbox2 go to a different RAM address?

Thanks so much in advance for the advice.

  • Yes, we can.

    The CAN module has three message interface registers: IF1, IF2 and IF3.

    The IF3 register set can automatically be updated with received message objects without the need to initiate the transfer from Message RAM by CPU. The intention of this feature of IF3 is to provide an interface for the DMA to read packets efficiently.

    The mailbox1 and mailbox2 can be enabled for automatic IF3 update, if the bit 0 and bit 1 of DCAN IF3UPD12 should be set.

    // Message box 1, 2 configured for auto update
    canREG1->IF3UEy[0]= 0x00000003;

    The observation flags in the IF3 Observation register should be set.

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

    The source address of DMA packet is: canREG1->IF3DATx[0]

    The destination address of DMA packet is: memory locations in SRAM. 

    In CAN ISR, you need to read the message ID to decide the destination address:

    uint32 Received_ID = canREG1->IF3ARB & 0x1FFFFFFF;

    if(Received_ID == 1)
    {
            dmaRAMREG->PCP[DMA_CH0].IDADDR = (uint32)&RX_DATA1;
    }
    else if (Received_ID == 2)
    {
        dmaRAMREG->PCP[DMA_CH0].IDADDR = (uint32)&RX_DATA2;
    } else
    {
         while(1);
    }