Pixhawk 4 Jlink debugging gives GDB error

I am trying to set up a Segger Jlink debugger to work with my Pixhawk 4 FMU, and I’ve run into a snag. Whenever I try to start debugging, I get the following log and error message:

SEGGER J-Link GDB Server V7.60a Command Line Version

JLinkARM.dll V7.60a (DLL compiled Dec 16 2021 10:38:57)

Command line: -if swd -device STM32F765II -endian little -speed 4000 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui
-----GDB Server start settings-----
GDBInit file:                  none
GDB Server Listening port:     2331
SWO raw output listening port: 2332
Terminal I/O port:             2333
Accept remote connection:      localhost only
Generate logfile:              off
Verify download:               on
Init regs on start:            on
Silent mode:                   off
Single run mode:               on
Target connection timeout:     0 ms
------J-Link related settings------
J-Link Host interface:         USB
J-Link script:                 none
J-Link settings file:          none
------Target related settings------
Target device:                 STM32F765II
Target interface:              SWD
Target interface speed:        4000kHz
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link EDU Mini V1 compiled Dec  7 2021 08:38:51
Hardware: V1.00
S/N: 801026420
Feature(s): FlashBP, GDB
Checking target voltage...
Target voltage: 3.29 V
Listening on TCP/IP port 2331
Connecting to target...
Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
GDB closed TCP/IP connection (Socket 11)
Restoring target state and closing J-Link connection...
Shutting down...

‘Launching New_configuration’ has encountered a problem.
Error in final launch sequence

Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:2331
Error message from debugger back end:
Truncated register 16 in remote 'g' packet
Failed to execute MI command:
-target-select remote localhost:2331
Error message from debugger back end:
Truncated register 16 in remote 'g' packet
Truncated register 16 in remote 'g' packet

I followed the setup procedure here (MCU Eclipse/J-Link Debugging for PX4 | PX4 User Guide), including the troubleshooting section at the bottom for CPUs that don’t show up in the packs manager. Trying to start the debugger while the pixhawk is not powered generates a “could not connect” error, so I believe the connection is correct and the error comes from the GDB configuration.

Has anyone run into this issue before? I have limited experience with this type of debugging so I am at a loss as to what I should try next.

Found the issue, the gdb client in Debug Configurations → debugger was set to “gdb” instead of “arm-none-eabi-gdb” as is barely visible in step 12 of the guide. Finding this and pointing eclipse to it seems to have fixed the issue.