Other Parts Discussed in Thread: MSPM0L1105
Hi there,
When I try to enable CLK_OUT function, the program triggers hard fault exception. The tested MCU is labeled with MSPM0G3507. Yes it is production silicon, not early sample. I also tested it with MSPM0L1105TDYYR got yesterday. The situation is the same.
Here is the test program:
void main() { iomux_PA22_as_CLK_OUT(PINCM_OUTPUT); reg_SYSCTL.GENCLKCFG = SYSCTL_GENCLKCFG_EXCLKSRC_SYSOSC; reg_SYSCTL.GENCLKEN |= SYSCTL_GENCLKEN_EXCLKEN; while (1); }
The code looks weird because I use my own driver library, not the SDK provided by TI. Please ignore the syntax, they are just simple register level operations. For MSPM0L1105, I also connect the CLK_OUT pinout to an oscilloscope. When the debugger steps over line-7, the oscilloscope shows 32MHz waveform immediately. But the program also jumps to hard fault exception handler right away.
If I don't use stepping debug and let it run free then the debugger can no longer connect to the target. I have to jump a wire from PA18 (with BSL_invoke) to VCC and power cycle. After the target is in BSL mode, the debugger can re-program it again.
Since I can see the SYSOSC clock is shown on the oscilloscope, the program code itself should be fine. So I think it could be a silicon bug. Some how the CPU clock becomes unstable at the moment when SYSOSC is routed to CLK_OUT.
Any idea?
Robert.