AnsweredAssumed Answered

MPC5746R.h CAN MB ID_EXT bitfield

Question asked by James Murray on May 20, 2018
Latest reply on May 21, 2018 by Petr Stancik

The definition of ID_EXT seems incorrect in the MPC5746R.h file. ID_EXT needs to be 29bit long to be useful and is a superset of ID_STD. However, the definition provided in ver 5.0.3 of the file is only 18 bits long.

 

typedef union CAN_MB_ID_union_tag {    /* Message Buffer 0 ID Register */
  vuint32_t R;
  struct {
    vuint32_t PRIO:3;                  /* Local Priority */
    vuint32_t ID_STD:11;               /* Frame Identifier Standard */
    vuint32_t ID_EXT:18;               /* Frame Identifier Extended */ <--- INCORRECT
  } B;
} CAN_MB_ID_tag;

 

MPC5746RRM table 47-135 CAN mailbox structure

So, as labelled:

ID_STD should be bits 3-13 i.e. 11 bits long

ID_EXT should be bits 3-31 i.e. 29 bits long

 

This is what I'm using instead which behaves as I would expect.

typedef union CAN_MB_ID_union_tag {    /* Message Buffer 0 ID Register */
  vuint32_t R;
  struct {
    vuint32_t PRIO:3;                  /* Local Priority */
    vuint32_t ID_STD:11;               /* Frame Identifier Standard */
    vuint32_t unused:18;               /* Not used */
  } B_STD;
  struct {
    vuint32_t PRIO:3;                  /* Local Priority */
    vuint32_t ID_EXT:29;               /* Frame Identifier Extended */
  } B_EXT;
} CAN_MB_ID_tag;

 

Has this been fixed in newer versions of the file? I updated my S32DS today and that's still the version used when I create a new project.

 

James

Outcomes