MCU = MPC5674F
IDE = CodeWarrior for MCU v10.6
Hi Peter,
I tried the writing whole register at once, unfortunetly it did not work.
Here is the address definition of the ECSM module in header file.
#define ECSM (*( volatile struct ECSM_tag *) 0xFFF40000)
The offset of the ECR Register is 0x0043. Therefore the physical address of the ECSM_ECR register is 0xFFF40043.

The related ECSM part in the header file is below.
/****************************************************************************/
/* MODULE : ECSM */
/****************************************************************************/
struct ECSM_tag {
union { /* Processor core type */
vuint16_t R;
} PCT;
union { /* Platform revision */
vuint16_t R;
} REV;
uint32_t ECSM_reserved0004; /* 0x0004-0x0007 */
union { /* IPS Module Configuration */
vuint32_t R;
} IMC;
uint8_t ECSM_reserved000C[3]; /* 0x000C-0x000E */
union { /* Miscellaneous Reset Status Register */
vuint8_t R;
struct {
vuint8_t POR:1;
vuint8_t DIR:1;
vuint8_t SWTR:1;
vuint8_t:5;
} B;
} MRSR;
uint8_t ECSM_reserved0010[51]; /* 0x0010-0x0042 */
union { /* ECC Configuration Register */
vuint8_t R;
struct {
vuint8_t:2;
vuint8_t ER1BR:1;
vuint8_t EF1BR:1;
vuint8_t:2;
vuint8_t ERNCR:1;
vuint8_t EFNCR:1;
} B;
} ECR;
uint8_t ECSM_reserved0044[3]; /* 0x0044-0x0046 */
union { /* ECC Status Register */
vuint8_t R;
struct {
vuint8_t:2;
vuint8_t R1BC:1;
vuint8_t F1BC:1;
vuint8_t:2;
vuint8_t RNCE:1;
vuint8_t FNCE:1;
} B;
} ESR;
uint16_t ECSM_reserved0048; /* 0x0048-0x0049 */
union { /* ECC Error Generation Register */
vuint16_t R;
struct {
vuint16_t:2;
vuint16_t FRC1BI:1;
vuint16_t FR11BI:1;
vuint16_t:2;
vuint16_t FRCNCI:1;
vuint16_t FR1NCI:1;
vuint16_t:1;
vuint16_t ERRBIT:7;
} B;
} EEGR;
uint32_t ECSM_reserved004C; /* 0x004C-0x004F */
union { /* Flash ECC Address Register */
vuint32_t R;
struct {
vuint32_t FEAR:32;
} B;
} FEAR;
uint16_t ECSM_reserved0054; /* 0x0054-0x0055 */
union { /* Flash ECC Master Number Register */
vuint8_t R;
struct {
vuint8_t:4;
vuint8_t FEMR:4;
} B;
} FEMR;
union { /* Flash ECC Attributes Register */
vuint8_t R;
struct {
vuint8_t WRITE:1;
vuint8_t SIZE:3;
vuint8_t PROT0:1;
vuint8_t PROT1:1;
vuint8_t PROT2:1;
vuint8_t PROT3:1;
} B;
} FEAT;
union { /* Flash ECC Data Register High */
vuint32_t R;
struct {
vuint32_t FEDH:32;
} B;
} FEDRH;
union { /* Flash ECC Data Register Low */
vuint32_t R;
struct {
vuint32_t FEDL:32;
} B;
} FEDRL;
union { /* RAM ECC Address Register */
vuint32_t R;
struct {
vuint32_t REAR:32;
} B;
} REAR;
uint8_t ECSM_reserved0064; /* 0x0064 */
union { /* RAM ECC Syndrome Register */
vuint8_t R;
struct {
vuint8_t RESR:8;
} B;
} RESR;
union { /* RAM ECC Master Number Register */
vuint8_t R;
struct {
vuint8_t:4;
vuint8_t REMR:4;
} B;
} REMR;
union { /* RAM ECC Attributes Register */
vuint8_t R;
struct {
vuint8_t WRITE:1;
vuint8_t SIZE:3;
vuint8_t PROT0:1;
vuint8_t PROT1:1;
vuint8_t PROT2:1;
vuint8_t PROT3:1;
} B;
} REAT;
union { /* RAM ECC Data Register */
vuint32_t R;
struct {
vuint32_t REDH:32;
} B;
} REDRH;
union { /* RAM ECC Data Register */
vuint32_t R;
struct {
vuint32_t REDL:32;
} B;
} REDRL;
uint32_t ECSM_reserved0070[4068]; /* 0x0070-0x3FFF */
};
Here is the function that I used to enable ECC reporting.
void enableECCReporting(void)
{
// Enable Flash 1-bit Reporting
ECSM.ECR.B.EF1BR = 1u;
// Enable Flash Non-Correctable Reporting
ECSM.ECR.B.EFNCR = 1u;
// Enable RAM 1-bit Reporting
ECSM.ECR.B.ER1BR = 1u;
// Enable RAM Non-Correctable Reporting
ECSM.ECR.B.ERNCR = 1u;
}
Also here is the assembly code of the enableECCReporting function. I checked the r0 and r3 values for every stb r0, 67(r3) assembly code and write the values of the r0 and r3 register into the figure.

Until this point, everything looks fine right? However, either memory location of the ECSM_ECR in Memory Window and the ECR register representation in the Variables Window are not changed. Here is the values shown in the Memory Window and Variables Windows for ECR register.


-----------------------------------------------------------------------------------------------------------------------------------------------------
Here also the code when I used to write whole register at once.
void enableECCReporting(void)
{
// Enable Flash 1-bit Reporting
// Enable Flash Non-Correctable Reporting
// Enable RAM 1-bit Reporting
// Enable RAM Non-Correctable Reporting
ECSM.ECR.R = 0x33;
}
The assemly code of the upper code block.

As I state the top of this message, it is not work.
Extra Observation:
The value of any ECSM module registers are not changing in run-time at MPC5674F. I run the code without breakpoints and monitored the values in the Register Window for ECSM. However, I couldn't see any changes in the registers.
*************************************************************************************************************
MCU = MPC5644A
IDE = CodeWarrior for MCU v10.6
Also, I wanted to check the ECSM module at MPC5644A. I have the nearly same ECSM code for the MPC5644A MCU.
In MPC5644A, the values of the ECR register change strangely. For example, the values of the Unimplenmented part of the ECR register takes value as 1. However, I am not setting them. Also, ER1BR, EF1BR, ERNCR and EFNCR bits takes values 0 and 1 randomly. I am doing anything to change them. Unfortunetly this is not just for ECR register of the ECSM. All ECSM register taking randomly value. However, there is code to do that. It is too strange.

Here is the address definition of the ECSM module in MPC5644A header file.
#define ECSM (*( volatile struct ECSM_tag *) 0xFFF40000)
The related ECSM part in MPC5644A header file is below.
/****************************************************************************/
/* MODULE : ECSM */
/****************************************************************************/
struct ECSM_tag {
union { /* Processor core type */
vuint16_t R;
} PCT;
union { /* Platform revision */
vuint16_t R;
} REV;
union { /* AXBS Master Configuration */
vuint16_t R;
} AMC;
union { /* AXBS Slave Configuration */
vuint16_t R;
} ASC;
union { /* IPS Module Configuration */
vuint32_t R;
} IMC;
uint8_t ECSM_reserved000C[3]; /* 0x000C-0x000E */
union { /* Miscellaneous Reset Status Register */
vuint8_t R;
struct {
vuint8_t POR:1;
vuint8_t DIR:1;
vuint8_t:6;
} B;
} MRSR;
uint8_t ECSM_reserved0010[3]; /* 0x0010-0x0012 */
union { /* Miscellaneous Wakeup Control */
vuint8_t R;
struct {
vuint8_t ENBWCR:1;
vuint8_t:3;
vuint8_t PRILVL:4;
} B;
} MWCR;
uint32_t ecsm_reserved0014[4]; /* 0x0014 - 0x0023 */
union { /* Miscellaneous User Defined Control */
vuint32_t R;
struct {
vuint32_t:1;
vuint32_t SWSC:1;
vuint32_t:30;
} B;
} MUDCR;
uint32_t ecsm_reserved0028[6]; /* 0x0028 - 0x003C*/
uint8_t ecsm_reserved0040[3]; /* 0x0040 - 0x0042*/
union {
vuint8_t R;
struct {
vuint8_t:2;
vuint8_t ER1BR:1;
vuint8_t EF1BR:1;
vuint8_t:2;
vuint8_t ERNCR:1;
vuint8_t EFNCR:1;
} B;
} ECR; /* ECC Configuration Register @baseaddress + 0x43 */
uint8_t ecsm_reserved0044[3]; /* 0x0044 - 0x0046*/
union {
vuint8_t R;
struct {
vuint8_t:2;
vuint8_t R1BC:1;
vuint8_t F1BC:1;
vuint8_t:2;
vuint8_t RNCE:1;
vuint8_t FNCE:1;
} B;
} ESR; /* ECC Status Register @baseaddress + 0x47 */
uint8_t ecsm_reserved0048[2]; /* 0x0048 - 0x0049*/
union {
vuint16_t R;
struct {
vuint16_t FRCAP:1;
vuint16_t:1;
vuint16_t FRC1BI:1;
vuint16_t FR11BI:1;
vuint16_t:2;
vuint16_t FRCNCI:1;
vuint16_t FR1NCI:1;
vuint16_t:1;
vuint16_t ERRBIT:7;
} B;
} EEGR; /* ECC Error Generation Register @baseaddress + 0x4A */
uint32_t ecsm_reserved004C; /* 0x004C - 0x004F*/
union {
vuint32_t R;
struct {
vuint32_t FEAR:32;
} B;
} FEAR; /* Flash ECC Address Register @baseaddress + 0x50 */
uint16_t ecsm_reserved0054; /* 0x0054 - 0x0055*/
union {
vuint8_t R;
struct {
vuint8_t:4;
vuint8_t FEMR:4;
} B;
} FEMR; /* Flash ECC Master Register @baseaddress + 0x56 */
union {
vuint8_t R;
struct {
vuint8_t WRITE:1;
vuint8_t SIZE:3;
vuint8_t PROT0:1;
vuint8_t PROT1:1;
vuint8_t PROT2:1;
vuint8_t PROT3:1;
} B;
} FEAT; /* Flash ECC Attributes Register @baseaddress + 0x57 */
union {
vuint32_t R;
struct {
vuint32_t FEDH:32;
} B;
} FEDRH; /* Flash ECC Data High Register @baseaddress + 0x58 */
union {
vuint32_t R;
struct {
vuint32_t FEDL:32;
} B;
} FEDRL; /* Flash ECC Data Low Register @baseaddress + 0x5C */
union {
vuint32_t R;
struct {
vuint32_t REAR:32;
} B;
} REAR; /* RAM ECC Address @baseaddress + 0x60 */
uint8_t ecsm_reserved0064; /* 0x0064 - 0x0065*/
union {
vuint8_t R;
struct {
vuint8_t PRESR:8;
} B;
} PRESR; /* RAM ECC Syndrome @baseaddress + 0x65 */
union {
vuint8_t R;
struct {
vuint8_t:4;
vuint8_t REMR:4;
} B;
} REMR; /* RAM ECC Master @baseaddress + 0x66 */
union {
vuint8_t R;
struct {
vuint8_t WRITE:1;
vuint8_t SIZE:3;
vuint8_t PROT0:1;
vuint8_t PROT1:1;
vuint8_t PROT2:1;
vuint8_t PROT3:1;
} B;
} REAT; /* RAM ECC Attributes Register @baseaddress + 0x67 */
union {
vuint32_t R;
struct {
vuint32_t REDH:32;
} B;
} REDRH; /* RAM ECC Data High Register @baseaddress + 0x68 */
union {
vuint32_t R;
struct {
vuint32_t REDL:32;
} B;
} REDRL; /* RAMECC Data Low Register @baseaddress + 0x6C */
};
Here is the function that I used to enable ECC reporting.
void initializeECSM(void)
{
// Enable Flash 1-bit Reporting
ECSM.ECR.B.EF1BR = 1;
// Enable Flash Non-Correctable Reporting
ECSM.ECR.B.EFNCR = 1;
// Enable RAM 1-bit Reporting
ECSM.ECR.B.ER1BR = 1;
// Enable RAM Non-Correctable Reporting
ECSM.ECR.B.ERNCR = 1;
}
Here is the weird values of ECSM registers in the Register Window.

Also the value in the related physical addresses seen in Memory Window and Register Window are not same!
Assembly code for initializeECSM function in MPC5644A and MPC5674F are same and the r0 and r3 values are same.
CAN YOU HELP ME?
Best regards,
Mert.