Debugging RT1176 with MCU-Link and GDB

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

Debugging RT1176 with MCU-Link and GDB

323 Views
raddeh
Contributor III

Currently we've been using JLink for debugging our custom RT1176 based boards. Now we evaluate a switch to MCU-Link Base, but I'm facing problems during the connection.

The LinkServer application reports unconnected pins. But we verified the correct connection of the MCU Link Base pins on J2 (SWD interface):

  • MCU-Link J2 pin 1 3V3 connected as VREF
  • MCU-Link J2 pin 3,5,7,9 GND connected
  • MCU-Link J2 pin 10 RST connected
  • MCU-Link J2 pin 4 SWD-CLK connected
  • MCU-Link J2 pin 2 SWD-IO connected

We're only not using MCU-Link J2 pin 6 SWO, which is left floating.

On the JLink-Base this setup works with the following command:

JLinkGDBServer -endian little -noir -speed 4000 -port 2331 -device MIMXRT1176xxxA_M7 -if SWD -halt -reportuseraction

Now we connect the MCU-Link instead and run the LinkServer with the following command:

LinkServer -l 5 gdbserver   MIMXRT1176xxxxx:MIMXRT1170-EVK-CM7-ONLY

 

This results in the following output:

[116]DEBUG:asyncio: Using selector: EpollSelector
[504]INFO:launcher.cli.utils.funcs: Exact match for MIMXRT1176xxxxx:MIMXRT1170-EVK-CM7-ONLY found
[504]INFO:launcher.cli.utils.click: Selected device MIMXRT1176xxxxx:MIMXRT1170-EVK-CM7-ONLY
[505]DEBUG:launcher.core.redlinkserv: Starting redlinkserv: /usr/local/LinkServer_24.9.75/binaries/redlinkserv ['--port', '11111', '--telnetport', '12222', '--no-telnet-defaults']
[508]DEBUG:launcher.core.probeboot: Listing usb devices
[508]DEBUG:launcher.core.utils: Subprocess exec: lsusb []
[511]DEBUG:launcher.core.redlinkserv: Connecting to redlinkserv (localhost:12222)
[515]DEBUG:launcher.core.redlinkserv: Connected to redlinkserv
[515]DEBUG:launcher.core.redlinkserv: [read] 
[518]DEBUG:launcher.core.probeboot: Found 16 USB devices
[518]INFO:launcher.cli.utils.click: Getting available probes
[518]DEBUG:launcher.core.redlinkserv: [write] probelist
[1606]DEBUG:launcher.core.redlinkserv: [read-partial] b'Index = 1\nManufacturer = NXP Semiconductors\nDescription = MCU-LINK (r0BF) CMSIS-DAP V3.148\nSerial Number = QP1Q5X3JAG0LE\nVID:PID = 1FC9:0143\nPath = 0003:0012:00\n\n\n'
[1649]DEBUG:launcher.core.redlinkserv: [read] Index = 1
Manufacturer = NXP Semiconductors
Description = MCU-LINK (r0BF) CMSIS-DAP V3.148
Serial Number = QP1Q5X3JAG0LE
VID:PID = 1FC9:0143
Path = 0003:0012:00
[1649]INFO:launcher.cli.utils.click: Selected probe #1 QP1Q5X3JAG0LE (MCU-LINK (r0BF) CMSIS-DAP V3.148)
[1650]INFO:launcher.core.redlinkserv: MCU-Link firmware update `check`: local firmware [3.148] is the same as the version running on the selected probe ([QP1Q5X3JAG0LE] [MCU-LINK (r0BF) CMSIS-DAP V3.148])
Firmware update `check`: not required - the update can be performed using `forced` mode
[1650]DEBUG:launcher.core.redlinkserv: [write] probeopenbyindex 1
[1651]DEBUG:launcher.core.redlinkserv: [read-partial] b'Probe Handle 1 Open\n'
[1693]DEBUG:launcher.core.redlinkserv: [read] Probe Handle 1 Open
[1693]DEBUG:launcher.core.redlinkserv: [write] wireswdconnect 1
[1815]DEBUG:launcher.core.redlinkserv: [read-partial] b'Error: Wire Ack Fault - target connected?\n'
[1857]DEBUG:launcher.core.redlinkserv: [read] Error: Wire Ack Fault - target connected?
[1857]DEBUG:launcher.core.redlinkserv: [write] coreconfig 1
[1857]DEBUG:launcher.core.redlinkserv: [read-partial] b'Error: Wire not connected\n'
[1901]DEBUG:launcher.core.redlinkserv: [read] Error: Wire not connected
[1901]DEBUG:launcher.core.redlinkserv: [write] corelist 1
[1902]DEBUG:launcher.core.redlinkserv: [read-partial] b'Error: Wire Ack Fault - target connected?\n'
[1945]DEBUG:launcher.core.redlinkserv: [read] Error: Wire Ack Fault - target connected?
[1946]DEBUG:launcher.cli.cmd.gdbserver: Starting stubs
[1949]DEBUG:launcher.core.stub: Wrote stub XML: /tmp/tmpvi5emm95/crt_directory.xml
[1950]DEBUG:launcher.core.stub: Wrote stub XML: /tmp/tmpvi5emm95/part.xml
[1950]DEBUG:launcher.core.stub: Internal gdbserver (3333) ports: stub_port=13333, sh_stub_port=14444, stdout_port=15555
[1954]DEBUG:launcher.core.stub: GDB server args: ['--redlink-port', '11111', '--flash-dir', '/usr/local/LinkServer_24.9.75/binaries/Flash', '-x', '/tmp/tmpvi5emm95', '-pMIMXRT1176xxxxx', '--vendor', 'NXP', '-g', '--cache', 'dis', '--probeserial', 'QP1Q5X3JAG0LE', '--coreindex', '0', '--kill-server', '--server', 'localhost:13333', '--telnet', '14444', '--msg-port', '15555', '--connectscript', 'RT1170_connect_M7.scp', '--resetscript', 'RT1170_reset_M7.scp']
GDB server listening on port 3333 in debug mode (core cm7)
Semihosting server listening on port 4444 (core cm7)
[1960]DEBUG:launcher.core.stub: [stub (3333)] Ns: MCUXpresso IDE RedlinkMulti Driver v24.9 (Sep 19 2024 19:39:44 - crt_emu_cm_redlink build 802)

Now we connect gdb to the port 3333 and get the following output of LinkServer. Then the application automatically closes.

[343937]DEBUG:launcher.core.stub: Received connection to our GDB server (3333)
[343938]DEBUG:launcher.core.stub: Connected to stub's GDB port (13333)
[343938]INFO:launcher.cli.cmd.gdbserver: Connected to core cm7
[343938]DEBUG:launcher.core.stub: GDB (3333) -> stub (13333): b'+$qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+#df'
[343938]DEBUG:launcher.core.stub: [stub (3333)] Pc: (  0) Reading remote configuration
[343938]DEBUG:launcher.core.stub: [stub (3333)] Wc(03). No cache support.
[343938]DEBUG:launcher.core.stub: [stub (3333)] Nc: Found generic directory XML file in /tmp/tmpvi5emm95/crt_directory.xml
[343939]DEBUG:launcher.core.stub: [stub (3333)] Pc: (  5) Remote configuration complete
Nc: Reconnected to existing LinkServer process.
[344061]DEBUG:launcher.core.stub: [stub (3333)] Nc: Connecting to probe 1 core 0 (using server started externally) reports:
    'Ee(42). Could not connect to core.'
Nc: Retrying...
[345806]DEBUG:launcher.core.stub: [stub (3333)] Nc: Reconnected to existing LinkServer process.
[345938]DEBUG:launcher.core.stub: GDB (3333) -> stub (13333): b'$qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+#df'
[346426]DEBUG:launcher.core.stub: [stub (3333)] Nc: Server OK but no connection to probe 1 core 0 (after 3 attempts) - Ee(42). Could not connect to core.
[346549]DEBUG:launcher.core.stub: [stub (3333)] Wc: ============= SCRIPT: RT1170_connect_M7.scp =============
Wc: RT1170 Connect M7 Script
Wc: Error: Wire Ack Fault - target connected?
Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: View cores on the DAP AP
Wc: Error: Wire Ack Fault - target connected?
Wc: Error: Wire not connected
[346549]DEBUG:launcher.core.stub: [stub (3333)] Wc: Error: Wire not connected
Wc: ============= END SCRIPT ================================
[346668]DEBUG:launcher.core.stub: [stub (3333)] Ed:02: Failed on connect: Ee(42). Could not connect to core.
Et:31: No connection to chip's debug port
Pc: (100) Target Operation Failed
[346669]DEBUG:launcher.core.stub: Stub socket closed (13333). Closing GDB socket (3333)
[346669]DEBUG:launcher.core.stub: Stub stdout socket closed (15555)
[346669]DEBUG:launcher.core.stub: GDB socket closed (3333). Closing stub socket (13333)
[346669]INFO:launcher.cli.cmd.gdbserver: Disconnected from core cm7
Gdbserver on port 3333 has closed
[346670]DEBUG:launcher.core.redlinkserv: [write] exit
[346670]DEBUG:launcher.core.redlinkserv: Waiting for redlinkserv to close
[346769]DEBUG:launcher.core.redlinkserv: Redlinkserv has closed

 

Is this some setup issue on our side? The SWD interface to the RT1176 works in general, as verified via the JLink-Base debugger. But does the MCU-Link require some special setup? Or do we miss a certain parameter in our LinkServer call?

 

Tags (2)
0 Kudos
Reply
13 Replies

14 Views
Littell
Contributor II

Could it be a cable problem from the MCU-Link to your board?

0 Kudos
Reply

118 Views
Littell
Contributor II

Something I noticed that may or may not be relevant: Your LinkServer command line is

LinkServer -l 5 gdbserver   MIMXRT1176xxxxx:MIMXRT1170-EVK-CM7-ONLY

...which makes me think it's for an EVK, not an EVKB.  What happens if you use something like

LinkServer -l 5 gdbserver   MIMXRT1176xxxxx:MIMXRT1170-EVKB-CM7-ONLY

 ...instead?  

0 Kudos
Reply

56 Views
raddeh
Contributor III

@LittellIt is neither a EVK nor a EVKB, as it's a custom board. But I tried with EVKB as cmd line parameter and encountered the same error:

 

 LinkServer -l 5 gdbserver   MIMXRT1176xxxxx:MIMXRT1170-EVKB
[115]DEBUG:asyncio: Using selector: EpollSelector
[502]INFO:launcher.cli.utils.funcs: Exact match for MIMXRT1176xxxxx:MIMXRT1170-EVKB found
[503]INFO:launcher.cli.utils.click: Selected device MIMXRT1176xxxxx:MIMXRT1170-EVKB
[503]DEBUG:launcher.core.redlinkserv: Starting redlinkserv: /usr/local/LinkServer_24.9.75/binaries/redlinkserv ['--port', '11111', '--telnetport', '12222', '--no-telnet-defaults']
[506]DEBUG:launcher.core.probeboot: Listing usb devices
[506]DEBUG:launcher.core.utils: Subprocess exec: lsusb []
[509]DEBUG:launcher.core.redlinkserv: Connecting to redlinkserv (localhost:12222)
[514]DEBUG:launcher.core.redlinkserv: Connected to redlinkserv
[514]DEBUG:launcher.core.redlinkserv: [read] 
[515]DEBUG:launcher.core.probeboot: Found 15 USB devices
[516]INFO:launcher.cli.utils.click: Getting available probes
[516]DEBUG:launcher.core.redlinkserv: [write] probelist
[1597]DEBUG:launcher.core.redlinkserv: [read-partial] b'Index = 1\nManufacturer = NXP Semiconductors\nDescription = MCU-LINK (r0BF) CMSIS-DAP V3.148\nSerial Number = QP1Q5X3JAG0LE\nVID:PID = 1FC9:0143\nPath = 0003:0013:00\n\n\n'
[1638]DEBUG:launcher.core.redlinkserv: [read] Index = 1
Manufacturer = NXP Semiconductors
Description = MCU-LINK (r0BF) CMSIS-DAP V3.148
Serial Number = QP1Q5X3JAG0LE
VID:PID = 1FC9:0143
Path = 0003:0013:00
[1638]INFO:launcher.cli.utils.click: Selected probe #1 QP1Q5X3JAG0LE (MCU-LINK (r0BF) CMSIS-DAP V3.148)
[1639]INFO:launcher.core.redlinkserv: MCU-Link firmware update `check`: local firmware [3.148] is the same as the version running on the selected probe ([QP1Q5X3JAG0LE] [MCU-LINK (r0BF) CMSIS-DAP V3.148])
Firmware update `check`: not required - the update can be performed using `forced` mode
[1640]DEBUG:launcher.core.redlinkserv: [write] probeopenbyindex 1
[1640]DEBUG:launcher.core.redlinkserv: [read-partial] b'Probe Handle 1 Open\n'
[1682]DEBUG:launcher.core.redlinkserv: [read] Probe Handle 1 Open
[1682]DEBUG:launcher.core.redlinkserv: [write] wireswdconnect 1
[1805]DEBUG:launcher.core.redlinkserv: [read-partial] b'Error: Wire Ack Fault - target connected?\n'
[1846]DEBUG:launcher.core.redlinkserv: [read] Error: Wire Ack Fault - target connected?
[1846]DEBUG:launcher.core.redlinkserv: [write] coreconfig 1
[1846]DEBUG:launcher.core.redlinkserv: [read-partial] b'Error: Wire not connected\n'
[1890]DEBUG:launcher.core.redlinkserv: [read] Error: Wire not connected
[1890]DEBUG:launcher.core.redlinkserv: [write] corelist 1
[1890]DEBUG:launcher.core.redlinkserv: [read-partial] b'Error: Wire Ack Fault - target connected?\n'
[1934]DEBUG:launcher.core.redlinkserv: [read] Error: Wire Ack Fault - target connected?
[1934]DEBUG:launcher.cli.cmd.gdbserver: Starting stubs
[1937]DEBUG:launcher.core.stub: Wrote stub XML: /tmp/tmp9ow2bmr7/crt_directory.xml
[1938]DEBUG:launcher.core.stub: Wrote stub XML: /tmp/tmp9ow2bmr7/part.xml
[1938]DEBUG:launcher.core.stub: Internal gdbserver (3333) ports: stub_port=13333, sh_stub_port=14444, stdout_port=15555
[1940]DEBUG:launcher.core.stub: GDB server args: ['--redlink-port', '11111', '--flash-dir', '/usr/local/LinkServer_24.9.75/binaries/Flash', '-x', '/tmp/tmp9ow2bmr7', '-pMIMXRT1176xxxxx', '--vendor', 'NXP', '-g', '--cache', 'dis', '--probeserial', 'QP1Q5X3JAG0LE', '--coreindex', '0', '--kill-server', '--server', 'localhost:13333', '--telnet', '14444', '--msg-port', '15555', '--connectscript', 'RT1170_connect_M7_wake_M4.scp', '--resetscript', 'RT1170_reset.scp']
GDB server listening on port 3333 in debug mode (core cm7)
Semihosting server listening on port 4444 (core cm7)
[1947]DEBUG:launcher.core.stub: [stub (3333)] Ns: MCUXpresso IDE RedlinkMulti Driver v24.9 (Sep 19 2024 19:39:44 - crt_emu_cm_redlink build 802)
[10823]DEBUG:launcher.core.stub: Received connection to our GDB server (3333)
[10823]DEBUG:launcher.core.stub: Connected to stub's GDB port (13333)
[10823]INFO:launcher.cli.cmd.gdbserver: Connected to core cm7
[10824]DEBUG:launcher.core.stub: GDB (3333) -> stub (13333): b'+$qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+#df'
[10824]DEBUG:launcher.core.stub: [stub (3333)] Pc: (  0) Reading remote configuration
[10824]DEBUG:launcher.core.stub: [stub (3333)] Wc(03). No cache support.
[10824]DEBUG:launcher.core.stub: [stub (3333)] Nc: Found generic directory XML file in /tmp/tmp9ow2bmr7/crt_directory.xml
Pc: (  5) Remote configuration complete
[10824]DEBUG:launcher.core.stub: [stub (3333)] Nc: Reconnected to existing LinkServer process.
[10946]DEBUG:launcher.core.stub: [stub (3333)] Nc: Connecting to probe 1 core 0 (using server started externally) reports:
    'Ee(42). Could not connect to core.'
Nc: Retrying...
[12692]DEBUG:launcher.core.stub: [stub (3333)] Nc: Reconnected to existing LinkServer process.
[12824]DEBUG:launcher.core.stub: GDB (3333) -> stub (13333): b'$qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+#df'
[13316]DEBUG:launcher.core.stub: [stub (3333)] Nc: Server OK but no connection to probe 1 core 0 (after 3 attempts) - Ee(42). Could not connect to core.
[13558]DEBUG:launcher.core.stub: [stub (3333)] Wc: ============= SCRIPT: RT1170_connect_M7_wake_M4.scp =============
Wc: RT1170 Connect M7 and Wake M4 Script
Wc: Error: Wire Ack Fault - target connected?
Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: Setting M4 spin code
[13558]DEBUG:launcher.core.stub: [stub (3333)] Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: Setting M4 clock
Wc: Error: Wire not connected
Wc: Resetting M4 core
Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: View cores on the DAP AP
Wc: Error: Wire Ack Fault - target connected?
Wc: Error: Wire Ack Fault - target connected?
Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: ============= END SCRIPT ========================================
[13682]DEBUG:launcher.core.stub: [stub (3333)] Ed:02: Failed on connect: Ee(42). Could not connect to core.
Et:31: No connection to chip's debug port
Pc: (100) Target Operation Failed
[13682]DEBUG:launcher.core.stub: Stub stdout socket closed (15555)
[13683]DEBUG:launcher.core.stub: Stub socket closed (13333). Closing GDB socket (3333)
[13683]DEBUG:launcher.core.stub: GDB socket closed (3333). Closing stub socket (13333)
Gdbserver on port 3333 has closed
[13684]INFO:launcher.cli.cmd.gdbserver: Disconnected from core cm7
[13685]DEBUG:launcher.core.redlinkserv: [write] exit
[13685]DEBUG:launcher.core.redlinkserv: Waiting for redlinkserv to close
[13784]DEBUG:launcher.core.redlinkserv: Redlinkserv has closed
0 Kudos
Reply

51 Views
Littell
Contributor II

Bummer.  Sorry, I thought the EVK/EVKB distinction would make a difference as the EVKB uses an MCU-Link equivalent.  Good luck.

191 Views
Littell
Contributor II

Please post the SWD portion of your schematic.

0 Kudos
Reply

55 Views
raddeh
Contributor III

@LittellI'm unable to post direct schematics as per company policy. But multiple people verified the pin connections it works when using a JLink debugger. This points me to it being a configuration error on the LinkServer tool side...

I don't want a flash erase, I just want connection to the stopped uC and then upload code to internal RAM. The external flash is anyways another than on the EVK/EVKB board, so I don't expect a driver for it to be part of the LinkServer. That's the same we do as when we use the JLink: connect to the core and upload to the internal RAM and then start execution.

 

Maybe I need a custom script for the LinkServer tool? But I can't find documentation about it anywhere. @Pavel_Hernandez 

0 Kudos
Reply

296 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, my name is Pavel, and I will be supporting your case, I reviewed the schematic and maybe have a confusion about the SWD interface. The Interface to debug reported on the schematic is the J6. the J2 must be the SWD to communicate to the LPC55s69 not for debug.

Pavel_Hernandez_0-1730857989936.png

Pavel_Hernandez_1-1730858064731.png

Could you confirm using the J6?

Best regards,
Pavel

 

0 Kudos
Reply

284 Views
raddeh
Contributor III

Yes, I'm using the J6 port (2x5 pin connector). I mistyped in the original post

0 Kudos
Reply

258 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, could you let me know what version is the RT1170 EVK or EVKB?

In both cases the J1 could use the SWD with adapter to JTAG 20 pins.

On the board EVKB:
Could use the J87 but need to put a jumper on JP5 to use the SWD 10 pins.

On the board EVK:
The J16 is only for the debugger DFU and the J58 could use to the target MCU.

I recommend do some test on these ports.

Best regards,
Pavel

0 Kudos
Reply

235 Views
raddeh
Contributor III

@Pavel_Hernandez it is no EVK / EVK board, but a custom one.

On the custom board is a RT1176AVM8A and we use T6 (SWD-CLK), U7 (SWD-IO). But like I wrote in the first post: The SWD interface to our board does work with a JLink-Base debugger. The issue is the connection via the NXP MCU-Link. So the SWD ports are OK on the board

0 Kudos
Reply

228 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, what is the IDE that has using? maybe the MCULink is not the issue, maybe need to delete de debug configuration.

Pavel_Hernandez_0-1731016694061.png

If you start a communication with the J-Link and the want to use the MCU-Link and the MCU-Link has LinkServer, will need eliminate the debug configuration, when you start again the debug session the IDE will find all the probes available.

Best regards,
Pavel

 

0 Kudos
Reply

197 Views
raddeh
Contributor III

@Pavel_Hernandez I'm not using any IDE. I'm using plain GDB and the NXP LinkServer application on a terminal. The JLink Debugger is not connected to the PC or the board when I trying the MCU-Link.

  1. MCU-Link probe connected via SWD-IO, SWD-CLK, RST, GND, VREF. Board powered and drawing nominal power.
    • No other debugger connected to board or PC
  2. Connected MCU-Link to Ubuntu20 PC and started LinkServer application

 

LinkServer -l 5 gdbserver   MIMXRT1176xxxxx:MIMXRT1170-EVK-CM7-ONLY

 

  • Refer to original post for the output (first large code block) of the LinkServer on the terminal
  • Connect GDB to the GDB-server of LinkServer

 

arm-none-eabi-gdb bin/rt117x_test_cm7.elf -ex "target remote localhost:3333"

 

  • Now the LinkServer application prints out errors and closes (see second large code block in original post)

The error prints of LinkServer indicate "Wire not connected", but I know that the SWD-IO, SWD-CLK, RST, VREF and GND lines are connected: I measured them with a multimeter and the JLink Debugger is able to connect to the RT1176 core via the same cables and connectors if I attach it instead of the MCU-Link. So I'm not understanding what's happening here - is the MCU-Link trying to use JTAG? Does it need some additional line to the ones listed? Does it need some special jumper setting? Does it need a custom "target" script (but the Link doesn't need a custom script)? If it needs a custom script, where can I find documentation about it?

In general I've been unable to find much documentation about MCU-Link and the LinkServer application. All documentation assumes that one uses the NXP IDE with it and even the User Manual isn't describing the options of LinkServer. The   product page does not list any documents. The Getting Started page is not describing much either. Is there some in-depth documentation that I couldn't find?

0 Kudos
Reply

183 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, I recommend reviewed the boot mode that the board is, and the boot config pins, then if that is good and the error still there, I recommend do a mass erase this error "Wire ACK Fault in DAP access" is command when the MCU could not be halted by the debugger.

RT board recovery for debugger connect issues - NXP Community

Follow the steps with the SPT tool for linux.

Best regards,
Pavel

0 Kudos
Reply