AnsweredAssumed Answered

MPC5746R.h etpu errors in S32DS v1.2

Question asked by James Murray on Oct 8, 2017
Latest reply on Oct 12, 2017 by Denis Fedorov

I've found what I believe to be some errors in the MPC5746R.h file that is generated by S32DS for Power Architecture v1.2

 

Some of the eTPU registers have the wrong addresses. I spent 2-3 hours single-stepping code as it kept hitting the IVOR1 exception.

 

Steps to recreate:

-create a new S32DS project for MPC5746R

-examine include/MPC5746R.h

 

This is wrong:

struct eTPU_CCCR_tag {
  uint8_t eTPU_CCCR_reserved0[1024];  <--- wrong!
  eTPU_CCCR_ENG1_C_tag ENG1_C[32];
  uint8_t eTPU_CCCR_reserved1[512];
  eTPU_CCCR_ENG2_C_tag ENG2_C[32];
};

 

Because..

#define eTPU_CCCR_0 (*(volatile struct eTPU_CCCR_tag *) 0xFFCC0400UL)

 

From the V1.6 version of MPC5746RRM page 89.

0x400 eTPU_CCCR_C0CR_ENG1 - eTPU 1 Channel 0 Configuration Register

 

i.e. the header file is adding the 0x400 offset twice.

 

Same kind of problem here:

struct eTPU_TBR_tag {
  uint8_t eTPU_TBR_reserved0[32]; <--- wrong!
  eTPU_TBR_TBCR_ENG1_tag TBCR_ENG1;    /* eTPU Engine 1 Time Base Configuration Register */
  eTPU_TBR_TB1R_ENG1_tag TB1R_ENG1;    /* eTPU Engine 1 Time Base 1 (TCR1) Visibility Register */
  eTPU_TBR_TB2R_ENG1_tag TB2R_ENG1;    /* eTPU Engine 1 Time Base 2 (TCR2) Visibility Register */
  eTPU_TBR_STAC_ENG1_tag STAC_ENG1;    /* eTPU Engine 1 STAC Configuration Register */
  uint8_t eTPU_TBR_reserved1[16];
  eTPU_TBR_TBCR_ENG2_tag TBCR_ENG2;    /* eTPU Engine 2 Time Base Configuration Register */
  eTPU_TBR_TB1R_ENG2_tag TB1R_ENG2;    /* eTPU Engine 2 Time Base 1 (TCR1) Visibility Register */
  eTPU_TBR_TB2R_ENG2_tag TB2R_ENG2;    /* eTPU Engine 2 Time Base 2 (TCR2) Visibility Register */
  eTPU_TBR_STAC_ENG2_tag STAC_ENG2;    /* eTPU Engine 2 STAC Configuration Register */
};

 

Because:

#define eTPU_TBR_0 (*(volatile struct eTPU_TBR_tag *) 0xFFCC0020UL)

Page 86:

0x20 eTPU_TBR_TBCR_ENG1 - eTPU 1 Time Base Configuration Register

i.e. the header file is adding the 0x20 offset twice.

 

These are the only two I found, I do not know if that kind of error is repeated elsewhere. A thorough review would be advised.

 

Should I create a support ticket for this or is it sufficient to post here?

 

regards

 

James

Outcomes