cancel
Showing results for 
Search instead for 
Did you mean: 

How to use JLink with STM32CubeIDE v1.3.0

SChen.11
Associate III

Hi, I saw the release document of STM32CubeIDE v1.3.0 that says supported use the JLink debugger. So I try to use JLink with STM32CubeIDE v1.3.0 on my pc (the os is Debian 9 ). But I saw the console has some error. It's shows cann't detect the MPU core. Below is the debug message

SEGGER J-Link GDB Server V6.62 Command Line Version
 
JLinkARM.dll V6.62 (DLL compiled Jan 24 2020 16:34:42)
 
Command line: -port 2331 -s -device STM32MP157CACx -endian little -speed 4000 -vd
-----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:               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:         USB
J-Link script:                 none
J-Link settings file:          none
------Target related settings------
Target device:                 STM32MP157CACx
Target interface:              JTAG
Target interface speed:        4000kHz
Target endian:                 little
 
Connecting to J-Link...
J-Link is connected.
Failed to set device (STM32MP157CACx). Unknown device selected?ERROR : Failed to set device.
 
Firmware: J-Link V9 compiled Dec 13 2019 11:14:50
Hardware: V9.60
S/N: 55623165
Feature(s): GDB, RDI, FlashBP, FlashDL, JFlash, RDDI
Checking target voltage...
Target voltage: 3.39 V
Listening on TCP/IP port 2331
Connecting to target...
ERROR: No CPU core or target device has been selected. Please make sure at least the core J-Link shall connect to, is selected.
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.

1 ACCEPTED SOLUTION

Accepted Solutions
mattias norlander
ST Employee

Hi,

SEGGER probes are provided as experimental support. We did not want to block usage, but also had no time to properly test this probe with MPU.

Looking at SEGGER website it seems as if they use slightly different device name parameters then done in STM32CUbe tools:

https://www.segger.com/downloads/supported-devices.php

We use the device name "STM32MP157CACx". In order for SEGGER to work you need to modify this to whatever fits your use case:

  • STM32MP15xx_M4_DualFlash
  • STM32MP15xx_M4_Bank1
  • STM32MP15xx_M4_Bank2

In CubeIDE you are able to override the default device name, using one of the above. You will find the setting in the the debug configuration GUI for SEGGER, see the field "Device".

Let us know if this solves the issue!

View solution in original post

3 REPLIES 3
mattias norlander
ST Employee

Hi,

SEGGER probes are provided as experimental support. We did not want to block usage, but also had no time to properly test this probe with MPU.

Looking at SEGGER website it seems as if they use slightly different device name parameters then done in STM32CUbe tools:

https://www.segger.com/downloads/supported-devices.php

We use the device name "STM32MP157CACx". In order for SEGGER to work you need to modify this to whatever fits your use case:

  • STM32MP15xx_M4_DualFlash
  • STM32MP15xx_M4_Bank1
  • STM32MP15xx_M4_Bank2

In CubeIDE you are able to override the default device name, using one of the above. You will find the setting in the the debug configuration GUI for SEGGER, see the field "Device".

Let us know if this solves the issue!

Thanks for your quickly response. I try to use JLinkExe command to connect device with JTAG and SWD interface.

Below message is use SWD way.

./JLinkExe -device STM32MP15xx_M4_DualFlash -speed 4000 -if SWD
SEGGER J-Link Commander V6.62d (Compiled Mar  2 2020 09:23:45)
DLL version V6.62d, compiled Mar  2 2020 09:23:31
 
Connecting to J-Link via USB...O.K.
Firmware: J-Link V9 compiled Dec 13 2019 11:14:50
Hardware version: V9.60
S/N: xxxxxxxx
License(s): GDB, RDI, FlashBP, FlashDL, JFlash, RDDI
VTref=3.403V
 
 
Type "connect" to establish a target connection, '?' for help
J-Link>connect
Device "STM32MP15XX_M4_DUALFLASH" selected.
 
 
Connecting to target via SWD
ConfigTargetSettings() start
ConfigTargetSettings() end
InitTarget() start
J-Link script: InitTarget()
InitTarget() end
Found SW-DP with ID 0x6BA02477
Unknown DP version. Assuming DPv0
AP map detection skipped. Manually configured AP map found.
AP[0]: AXI-AP (IDR: Not set)
AP[1]: APB-AP (IDR: Not set)
AP[2]: AHB-AP (IDR: Not set)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Not an AHB-AP
AP[1]: Skipped. Not an AHB-AP
AP[2]: Core found
AP[2]: AHB-AP ROM base: 0x23000000
CPUID register: 0x23000000. Implementer code: 0x23 (???)
Unknown core, assuming Cortex-M0
Found Cortex-M0 r0p0, Little endian.
 
**************************
WARNING: Identified core does not match configuration. (Found: Cortex-M0, Configured: Cortex-M4)
**************************
 
FPUnit: 0 code (BP) slots and 0 literal slots
Detection of Coresight components via ROM table search disabled by user
Cortex-M0 identified.

It seems the JLink recognise the m4 as m0. Did you had success on this way?

And I also try to use JTAG interface, it's failed after connect command in JLink.

@mattias norlander​ I was also facing issue with J-link in CubeIDE. Thank you, your solution helped me to move one step forward.