Need Help:
I am using RM57 with CCS V6. In the start up code, there are some self-test operations being performed. Most of the time my system starts up correctly, but occasionally I find that the code never gets to main().
Using myJTAG, I have traced the problem to line 2949 of the "sl_selftest.c" file where the statement "*ccmr5fKeyReg = CCMR5F_CCMKEYR_MODE_SELFTEST" is attempting to write a value of 6 into the register at 0xFFFFF604 (all legitimate). BUT, the value is not stored in the register, because the register has become "read-only" somehow. I have checked the ARM mode in CPSR to be 0x1F, which is "System Mode". From the CCMR5 register information in the MCU Tech Ref Manual, as long as the MCU is not operating in "user mode", then we should be able to write to the CCMR5 register. So, I don't think the ARM mode is the problem, but it might be something similar.
The problem appears to be system-wide because I am unable to use JTAG to write into any Peripheral Register, however, I can write to my external SRAM at 0x64000000, proving to me that my CCS and JTAG are operating correctly. So, somehow the MCU has become "read-only" for all peripheral registers, almost like they don't have power or clocks, but I think they do have power and clocks because there are no exception events generated with this situation; I can nicely step around in circles within the startup code because the SL_SelfTest_Status_CCMR5F function always fails because the preceding write to memory did not work. Here are lines 2948 through 2956 of the sl_selftest.c file:
SL_FLAG_SET(testType);
*ccmr5fKeyReg = CCMR5F_CCMKEYR_MODE_SELFTEST;
/* If sync mode loop for the test to complete */
if ((TRUE) == bMode) {
/*SAFETYMCUSW 28 D <APPROVED> Comment_13*/
while (FALSE == SL_SelfTest_Status_CCMR5F(testType, config)) {
}
retVal = TRUE;
} else {.
Any suggestions would be appreciated while I have my system locked up on this "read-only" state. I cannot remain stuck for too long, and I am reluctant to power-cycle the board because the lock-up will most surely disappear and I would lose the chance to get to the bottom of the problem.
So, the question is "what can make peripheral registers become read-only?"
Thanks.
Garry Anderson.