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
Still no solution?
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:
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.
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
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.
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
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.
I hope this can help you.
Best Regards,
Isaac
Hi there Isaac,
Thanks for help, I added a pull-up resistor and a capacitor on the board as presented on the RESET pin.
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:
You can see the RESET pin goes down during the programming. The visible oscillating high state is actually a sawtooth:
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?