We are seeing an odd behaviour with an SKEAZ128MLK4 Kinetis processor.
The baud rate is configured to 57.6K, and this works when we are connected to the target board with a debugger via the SWD port.
However, if we remove the debugger, or boot / power-cycle the board and let it run the exact same code without the debugger attached, the baud rate becomes 65K rather than 57.6K.
We suspect this is happening to all of the UARTs, not just our debug one, as the system communicates fine with a BLE module @ 14.4K just fine when the debugger is connected, but then fails to talk when booted stand-alone. We suspect the same change is happening to the baud rate on the BLE UART, bumping it from 14.4K to some other value, which effectively breaks that communications link.
Something within the clock-tree is being influenced by the presence of the JTAG/SWD connection. (that or the JTAG/SWD connection is initializing some part of the clock tree that the code alone is not).
Any ideas?
Camz.
Hello Martin, additional info:
If using CW v10.6, a colleague mentioned that there was an issue with P&E OpenSDA automatically trimming KEA parts, which is already fixed. Try updating CodeWarrior to the latest, including the Update 2. (CW Updates)
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Martin:
What IDE are you using?
This sounds like the debugger is trimming the device before starting, while standalone your code does not do it. If using CodeWarrior or Processor Expert check this:
Yes, OSDA can trim the reference of internal clock source!
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
We are using KDS (Kinetis Design Studio) v1.1.1 and a PE Micro Mulilink debugger. We haven't tried v2.0.0 of KDS (the project was started with v1.1.1 and we haven't attempted to import it into 2.0.0 yet).
The issue turned out to indeed be the trim values. KDS was using a default of 32.768 kHz, which is actually *wrong* for the KEA parts, which have a different clocking design and actually use a 37.5 kHz internal clock source.
Once the trim was enabled and set to 37.5 we saw the expected baud rates when the board was running without a debugger. However, the baud rate would then be lower when the debugger was connected.
So that is the 2nd problem, the auto-trimming (to the wrong values) by the debugger.
I wasn't able to find any settings in KDS to enable or disable this behaviour in the debugger. I'm not even sure if this is something KDS is doing or the PE Micro GDB server. If anyone knows how to prevent this, please share.
At the moment, we can tweak our communications settings for a host PC to the slower baud rate when using the debugger, but that only addresses one of the 3 UARTs in use in the system. This effectively means that we can't truly use the debugger to step though code since the UART baud rates will be mis-matched. The debugger gets used to program code into the board, and then we need to reset it and use our UART "console" for printf style debugging.
Cheers,
Camz.