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?