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.

TMS320F280049: Is it possible to read CANID from received CAN message ?

Part Number: TMS320F280049

Hi,

I have C2000 280049C microcontroller using Launchpad. When I tried to read CANID of received CAN message it always returns to zero.

Is possible to read CANID anyhow?

This is my functions to read CAN ID.

//List of message objects that receive data
UINT32 Drv_GetMCanIDField(UINT32 u32BaseAddr,UINT32 u32MBoxIdx)
{
    UINT32 ui32ArbReg = HWREG(u32BaseAddr + CAN_O_IF2ARB);
    UINT32 ui32MsgID = 0;

    // Get the identifier out of the register, the format depends on size of
    // the mask.
    if(ui32ArbReg & CAN_IF2ARB_XTD)
    {
        // Set the 29 bit version of the Identifier for this message object.
        ui32MsgID = ui32ArbReg & CAN_IF2ARB_ID_M;
    }
    else
    {
        // The Identifier is an 11 bit value.
        ui32MsgID = (ui32ArbReg & CAN_IF2ARB_STD_ID_M) >> CAN_IF2ARB_STD_ID_S;
    }

    return ui32MsgID;
}

Thanks,

Dhaval

PS: I tried to use CAN_transferMessage() as someone in ti forum suggested to use after read CAN messages. I tried interface both 1 and 2, direction false, and dmaRequest also false. It doesn't work.