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.

CCS/TMS320F28379D: CAN issue with multiple message ID

Part Number: TMS320F28379D

Tool/software: Code Composer Studio

Hi

I have a device that is sending CAN message at my LAUNCHXL-F28379D board at 500kb/s with different message IDs.

I set up four message object with the same obj ID and different msg ID.

    CAN_setupMessageObject(CANB_BASE, OBJ_ID_FROM_AMK, 0x283,           //AMK_ACT_VAL_1 FL
                           CAN_MSG_FRAME_STD, CAN_MSG_OBJ_TYPE_RX, 0xFFFFFFFF,
                           CAN_MSG_OBJ_RX_INT_ENABLE | CAN_MSG_OBJ_USE_ID_FILTER, MSG_DATA_LENGTH);

    CAN_setupMessageObject(CANB_BASE, OBJ_ID_FROM_AMK, 0x284,           //AMK_ACT_VAL_1 FR
                           CAN_MSG_FRAME_STD, CAN_MSG_OBJ_TYPE_RX, 0xFFFFFFF0,
                           CAN_MSG_OBJ_RX_INT_ENABLE | CAN_MSG_OBJ_USE_ID_FILTER, MSG_DATA_LENGTH);

    CAN_setupMessageObject(CANB_BASE, OBJ_ID_FROM_AMK, 0x287,           //AMK_ACT_VAL_1 RL
                           CAN_MSG_FRAME_STD, CAN_MSG_OBJ_TYPE_RX, 0xFFFFFFE1,
                           CAN_MSG_OBJ_RX_INT_ENABLE | CAN_MSG_OBJ_USE_ID_FILTER, MSG_DATA_LENGTH);

    CAN_setupMessageObject(CANB_BASE, OBJ_ID_FROM_AMK, 0x288,           //AMK_ACT_VAL_1 RR
                           CAN_MSG_FRAME_STD, CAN_MSG_OBJ_TYPE_RX, 0xFFFFFFD2,
                           CAN_MSG_OBJ_RX_INT_ENABLE | CAN_MSG_OBJ_USE_ID_FILTER, MSG_DATA_LENGTH);

When i try to read them it happens something unusal:
the messages with ID 0x284, 0x287 and 0x288 are received just fine, but when i try to send a message with ID 0x283 it does not get received but it behave as if there where no msg Obj with such ID.

Far more strange, if i try to send a message with ID 0x285 it gets read!

I know this has something to do with ID filter and masking but i don't know how it works.

I tried to look on the TRM and on the E2E forum, with no results.

Any help is appreciated

  • Hi Alessandro,

    The mask ID filter works like this:  If the message ID is 0x5555 and you set the ID mask to 0x1FFFFFFF, then only messages with ID of 0x5555 are accepted.  If you set the ID mask to 0x1FFFFFF0, then message IDs 0x5550 to 0x555F are accepted.  In this example, the '0' (last 4 bits of the ID mask 0x1FFFFFF0) is allowing the filter to mask (ignore) the last4 bits of the message ID.

    Hope this helps.

    Regards,

    Joseph

  • Hi Joseph

    Thank you again for your support, your suggestion was rather helpful and  highly appreciated!

    I solved my issue by setting the ID mask of all the message object to 0x1FFFFFF0 (i have a total of 8, with ID's from 0x283

     to 0x28A).

    Best regards,

    Alessandro