ST-Link Target unknown error 19

Discuss how to use the features of Atollic TrueSTUDIO, including the editor, assembler, C/C++ compiler, linker, debugger, static code analysis and team collaboration tools.

Moderators: Markus Girdland, Mattias Norlander

Posts: 3
Joined: Wed Jul 11, 2018 11:01 pm

ST-Link Target unknown error 19

Postby jprinster » Wed Jul 17, 2019 3:53 pm

I use Atollic TS 9.2.0 and an ST-LINK/V2 with two custom boards that have different processors. In both cases I have a bootloader and the main application is loaded higher in flash. For the board with the STM32F051 I can debug with no problems when the code is at the higher location. For the board with the STM32F373 I get an "ST-Link Target unknown error 19" whenever I try to start debugging. However, if I run the ST-LINK Utility program and connect to the target it finds the processor and I can see the memory locations, so I know my cable and the ST-Link is working. Why does the ST-LINK Utility work and TrueStudio doesn't? Why does it work with the STM32F051 and not with the STM32F373?

My ST-LINK/V2 has firmware V2J33S7, which is the most recent available.

I appreciate any assistance.


The console output:
STMicroelectronics ST-LINK GDB server. Version 5.1.0
Copyright (c) 2018, STMicroelectronics. All rights reserved.

Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled

Target unknown error 19

Error in initializing ST-LINK device.
Reason: Unknown. Please check power and cabling to target.

The Target Software Startup Script for the STM32F373:

# Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers
# Uncomment next line, 2=32 bit, 1=16 bit and 0=8 bit parallelism mode
#monitor flash set_parallelism_mode 2

# Set character encoding
set host-charset CP1252
set target-charset CP1252

# Reset to known state
monitor reset

# Load the program executable

# Reset the chip to get to a known state. Remove "monitor reset" command
# if the code is not located at default address and does not run by reset.
# NOTE I've tried this included and commented out and it doesn't work either way.
monitor reset

# Set program counter and stack pointer.
# Set these to the new location in the flash where the code will be.
# The code is at 0x8004000.
set $pc = *(unsigned int*) 0x4004
set $sp = *(unsigned int*) 0x4000

# Enable Debug connection in low power modes (DBGMCU->CR)
set *0xE0042004 = (*0xE0042004) | 0x7

# Set a breakpoint at main().
tbreak main

# Run to the breakpoint.

Posts: 1
Joined: Tue Apr 21, 2020 10:14 am

Re: ST-Link Target unknown error 19

Postby kkmspb » Tue Apr 21, 2020 12:55 pm

I am beginner but I have a some like situation :

This script instructions don't work :
set $pc = *(unsigned int*) 0x4004
set $sp = *(unsigned int*) 0x4000

I am sure that at 0x8000000 address forever must be minumum two fields of interrupt vector table. Without this any does not work.

Return to “Atollic TrueSTUDIO tool discussions”

Who is online

Users browsing this forum: No registered users and 3 guests