Hii,
I have a custom board designed using NXP MKL25Z64xxx4. In the design, we have used ABM3B-8.000MHZ-B2-T for 8MHz crystal and 32.768KHz crystal is not used. We want to use KL25 board as USB CDC device (based on commands received via VCOM) and generate PWM of varying duty cycle to control a motor. I can program the board, but code gets stuck in clock initialization section. Previously we used to get this error, when crystal has some soldering issues. Looking into schematics, found that load capacitance used was 12pf. While searching, came across capacitor across crystal should be almost around 2xCL of crystal. The crystal used has a CL of 18pf. So changed the capacitors to 33pf (as this was the only value available right now). Still code was getting stuck in FLLPLL setting section. To check if VLPR mode will work, changed configuration to VLPR and tested simple hello world, this worked at a baud rate of 9600. In Normal RUN, it is getting stuck in clock initialization section.
In VLPR mode, next tried USB CDC example code available in KSDK code, but no luck.
It would be great if someone can verify the following doubts we have
Solved! Go to Solution.
Hi
Check how MCG_C2 is being set - either for the oscillator's low or high gain mode. If this doesn't match the circuit the crystal may not start.
Try a binary at the KL25 link below to see whether it work (it uses 8MHz crystal in low gain mode so you may have to remove crystal loading).
Note that USB won't work in VLPR since it needs at least 20Mhz core to be able to operate.
Regards
Mark
http://www.utasker.com/kinetis.html
http://www.utasker.com/kinetis/FRDM-KL25Z.html
Hi
Check how MCG_C2 is being set - either for the oscillator's low or high gain mode. If this doesn't match the circuit the crystal may not start.
Try a binary at the KL25 link below to see whether it work (it uses 8MHz crystal in low gain mode so you may have to remove crystal loading).
Note that USB won't work in VLPR since it needs at least 20Mhz core to be able to operate.
Regards
Mark
http://www.utasker.com/kinetis.html
http://www.utasker.com/kinetis/FRDM-KL25Z.html
Hii,
Thanks for the reply. I tried dumping two bin files via JFLASH uTaskerV1.4.8_BM_FRDM-KL25Z_8080.bin and uTaskerSerialBoot_FRDM-KL25Z_KBOOT_HID_UART_MSD.bin. But couldn't flash. I gave start address as 0 and have removed the load capacitors across crystal.
Is there any setting which needs to be changed?
Hi
The serial loader binary file can be programmed to start address 0. If you can't flash it you may have a problem with the HW since it is a normal binary file.
You can try with KDS instead if you use the open source project at the links I gave.
Regards
Mark
Hi Mark,
After removing the two load capacitors across crystal, my code started working. It enumerates as USB, generates PWM as per our requirement. Any idea on why this will happen? If I re-solder the Cs same issue starts again.
Thanks for the help...
Hi
As noted previously the crystal will not always start if the MCG configuration doesn't match its HW circuit.
Regards
Mark