Hello all,
I would like to measure the frequency of the SXOSC. For this, I would like to use the CMU (Clock Monitor Unit).
My problem is that I cannot write to the appropriate registers.
- The processor is in DRUN mode.
- There is no active write protection for the CMU registers.
- The system clock is the FXOSC.
- FXOSC, SXOSC are enabled.
Any idea what could cause the problem?
Thank you!
János Murai
Are you executing in supervisor mode?
Yes, the MCU is in supervisor mode (the MSR.PR bit is zero).
In RUN0 mode: I can't modify the registers, always the reset values are present.
In DRUN mode: If I write anything to the CMU.CSR register it becomes zero.
János
What is your compiler? Have you tried to see the register over memory dump window?
The compiler:
The memory dump:
These are the values that I can read back in C. These are the reset values, as noted in the RM.
Although, there might be something with the debugger, because if I press step over, the values change kind of randomly, while I can see in the disassembly that non register writing instructions are executing...
Currently we don't have any working evaluation board with MPC5645S. We have ordered one and when it arrives (probably next week) I will try it. For now I am short of ideas. Do you see this behavior only with CMU registers?
could you figure out something?
I just realized that I have a very similar issue with the MPU (Memory Protection Unit). All the MPU registers are writable except the CESR.VLD. So I have a feeling that it should be something with the privileges...
Thank you David!
All the other registers that I use can be modified without any problem. So I don't face this behavior anywhere else...