I can successfully connect to both A7 cores of my STM32MP157 board with either of these commands:
JLinkGDBServer -device STM32MP15xx_A7_0_DualFlash
JLinkGDBServer -device STM32MP15xx_A7_1_DualFlash
However, I cannot connect to the M4 core of the processor. If I attempt to default to the JTAG interface, it just says "ERROR: Could not connect to target" — if I connect via SWD, it shows more promise:
$ JLinkGDBServer -device STM32MP15xx_M4_DualFlash -if swd
SEGGER J-Link GDB Server V6.80d Command Line Version
JLinkARM.dll V6.80d (DLL compiled Jun 26 2020 17:19:40)
Command line: -device STM32MP15xx_M4_DualFlash -if swd
-----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: yes
Generate logfile: off
Verify download: off
Init regs on start: off
Silent mode: off
Single run mode: off
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: STM32MP15xx_M4_DualFlash
Target interface: SWD
Target interface speed: 4000kHz
Target endian: little
Connecting to J-Link...
J-Link is connected.
Firmware: J-Trace PRO V2 Cortex compiled Jun 9 2020 13:39:29
Hardware: V2.00
S/N: 932000281
Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
Checking target voltage...
Target voltage: 3.31 V
Listening on TCP/IP port 2331
Connecting to target...
WARNING: Identified core does not match configuration. (Found: Cortex-M0, Configured: Cortex-M4)
WARNING: CPU could not be halted
Halting target device failed. Trying again with reset
WARNING: CPU could not be halted
WARNING: CPU could not be halted
WARNING: CPU could not be halted
ERROR: Failed to halt CPU.
WARNING: CPU could not be halted
Failed to halt target device on connect
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.
Display More
I also tried upgrading to the latest version of J-Link software (6.86d), but that also didn't fix things (and ended up presenting a different error):
Connecting to target...
Halting target device failed. Trying again with reset
ERROR: Failed to halt CPU.
Failed to halt target device on connect
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.
Any ideas what's going on? I was wondering if there was some sort of clock gating / power gating thing I had to enable on the Linux side of things to get the processor to work, but I didn't see anything from ST about this.