TWR-KL25Z48M SWD port

cancel
Showing results for 
Search instead for 
Did you mean: 

TWR-KL25Z48M SWD port

Jump to solution
1,595 Views
YS
Contributor IV

Does anybody know, or have ever tried, to connect J-Link (or any JTAG/SWD debugger pod) to Freescale TWR-KL25Z48M SWD connector (J10)?

In my environment (Windows XP Home, IAR embedded workbench 6.60 32K-limited eval version), OpenSDA USB-filesystem firmware programming working okay but I cannot use it as debug port. The PEMicro driver keep saying "Port undetedted". It is a problem, but not the question I want to ask here.

So I tried to use the SWD connector (J10) with a SEGGER J-LINK adapter. It does not work. When I tried to download firmware, IAR workbench says "failed to reset target processor".

I checked with J-Link commander. Even though it failed to detect target on JTAG/SWD chain, I can reset the KL25 processor when I select SWD interface (command:si 1) and reset (command:r). When I tried HALT command (command:h), the target KL25 reboots many time. I think the SWD pins from KL25 target is conflicted between SEGGER J-Link on SWD connector J10 and on-board OpenSDA K20.

I googled about TWR-KL25 and SWD but no hit. I found another KL25 platform, FRDM-KL25 has J11 trace on bottom layer to isolate OpenSDA from KL25 (actually it disconnects K20 SPI0_CLK from KL25 SWD_CLK). I checked out TWR-KL25 schematics, there is no such provision. Instead the OpenSDA SWD pins of TWR-KL25 is get through 3-state switch (U506 74LVC125ADB) and controlled by K20 GPIO pins, so I think there must be some way to isolate OpenSDA from SWD connector.

The users's manual (TWR-KL25-UM) does not mention anything. It simply states "There are two debug interface options provided: the on-board openSDA circuit and an external ARM SWD connector." But apparently, connecting SWD deubugger to J10 without disabling on-board OpenSDA does not work.

Tags (3)
0 Kudos
1 Solution
733 Views
al_muir
NXP Employee
NXP Employee

Sasaki-san,

The problem you have described is already known about and 2 workarounds exist to solve it. Please refer to the Tower board errata at:

http://cache.freescale.com/files/soft_dev_tools/doc/errata/TWR-KL25Z_ERRATA.pdf?fpsp=1&WT_TYPE=Errat...

This should allow you to use the external debug adaptor.

Regards,

Alistair

View solution in original post

0 Kudos
6 Replies
733 Views
manumr
Contributor II

error 17926. target type mcu mismatch. unexpexted processor type detected.

aborting bebug session

0 Kudos
734 Views
al_muir
NXP Employee
NXP Employee

Sasaki-san,

The problem you have described is already known about and 2 workarounds exist to solve it. Please refer to the Tower board errata at:

http://cache.freescale.com/files/soft_dev_tools/doc/errata/TWR-KL25Z_ERRATA.pdf?fpsp=1&WT_TYPE=Errat...

This should allow you to use the external debug adaptor.

Regards,

Alistair

0 Kudos
733 Views
YS
Contributor IV

Thank you to pointing me eratta document, Mr Muir.

I have TOWER elevator board so I connected USB power from it, confirmed SEGGER J-LINK works either download firmware and debug trace.

Now I have to find way to connect UART to my PC without using on-board OpenSDA UART-USB function. It seems like jumper J24 and J25 can disconnect K25 UART0 pins from K20, route it to elevator connector A43 and A44. So I have to take some soldering on a TWR-PROTO board for RS-232C level converter.

0 Kudos
733 Views
Paul_Tian
NXP Employee
NXP Employee

Hi, Sasaki

I think you can do following testing first.

1. Check if you can use OpenSDA to download code.

2. Check if your connection is correct.

I tested TWR-KL25, it can work well.

Best Regards

Paul

0 Kudos
733 Views
YS
Contributor IV

Mr Tian,

It is indeed strange that, as I wrote, I can download firmware (.srec file) through OpenSDA virtual USB drive with no problem. It works great.

However when I try to debug the code from IAR workbench (or KEIL uVision), OpenSDA JTAG driver from PE Micro says "port undetected".

0 Kudos
733 Views
YS
Contributor IV

Okay, it's self-solved. I had to re-program OpenSDA firmware with "DEBUG-APP_Pemicro_v***.SDA". JTAG debug can not be used when OpenSDA firmware is configured with USB Mass Storage mode.

0 Kudos