Cannot program custom kl05z board

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

Cannot program custom kl05z board

3,195 Views
kacperpiotrowsk
Contributor II

Hi everyone,

I have been dealing with this issue for a very long time, and since I was unable to resolve it I decided to actually ask someone else.

The custom kl05z board (for the mkl05 microcontroller) refuses to be programmed by using the header in the original kl05z board.

RESET, SWDIO, SWDCLK, VCC, GND have been connected to the respective pins on kl05z. The CLK signal is disconnected from the on-board microcontroller. There is 1 uF capacitor on the power, no additional pull-ups or capacitors on all other pins since they are already on the original board.

After an attempt to load program there is a window saying: "Kinetis device is locked! Do you want to unlock it ? Mass Erase will be executed!"

I click yes, then there are windows popping saying:

1. AGDI - Cortex-M Error "Cannot access memory"

2. Error: Flash Download failed  -  Target DLL has been cancelled

Unfortunately, this has been happening over and over again with no clear reason why is that happening. Electrically the signals are quite alike, see the attachments: the original signal is same with the difference in not having those weird "peaks". Is there any answer why is that happening?

Original Attachment has been moved to: headlamp.brd.zip

Original Attachment has been moved to: headlamp.sch.zip

9 Replies

2,098 Views
CARA01
Contributor I

Still no solution?

0 Kudos
Reply

2,783 Views
gbm
Contributor II

Make sure that NMI line is pulled UP or not pulled at all. NMI is the default function of some port line and pulling it down makes it impossible to program the Flash using SWD.

Had the same problem 3 months ago. :smileywink:

2,783 Views
kacperpiotrowsk
Contributor II

Thanks! I will check this out and let you know if I succeed.

edit: in my design the NMI pin (PTB5) is not connected to anything, but I tried to add a pull-up anyway. It didn't work, I will try to add a proper pull-up and a capacitor near the RESET pin and let you know afterwards. You can see one leg of a 10kohm resistor on this picture going to a PTB5 pin.

IMG_20151013_211652.jpg

0 Kudos
Reply

2,783 Views
isaacavila
NXP Employee
NXP Employee

Hello Kacper,

What do you refer to "original KL05 board" in statement "The custom kl05z board (for the mkl05 microcontroller) refuses to be programmed by using the header in the original kl05z board"?

Regards,

Isaac

0 Kudos
Reply

2,783 Views
kacperpiotrowsk
Contributor II

The original board is the kl-05z board. The custom board is a pcb designed by me from scratch based on mkl05 microcontroller. I have trouble with my custom board, which design is included in the .sch file attached.

0 Kudos
Reply

2,783 Views
isaacavila
NXP Employee
NXP Employee

Hello Kacper,

Could you please attach your schematic in PDF version?.

There some posts from that talk about using a FRDM board in order to program/debug another board, maybe these posts could be useful for you.

Using the Freescale Freedom (FRDM-KL43Z) to Debug other Boards | MCU on Eclipse

Using the Freedom Board as SWD Programmer | MCU on Eclipse

Using FRDM-K64F Board to debug another Kinetis Board | MCU on Eclipse

Best Regards,

Isaac

0 Kudos
Reply

2,783 Views
kacperpiotrowsk
Contributor II

Hi there,

here's the schematic, please be patient if something is wrong, I'm still learning. The capacitor near the microcontroller was changed to 1uF and is placed very close physically.

0 Kudos
Reply

2,783 Views
isaacavila
NXP Employee
NXP Employee

Hello Kacper,

Based on FRDM-KL05Z board, you should try adding an external pull-up resistor on Reset Pin and 1uF Capacitor on it. Also, please be sure to avoid a zero-logic level on NMI pin.

Reset Pin.jpg

I hope this can help you.

Best Regards,

Isaac

2,783 Views
kacperpiotrowsk
Contributor II

Hi there Isaac,

Thanks for help, I added a pull-up resistor and a capacitor on the board as presented on the RESET pin.

IMG_20151017_234925.jpg

You can see them just on the right edge of the uC. The NMI pin is pulled - up. Unfortunately, this didn't work. During the programming, the voltage in time looks as follows on the RESET pin:

NewFile1.png

You can see the RESET pin goes down during the programming. The visible oscillating high state is actually a sawtooth:

NewFile2.png

Which is normal for non-programmed mkl05z - the uC just keeps turning itself on and off. The board is powered externally. Is there anything I can still do to make this thing work?

0 Kudos
Reply