Loading...
 
Skip to main content

System Workbench for STM32


Target connection fails with "Cannot identify target as a stm32x" (although STM32L053 works)

Hi there,

thanks for the tip about the debug window, I'm now able to find the OpenOCD output, but it's the same as when doing it the way over Target=>Program, so still no change.

Interesting fact seems to be, I've used the project-dependend .cfg-file (appended to this reply) which was created by CubeMX I think.
This file seems to be correct, as I'm able to use the 'vanilla', SystemWorkbench-independent OpenOCD (from here) to connect, and this seems to work:

markus@markusPC ..se/openocd/0.10.0-201610281609-dev/bin % ./openocd -f /tmp/stm32f0_blinky.cfg
GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-dev-00498-gbbfb673 (2016-10-28-17:01)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: target/stm32f0x_stlink.cfg is deprecated, please switch to target/stm32f0x.cfg
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v27 API v2 SWIM v6 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.567957
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints

Please note I used the clone ST-Link debugger, and therefore changed the settings from stlink-v2-1 to stlink-v2.

As far as I understand this configuration files, my problem may is caused by one of the included configuration files, either interface/stlink-v2.cfg or target/stm32f0x_stlink.cfg.
I highly doubt there's a problem in the debugger configuration file, as this works with the nucleo board.
stm32f0x_stlink.cfg links in my downloaded version straight to target/stm32f0x.cfg, the SW-version differs a bit:

markus@markusPC ..0.10.0-201610281609-dev/scripts/target % diff stm32f0x_stlink.cfg /home/markus/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.11.2.201612060912/resources/openocd/scripts/target/stm32f0x_stlink.cfg -uNr


stm32f0x_stlink.cfg 2016-10-28 19:04:08.000000000 +0200 +++ /home/markus/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.11.2.201612060912/resources/openocd/scripts/target/stm32f0x_stlink.cfg 2016-11-24 04:48:56.000000000 +0100

@@ -1,2 +1,11 @@
-echo "WARNING: target/stm32f0x_stlink.cfg is deprecated, please switch to target/stm32f0x.cfg"

+if { info exists TRANSPORT } { + if { $TRANSPORT == "hla_jtag"} { + transport select "hla_jtag" + } + + if { $TRANSPORT == "hla_swd"} { + transport select "hla_swd" + } +} +

source find target/stm32f0x.cfg

Also, I compared the stm32f0x.cfg files, these differ even more:

markus@markusPC ..0.10.0-201610281609-dev/scripts/target % diff stm32f0x.cfg /home/markus/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.11.2.201612060912/resources/openocd/scripts/target/stm32f0x.cfg -uNr


stm32f0x.cfg 2016-10-28 19:04:08.000000000 +0200 +++ /home/markus/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.debug_1.11.2.201612060912/resources/openocd/scripts/target/stm32f0x.cfg 2016-11-24 04:48:56.000000000 +0100

@@ -47,7 +47,9 @@

adapter_nsrst_delay 100

-reset_config srst_nogate

+# use hardware reset, connect under reset +# connect_assert_srst needed if low power mode application running (WFI...) +reset_config srst_only srst_nogate connect_assert_srst


if {!using_hla} {
# if srst is not fitted use SYSRESETREQ to
@@ -61,6 +63,10 @@
}

proc stm32f0x_default_examine_end {} {

+ # Enable DBGMCU clock + # RCC_APB2ENR |= DBGMCUEN + mmw 0x40021018 0x00400000 0 +

# Enable debug during low power modes (uses more power)
mmw 0x40015804 0x00000006 0 ;# DBGMCU_CR |= DBG_STANDBY | DBG_STOP

@@ -80,7 +86,14 @@
adapter_khz 8000
}

+$_TARGETNAME configure -event gdb-attach { + # Needed to be able to use the connect_assert_srst in reset_config + # otherwise, can't read device id + reset init +} +

# Default hooks
$_TARGETNAME configure -event examine-end { stm32f0x_default_examine_end }
$_TARGETNAME configure -event reset-start { stm32f0x_default_reset_start }
$_TARGETNAME configure -event reset-init { stm32f0x_default_reset_init }

+


Perhaps, my problem is caused by one of these differences?

About your questions and suggestions:
I uploaded to pastebin the OpenOCD-output with enabled -d switch.
To be honest, I have absolute no clue if this gives more information for finding my problem?

About my original (Nucleo-) ST-Link Debugger:
Yes, the boards are physically disconnected from each other, as my first intention was to include the debugger into the prototype I'm planing to build.
But as the target voltage readout seems to work using the Cloned ST-Link debugger from my colleague, I started to use that one at the moment now.
VDDA is connected straight to VDD, typo indeed.
When using the L0-board, I connect an external power supply to the E5V/GND connector on CN7 (and of course, set the jumper to E5V supply).

I rechecked the setting in the debug profile, indeed the correct file, stm32f0_blinky.cfg, is there selected and the option 'Use local script' is activated.

So in summary, basically one of the differences in either stm32f0x_stlink.cfg or stm32f0x.cfg should be responsible for my problem, or what do you think?

Thank you very much for your time and patience 😊

 
Collapse/expand modules below