AnsweredAssumed Answered

STM32L053 - Cannot identify target

Question asked by paroulek.lukas on Mar 19, 2015
Latest reply on Mar 26, 2015 by paroulek.lukas
Hi I´ve problem with programming stm32l053, after debug get error "Cannot identify target as a STM32L family". I´m using Eclipse Indigo under Linux, st-link/v2 debugger, OpenOCD, arm-none-eabi-gdb. My reports

Open On-Chip Debugger 0.8.0 (2014-11-06-14:05)
Licensed under GNU GPL v2
For bug reports, read
Info : This adapter doesn't support configurable speed
Info : STLINK v2 JTAG v21 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.203137
Info : stm32lx.cpu: hardware has 4 breakpoints, 2 watchpoints
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0x080045b8 msp: 0x20002800
STM32L: Enabling HSI
Info : accepting 'gdb' connection from 3333
Warn : Cannot identify target as a STM32L family.
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected

symbol-file WorkSpace/projectxx/Debug/projectxx.elf
monitor reset halt
"monitor" command not supported by this target.
load WorkSpace/projectxx/Debug/projectxx.elf
You can't do that when your target is `None'

My config files:

# This is an STM32L discovery board
source [find interface/stlink-v2.cfg]

source [find target/stm32l0x_stlink.cfg]

# use hardware reset, connect under reset
reset_config srst_only srst_nogate

if { [info exists CHIPNAME] == 0 } {
   set CHIPNAME stm32lx

if { [info exists CPUTAPID] == 0 } {
   # STM32L0x
   set CPUTAPID 0x0bc11477

if { [info exists WORKAREASIZE] == 0 } {
   set WORKAREASIZE 0x2000

source [find target/stm32l_stlink.cfg]

flash bank $_FLASHNAME stm32lx 0 0 0 0 $_TARGETNAME
proc stm32l_enable_HSI {} {
    # Enable HSI as clock source
    echo "STM32L: Enabling HSI"

    # Set HSION in RCC_CR
    mww 0x40023800 0x00000101

    # Set HSI as SYSCLK
    mww 0x40023808 0x00000001

$_TARGETNAME configure -event reset-init {

if { [info exists CHIPNAME] } {
} else {
   set _CHIPNAME stm32lx

# Work-area is a space in RAM used for flash programming
# By default use 4kB (as found on some STM32F100s)
if { [info exists WORKAREASIZE] } {
} else {
   set _WORKAREASIZE 0x4000

if { [info exists CPUTAPID] } {
} else {
   # this is the SW-DP tap id not the jtag tap id
   set _CPUTAPID 0x0bc11477

if { [info exists TRANSPORT] } {
   if { $TRANSPORT == "hla_jtag" } {
      if { [info exists CPUTAPID] == 0 } {
         # jtag requires us to use the jtag tap id
         set _CPUTAPID 0x0bc11477
} else {
   set _TRANSPORT hla_swd

# add deprecated transport name check
if { $_TRANSPORT == "stlink_swd" } {
    set _TRANSPORT "hla_swd"
    echo "DEPRECATED! use 'hla_swd' transport not 'stlink_swd'"

if { $_TRANSPORT == "stlink_jtag" } {
    set _TRANSPORT "hla_jtag"
    echo "DEPRECATED! use 'hla_jtag' transport not 'stlink_jtag'"
# end deprecated checks

# possibles value are hla_swd or hla_jtag
transport select $_TRANSPORT

hla newtap $_CHIPNAME cpu -expected-id $_CPUTAPID

target create $_TARGETNAME hla_target -chain-position $_TARGETNAME

$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0