2024-05-11 12:38 AM
Version: v2.16.0
I`ve downloaded and installed the latest application and was told that the CubeProgrammer could support J-Link now.
the GUI shows that JLink device can be selected:
I clicked the connect bottom, the chip select window of JLink was popped out:
after correct chip was selected, the error window showed below:
the error logs like this:
15:30:23 : UR connection mode is defined with the HWrst reset mode
15:30:23 : 20730746
15:30:23 : Error: J-Link - Connection to target failed
15:30:23 : Error: J-Link - Reading CPUID failed
15:30:23 : Voltage : 3.30V
15:31:20 : Error: Database cannot be found. DatabasePath = D:\ProgramFiles\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/../Data_Base/STM32_Prog_DB_0xFFF.xml
15:31:20 : Error: flash loader cannot be loaded. FlashLoaderPath = D:\ProgramFiles\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/FlashLoader/0xFFF.stldr
15:31:20 : Error: Database cannot be found. DatabasePath = D:\ProgramFiles\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/../Data_Base/STM32_Prog_DB_0xFFF.xml
I wander if the app support jlink probe, if not, why I can select it?
Solved! Go to Solution.
2024-05-11 01:50 AM - edited 2024-05-11 01:52 AM
I just tried on my Laptop here, no problem :
Its on Win 10 pro, 22H2 .
ed
Just i remember : my J-link refused to connect to new H7 series, needs some update to connect to this.
So try connect with an "old" cpu, like the F103 i tested here, to check: problem with J-link version or other.
2024-05-11 01:50 AM - edited 2024-05-11 01:52 AM
I just tried on my Laptop here, no problem :
Its on Win 10 pro, 22H2 .
ed
Just i remember : my J-link refused to connect to new H7 series, needs some update to connect to this.
So try connect with an "old" cpu, like the F103 i tested here, to check: problem with J-link version or other.
2024-05-11 01:55 AM
So can the J-Link connect using Segger's utilities?
2024-05-14 04:41 AM
Hello,
I'm having the same problem:
13:24:21 : STM32CubeProgrammer API v2.16.0 | Windows-64Bits
13:26:41 : UR connection mode is defined with the HWrst reset mode
13:26:41 : 52006738
13:26:41 : Error: J-Link - Connection to target failed
13:26:41 : Error: Unable to get Access port number
13:26:41 : Voltage : 3.30V
13:27:04 : Error: Database cannot be found. DatabasePath = C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/../Data_Base/STM32_Prog_DB_0xFFF.xml
13:27:04 : Error: flash loader cannot be loaded. FlashLoaderPath = C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/FlashLoader/0xFFF.stldr
13:27:04 : Error: Database cannot be found. DatabasePath = C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/../Data_Base/STM32_Prog_DB_0xFFF.xml
I found out that the correct database for the STM32 that I'm using (STM32L052K8) should be 0x417, not 0xFFF. Why does it want to choose 0xFFF?
You'll find the configuration I use below:
2024-05-14 05:05 AM
@Meganita wrote:I'm having the same problem:
So again the same question:
Can the J-Link connect using Segger's utilities?
If not, Segger have some help on 'Cannot connect to Target' problems:
https://wiki.segger.com/J-Link_cannot_connect_to_the_CPU
See also this ST knowledgebase article on the subject:
https://community.st.com/t5/stm32-mcus/how-to-solve-debugger-connection-issues/ta-p/49693
2024-05-14 07:55 AM
As you can see below, the connection between the PC and the J-Link is ok, but not the connection to the target.
SEGGER J-Link Commander V7.96e (Compiled Apr 17 2024 16:26:32)
DLL version V7.96e, compiled Apr 17 2024 16:25:43
Connecting to J-Link via USB...O.K.
Firmware: J-Link V12 compiled Apr 15 2024 17:37:25
Hardware version: V12.00
J-Link uptime (since boot): 0d 00h 00m 03s
S/N: 52006738
License(s): GDB
USB speed mode: High speed (480 MBit/s)
VTref=3.300V (fixed)
Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: STM32L052K8 (ALLOW OPT. BYTES)
Type '?' for selection dialog
Device>
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>S
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>
Device "STM32L052K8 (ALLOW OPT. BYTES)" selected.
Connecting to target via SWD
InitTarget() start
SWD selected. Executing JTAG -> SWD switching sequence.
Error: Failed to initialized DAP.
Can not attach to CPU. Trying connect under reset.
SWD selected. Executing JTAG -> SWD switching sequence.
Error: Failed to initialized DAP.
Connecting to CPU via connect under reset failed.
InitTarget() end - Took 308ms
Connect failed. Resetting via Reset pin and trying again.
InitTarget() start
SWD selected. Executing JTAG -> SWD switching sequence.
Error: Failed to initialized DAP.
Can not attach to CPU. Trying connect under reset.
SWD selected. Executing JTAG -> SWD switching sequence.
Error: Failed to initialized DAP.
Connecting to CPU via connect under reset failed.
InitTarget() end - Took 308ms
Error occurred: Could not connect to the target device.
For troubleshooting steps visit: https://wiki.segger.com/J-Link_Troubleshooting
J-Link>
I suppose that "DAP" is "Database Path".
As per the first link you provided, I have checked VTREF. It is 3.3 V.
I have also reduced the speed down to 100 kHz, but I still have the same error.
As per the second link you provided, SWDIO and SWCLK are "used by the debug".
2024-05-14 08:11 AM - edited 2024-05-14 08:56 AM
@Meganita wrote:I suppose that "DAP" is "Database Path".
No.
The DAP is the Debug Access Port - the part of the CPU which actually connects to the debug probe:
https://developer.arm.com/documentation/102585/0100/What-is-a-Debug-Access-Port-
So your J-Link is fundamentally failing to connect to the target - it's not related to the CubeProgrammer.
Does your code disable or repurpose the debug lines (SWDIO, SWCLK), and/or put the CPU to sleep?
EDIT:
Example showing the Debug Access Point (Debug AP) - DAP:
EDIT 2:
Did you note @AScha.3 comment at the end of this post:
Does your J-Link connect to any other STM32 targets?
Also, do you have an ST-Link to try? Or a different J-Link?
2024-05-14 08:29 AM
@UniverGao - did you resolve your issue?
2024-05-14 08:58 AM - edited 2024-05-14 08:58 AM
What chip specifically are you using?
Show wiring for complete debug harness.
What model of Segger J-Link?
USB 2.0 high speed rated cable? Direct connection, not via hub or docking station?
Is this demonstrably working on a known working board / debug harness?
2024-05-15 12:16 AM
No, SWDIO and SWCLK aren't repurposed or disabled. The CPU is not put to sleep.
We don't have any other product with an STM32, so I cannot try to connect to another STM32.
And I don't have an ST-Link nor another J-Link...
I'm using STM32L052K8, with J-Link Base. USB 2.0 through direct connection (no hub, no docking station).
I have VTREF connected on pin 1, VSS connected on pin 4, SWDIO on pin 7, SWCLK on pin 9 and RESET on pin 15.
I don't have another board to try it on.