K60 clock frequency changes without JTAG debugger

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K60 clock frequency changes without JTAG debugger

771 Views
nancyb
Contributor III
I am creating software for our target hardware that uses two PK60FX512VLQ12 processors. The software uses MQX BSP/PSP version twrk60f120m. The cpu is clocked from an external 50 MHz oscillator. When running the target from the JTAG debugger (USB Multilink Universal) the processor runs at the expected speed of 120 MHz. When I disconnect the debugger and run from flash, either debug or release, the clock appears to run at 50 MHz. I observe that the UART and CAN baud rates are reduced by a factor of 2.4 (120/50). Looking at the BSP clock management code (bsp_cm) there is one clock configuration. Can someone explain why the processor runs at the slower speed without the debugger connected?
0 Kudos
3 Replies

430 Views
konrada
Contributor IV

Check the target specification of your debug configuration (via Debug Configurations..., page "Main", group "Connection",  press Edit, press Edit next to Target to get the target's Properties dialog). Is there a .tcl script given next to "Initialize target:"? Does the .tcl file contain writes to clocking-relevant registers?

0 Kudos

430 Views
nancyb
Contributor III
Thank you for pointing out the debug script possibility. The option to initialize target is not checked. Another data point, maybe relevant; another developer has a non-MQX application that behaves the same way. The application runs at the expected clock rate when connected to the debugger, and runs slower standalone from flash.
0 Kudos

430 Views
nancyb
Contributor III
This problem might be caused by the external clock. I am not seeing the expected clock signal that is sourced from another chip. If the clock is wrong or missing then perhaps the K60 is running from a different internal clock source. I will update when I resolve the external clock issue.
0 Kudos