Ladies and Gentlemen,
I have a fresh installed MCUXpresso 25.6.136 IDE on my Linux Mint 22.1 Cinnamon machine.
I just wrote a few C lines to start debugging on my LPCXpresso11U37H board from NXP.
Almost everything is fine
I am able to switch the IDE to debug mode, it recognizes the programmer without any issue (a few days before it was a serious problem, therefore I purged the IDE and reinstalled it), run, or single step my code, until I reach the following line:
LPC_SYSCON->SYSPLLCTRL = (0xF & 0x1F) | ((0x2 & 0x3) << 5);
When I run this command (doesn't matter, which bits I try to set or clear), the debugger gives an error message:
I tried this command with other bits - except the reserved ones, tried it without the "NOP" before. It seems, when I try to modify something in the SYSPLLCTRL register, the debugger gives up, I got the attached error and there's the end of debugging.
Is there something wrong in my code? It translates without any warning or error ... What am I doing wrong?
Ladies and Gentlemen,
I'm still wrestling with MCUXpresso IDE and the LPC11U37H evalboard.
The user manual says (UM10462, 3.5.15) that the MAINCLKSEL register has 0x00 after reset. It means, the system runs on internal RC oscillator. If this is true, I can change anything related to the PLL, it should not result any strange behaviour, since the PLL is not used. Am I right until this?
I created a whole new project. There's some code MCUXpresso gives, I didn't modify it yet. I try to debug it, and I see in MCUXpresso's Peripherals window, that right after reset, there's no instruction run yet at all, no, the SystemCoreClockUpdate() function is not invoked yet. And the value in MAINCLKSEL register is 0x03, meaning, the system runs on the output of the PLL.
This way, there's no wonder if I change anything related to the PLL, the debugger hangs up, sometimes the whole MCUXpresso crashes, because there's no system clock in the chip anymore -> no debug is possible.
Which one is right: the User Manual or what I see in MCUXpresso?
Hello @jeanvaljean,
Sorry for the late reply, both are correct.
As mentioned in the Reference Manual (RM), the MAINCLKSEL register is initially set to 0x0. However, in the MCUXpresso example, it is modified to use the PLL as the main clock source. I’ll provide an example using the blinky_project to illustrate this:
If we look at the ResetISR available in the startup code, we can see that it calls the function SystemInit(), which is responsible for setting up and initializing the hardware before calling main(). This includes configuring the PLL as the main clock source.
After SystemInit(), the main() function is executed.
You can also use the function "Chip_Clock_SetSystemPLLSource" to change the main system clock, provided the necessary configurations are in place.
Hope this helps.
BR
Habib.