OpenSDA on FRDM-KL05 debug external processor

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

OpenSDA on FRDM-KL05 debug external processor

Jump to solution
9,333 Views
dieterteuchert
Contributor IV

In the FRDM-KL05Z user manual on page 7 "5.2.1 Debug Interface" there is a short description of how to use the OpenSDA debug interface with an external CPU. After making a board with a KL15 processor, i tried to connect it.

First i found a minor confusion in the Jumper J6 connections. The internal KL05 remains connected when you cut the trace below J6. In fact J6 operates on the external processor SWD_CLK. I had to cut another trace and solder a wire to the correct side of J6.

Now the SDA connection to the external processor seemed to work, but then i got a messagebox: "Error 17926. Target MCU mismatch. OpenSDA hardware only supports debugging the resident target processor..." How can we resolve this problem and debug the external KL15 board?

In the meantime i found Erich Styger's BLOG concerning the "Error 17926", more or less with the result that the 5.2.1 chapter was considered obsolete. They could not make it work.

Labels (1)
Tags (1)
1 Solution
3,655 Views
dieterteuchert
Contributor IV

Good news:

The FRDM-KL05Z DOES debug an external KL15 processor, once the problem i mentioned in my first post about the wrong connection of jumper J6 is resolved correctly. The bad trace with the SWD_CLK signal comes from U4D Pin11, passes the KL05, the board connector J10 Pin4 (PTA0) and ends at J6 Pin1. That trace needs to be cut between U4D and the KL05. Then a bridge is needed from the open end coming from U4D and the J6 Pin2, or directly to the SWD connector Pin4 as the image shows.

FRDM_KL05Z_Fix.png

Now it works as described in the FRDM-KL05Z user manual "5.2.1 Debug Interface". It works with both the "DEBUG-APP_Pemicro_v106.SDA" and the "CMSIS_DAP.s19". I have even seen the MTB in action. And with J6 closed one can debug the onboard KL05.

View solution in original post

0 Kudos
Reply
13 Replies
3,655 Views
BlackNight
NXP Employee
NXP Employee

Hi Dieter,

wow, increcible. You solved my problem why I was not able to use  the J1 debug connector with a P&E Multilink, if J1 was cut!

Thank you, thank you, thank you!

0 Kudos
Reply
3,655 Views
BlackNight
NXP Employee
NXP Employee

I have posted my steps and findings here: Debug External Processors with USBDM and Freedom Board

0 Kudos
Reply
3,655 Views
jackblather
Senior Contributor I

It looks like a similar, maybe even easier, thing exists for the Vybrid Tower CPU boards.

Between the K20 and the Vybrid CPUs are just two lines, SWDIO and SWDCLK. These two signals go to both J5 and J11. Those two lines can be disconnected from the Vybrid CPU by removing two zero-ohm,reistors R149 and R150.

Then, a simple cable between between J5 on both CPU boards will let one act as a debugger for CMSIS-DAP for the other, which is the target. That cable might also provide +3.3v to the target, too.

I have not actually tried this, but it looks very promising.

0 Kudos
Reply
3,655 Views
dieterteuchert
Contributor IV

Thanks for your blog on using the USBDM.

Currently i am not using USBDM, but just the Pemicro OpenSDA downloads.

And i have used two free pins on the J1 10-pin SWD connector to route the UARTn_TX and UARTn_RX signals from my external processor (KL15) to the K20 on the FRDM_KL05Z. This works if i put one of the blinker samples into the resident KL05, so the KL05 UART0_TX output pin remains disabled. For safety i put another 1 KOhm into the TX line from the external processor. So, the FRDM_KL05Z can now be used as a debugger for the external KL15, including the USB_CDC UART connection.

0 Kudos
Reply
3,655 Views
BlackNight
NXP Employee
NXP Employee

I have solved as well the remaing problem for using USBDM on the FRDM-KL05Z: Debugging FRDM-KL05Z with USBDM

About that wrong J6 wiring: I have passed your findings to the board designers within Freescale so it can be addressed. Thanks again on finding this problem!

0 Kudos
Reply
3,656 Views
dieterteuchert
Contributor IV

Good news:

The FRDM-KL05Z DOES debug an external KL15 processor, once the problem i mentioned in my first post about the wrong connection of jumper J6 is resolved correctly. The bad trace with the SWD_CLK signal comes from U4D Pin11, passes the KL05, the board connector J10 Pin4 (PTA0) and ends at J6 Pin1. That trace needs to be cut between U4D and the KL05. Then a bridge is needed from the open end coming from U4D and the J6 Pin2, or directly to the SWD connector Pin4 as the image shows.

FRDM_KL05Z_Fix.png

Now it works as described in the FRDM-KL05Z user manual "5.2.1 Debug Interface". It works with both the "DEBUG-APP_Pemicro_v106.SDA" and the "CMSIS_DAP.s19". I have even seen the MTB in action. And with J6 closed one can debug the onboard KL05.

0 Kudos
Reply
3,655 Views
dieterteuchert
Contributor IV

Thanks for all the help. In the meantime i have a partial result, using these steps:

1) Using the Pemicro download (Hui_Ma answer) i updated the KL25Z firmware to version 1.08 using the BOOTUPDATEAPP.SDA. It did not work right away by drag and drop, but only by cut and paste. One needs to check the SDA_INFO.HTM in Bootloader mode.

2) Then i used the USBDM_OpenSDA.sx (DerekLau answer) to convert the FRDM board into a USBDM device. It enumerated as unknown device.

3) Then i used the Win64 driver package from the USBDM site to make the device enumerate as a USBDM (Erich Styger answer). The USB_CDC serial connection got lost, so this applies more to a FRDM-KL25Z, were the DUT has its own USB port. By the way there is a very nice tutorial of Erich Styger on how to implement a CDC connection using Freescale components and ProcessorExpert. I made it work within 3 or 4 hours, including the LEDs.

Then i got stuck once more trying to set up the GDI debugging in Codewarrior (Erich Styger second answer). I found a description on how to do it, but it appeared outdated. There was another document from Keil that mentioned a CMSIS_DAP.s19, until now i did not have time to follow that. I am wondering if someone is successfully using another development tool for Kinetis KL15 development, i mean other than Pemicro.

0 Kudos
Reply
3,655 Views
BlackNight
NXP Employee
NXP Employee

I managed to use the FRDM-KL25Z to program another KL25Z.

Programming, not debugging.

Using the Freedom Board as JTAG Programmer | MCU on Eclipse

0 Kudos
Reply
3,655 Views
ZhangJennie
NXP TechSupport
NXP TechSupport
0 Kudos
Reply
3,655 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Please check below link to download P&E OpenSDA driver.

http://www.pemicro.com/opensda/index.cfm

Wish it helps.

0 Kudos
Reply
3,655 Views
DerekLau
Contributor IV

Download USBDM_OpenSDA.zip at http://sourceforge.net/projects/usbdm/files/Version%204.10.4/Installation/ and follow the instruction in the OpenSDA.txt file.

3,655 Views
dieterteuchert
Contributor IV

Thanks for your recommendation. After installation of that OpenSDA.sx the FRMD-KL05Z enumerates, but as "other devices/unknown device". Same with a FRDM-KL25Z that we have. I also downloaded the complete USBDM 4.10.4 .msi archive and installed successfully, yet device remains unknown. Do you know where "USBDM drivers" should come from?

0 Kudos
Reply
3,655 Views
BlackNight
NXP Employee
NXP Employee

I had to install the drivers from USBDM - Browse /Version 4.10.4/Installation at SourceForge.net

There is a 32bit and 64bit package.

After that, the USBDM enumerated properly.

My problem is: I have not found any documentation how to setup the GDI in CodeWarrior for MCU10.3?

Anyone knows that piece?