Problems using a FRDM-25KLZ to program a MKL25Z128VFM4

14 Apr 2014

I'm trying to use a a FRDM-25KLZ to program a MKL25Z128VFM4 (QFN-32).

After copying the .bin file to the MBED usb drive a file called "fail.txt" appeares. The file contains the text "SWD ERROR".

As far as I can tell I have connected everything correctly, I have verified that I have 3.3V on VDD and VDDA. The crystal is notoscillating, but I think that is normal at before the chip has been programmed(?)

I made a breakoutboard for the MCU: /media/uploads/emilj/schematic2.png

I have cut the trace between the two pins of J11 and soldered wires from J6 to my breakout board like this:

J6 My board 1 Vdd 2 SWD_DIO (pin 13) 3 Gnd 4 SWD_CLK (pin 10) 5 Gnd 6 N/C 7 N/C 8 N/C 9 N/C 10 Reset_b (pin 19)

14 Apr 2014

I think the oscillator should probably be running even when it is not yet used because the processor starts up on the internal oscillator. Anyhow, the schematic shows that you should place a 1M resistor across the xtal. How did you measure the oscillator signal? Using a scope probe sometimes stops the oscillator...

14 Apr 2014

So maybe it's an oscillator anyway then..

I have tried both with the 1M resistor and without it. (I have also tried two different types of 8Mhz crystals and other capacitor values than 22pF.)

I measure the crystal using a scope with a 10x probe. If I understand correctly, that is less likely to stop the oscillator than a 1x probe, but it could still happen. When I measure the crystal on a FRDM board using the scope it doesn't stop.

14 Apr 2014

Since it starts on its internal oscillator that shouldn't be the issue. It could be the issue when it programs succesfully, and then fails to run (in which case you could also use mbed-src and modify the clock setup, there is one predefined clock setup which uses the internal RC oscillator).

Try verifying that the other signals get correctly to your microcontroller.

14 Apr 2014

Every 20ms as long as it's powered there is a 1.6MHz signal on the CLK line for 35uS. When I try to program I get a 1MHz clock and some activity on SWD and Reset.

All the lines are at near 3.3V when on, so it appares the signals are geting to the MCU, but I don't know if this is what the signal should look like. I can try to save the data from the DSO if that would be usefull.

30 Apr 2014

It turned out that the problem was the cable from J6 to my board. It was 25cm long, I cut it down to 10cm and soldered a new connector. After that it's been working.