Hello, I found a strange problem on S12G also on S12XE MCU. In our bootloader code, it will clear the RTIF bit (CPMUFLG_RTIF on S12G, CRGFLG_RTIF on S12XE), but I found other bits in the register also were cleared. PORF is used for power on reset judgement in my code, it can't be scratched.
My code is below:
CPMUFLG_RTIF = 1 // after this code, PORF is cleared.
CRGFLG_RTIF = 1 // after this code, PORF is cleared.
But if the code is as below, the PORF bit was not affected.
CPMUFLG = ~(U8)CPMUFLG_PORF_MASK; /* Clear CMPMU int flags - not needed but good practice */