SWD stopped working on LPC 54608

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

SWD stopped working on LPC 54608

922 Views
markoLPC
Contributor I

Debugging capability suddenly stopped on our two boards with LPC 54608. 
We're using Jlink PRO with MCUExpresso 11.7.0_9198 on Ubuntu 22.04.
MCUs Vcc is present, reset line does work.
Debugger/adapter/cable work as we can debug on other boards. 
Otherwise the MCUs work normally, we can program them thru USB.

Is there a tool, for Linux to check the SWD registers, or maybe to unbrick the debugger port? 

We also don't exclude that ports were damaged because the ESD. 

The output from a IDE/debugger when failing to connect to target is:

--------------------------------------------------------------------------------------------------------------------------------------

SEGGER J-Link GDB Server V7.88h Command Line Version

JLinkARM.dll V7.88h (DLL compiled Jun 16 2023 09:21:40)

Command line: -SettingsFile "/home/***/Debug/kraf2 JLink Debug SettingsFile.jlink" -nosilent -swoport 2337 -select IP -telnetport 2338 -singlerun -endian little -noir -speed 4000 -port 2339 -vd -device LPC54608J512 -if SWD -halt -reportuseraction
-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 2339
SWO raw output listening port: 2337
Terminal I/O port: 2338
Accept remote connection: yes
Generate logfile: off
Verify download: on
Init regs on start: off
Silent mode: off
Single run mode: on
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: IP
J-Link script: none
J-Link settings file: "/home/***/Debug/kraf2 JLink Debug SettingsFile.jlink"
------Target related settings------
Target device: LPC54608J512
Target device parameters: none
Target interface: SWD
Target interface speed: 4000kHz
Target endian: little

Connecting to J-Link...
J-Link is connected.
Device "LPC54608J512" selected.
Firmware: J-Link Pro V5-1 compiled Jun 6 2023 10:50:24
Hardware: V5.10
S/N: 175102726
Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
Checking target voltage...
Target voltage: 3.21 V
Listening on TCP/IP port 2339
Connecting to target...
Failed to attach to CPU. Trying connect under reset.
ERROR: Could not connect to target.
Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...
Shutting down...
Could not connect to target.
Please check power, connection and settings.

------------------------------------------------------------------------------------------------------------------------------

Error in final launch sequence:

Failed to execute MI command:
-target-select remote localhost:2339

Error message from debugger back end:
Remote communication error. Target disconnected.: Connection reset by peer.
Failed to execute MI command:
-target-select remote localhost:2339

Error message from debugger back end:
Remote communication error. Target disconnected.: Connection reset by peer.
Remote communication error. Target disconnected.: Connection reset by peer.
----------------------------------------------------------------------------------------------------------------------------------

Thank you 

Labels (1)
0 Kudos
Reply
6 Replies

826 Views
frank_m
Senior Contributor III

Did you try a Flash mass erase, and connect then ?

Perhaps your code reconfigures and uses the JTAG/SWD pins of the MCU.

0 Kudos
Reply

903 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi markoLPC 

We can use Jlink commander to test basic SWD connection.

I suggest you setting board in ISP mode first.

then follow attached video to test SWD interface.

My test is base on LPC54628, please change your device for the Jlink commander.

Hope this helps,

Jun Zhang

 

0 Kudos
Reply

855 Views
markoLPC
Contributor I

Thank you for kind reply. 

What ISP setting did you meant ? Unfortunately our boards have only two options:

First -> Flash, no ISP. (ISP-0 = 1, ISP-1 = 1, ISP-2 = 1)
Second -> USB 0 Mass Storage Device Class (MSC). (ISP-0 = 1, ISP-1 = 0, ISP-2 = 1)

We've tried both, this is the JLink Commander output:

Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>
Device "LPC54608J512" selected.


Connecting to target via SWD
Failed to attach to CPU. Trying connect under reset.
Cannot connect to target.
J-Link>

0 Kudos
Reply

838 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi markoLPC 

Please try jlink commander unlock command. It may unclock SWD interface

ZhangJennie_0-1688626143651.png

Thanks,

Jennie

0 Kudos
Reply

833 Views
markoLPC
Contributor I

Jennie thank you for suggestion.
We've tried, unfortunately unlocking was unsuccessful.

This is the JLink output:

J-Link>unlock LPC5460X
Unlocking device...failed.

0 Kudos
Reply

826 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

Not sure if your SWD is secured by ECRP.

Attached please find LPC546xxMassErase.scp.

Assume that you are also using MCUXpressoIDE_11.4.0_6237 and you have also installed it in C:\nxp\MCUXpressoIDE_11.4.0_6237.

  1. Please place LPC546xxMassErase.scp to C:\nxp\MCUXpressoIDE_11.4.0_6237\ide\binaries\Scripts.
  2. Open a Command Prompt window.
  3. Change the path to C:\nxp\MCUXpressoIDE_11.4.0_6237\ide\binaries.

ZhangJennie_0-1688631182832.jpeg

  1. Execute the command of redlinkserv -commandline.
  2. After the execution of the command of redlinkserv -commandline, you should see redlink> prompt.

ZhangJennie_1-1688631182859.jpeg

  1. Execute the command of load "C:\nxp\MCUXpressoIDE_11.4.0_6237\ide\binaries\Scripts\LPC546xxMassErase.scp".
  2. After the execution of the command of load "C:\nxp\MCUXpressoIDE_11.4.0_6237\ide\binaries\Scripts\LPC546xxMassErase.scp", you should see Loading " LPC546xxMassErase.scp".

ZhangJennie_2-1688631182888.jpeg

  1. Execute the command of run.
  2. After the execution of the command of run, you should see messages below.

ZhangJennie_3-1688631182984.jpeg

Thanks,

Jennie

0 Kudos
Reply