Target connection fails with "Cannot identify target as a stm32x" (although STM32L053 works)
Hello guys!
After beeing quite a while in the embedded software development in my job, I started private to playing around with STM32 uCs.
I’ve been successful to get the ST-LINK V2-1 Debugger here along with the (not anymore directly connected) STM32L053 uC working (it is one the Nucleo dev kits).
However, flasing and debugging this board with the seperate debugger works on windows and linux here flawless.
The problem starts after I want to flash/debug a custom board I’ve created here with a STM32F030C6T6.
Flashing and debugging of this board works with Keil MDM and the ST-Link Utility (of course the last one just for flashing).
But if I try to flash or debug the board using system workbench, it fails with the following console output:
13:05:25 **** Programing project stm32f0_blinky on chip ****
“C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.externaltools.openocd.win32_1.8.0.201603291052\tools\openocd\bin\openocd.exe” -f stm32f0_blinky_board.cfg -s “C:\Users\Markus\Documents\stm32_projects\stm32F0_test\stm32f0_blinky\SW4STM32\stm32f0_blinky” -s “C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.8.0.201603291114\resources\openocd\scripts” -c “program Debug/stm32f0_blinky.elf verify exit”
Open On-Chip Debugger 0.10.0-dev-00267-g884c33c (2016-03-16-12:22)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
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
srst_only separate srst_nogate srst_open_drain connect_assert_srst
srst_only separate srst_nogate srst_open_drain connect_assert_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 v15 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 0.009480
Error: target voltage may be too low for reliable debugging
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
adapter speed: 950 kHz
stm32f0x.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xc1000000 pc: 0xfffffffe msp: 0xfffffffc
in procedure ‘program’
in procedure ‘reset’ called at file “embedded:startup.tcl”, line 478
in procedure ‘ocd_bouncer’
in procedure ‘ocd_process_reset’
in procedure ‘ocd_process_reset_inner’ called at file “embedded:startup.tcl”, line 248
in procedure ‘stm32f0x.cpu’ called at file “embedded:startup.tcl”, line 370
in procedure ‘ocd_bouncer’
- Programming Started **
auto erase enabled
Error: Cannot identify target as a stm32x
Error: auto_probe failed
- Programming Failed **
shutdown command invoked
13:05:25 Build Finished (took 346ms)
A note may be, that the erasing works (confirmed using ST-Link Utility) with the console output:
13:03:26 **** Erasing chip ****
“C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.externaltools.openocd.win32_1.8.0.201603291052\tools\openocd\bin\openocd.exe” -f stm32f0_blinky_board.cfg -s “C:\Users\Markus\Documents\stm32_projects\stm32F0_test\stm32f0_blinky\SW4STM32\stm32f0_blinky” -s “C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.8.0.201603291114\resources\openocd\scripts” -c init -c “reset halt” -c “flash erase_sector 0 0 last” -c exit
Open On-Chip Debugger 0.10.0-dev-00267-g884c33c (2016-03-16-12:22)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
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
srst_only separate srst_nogate srst_open_drain connect_assert_srst
srst_only separate srst_nogate srst_open_drain connect_assert_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 v15 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 0.009480
Error: target voltage may be too low for reliable debugging
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
adapter speed: 950 kHz
stm32f0x.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xc1000000 pc: 0x080000c4 msp: 0x20000408
Info : device id = 0x10006444
Info : flash size = 32kbytes
erased sectors 0 through 31 on flash bank 0 in 0.030020s
13:03:27 Build Finished (took 1s.905ms)
The flashing/debugging issue is in my opinion clearly connected to the OpenOCD backend of system workbench, which denies to flash/debug as -my guess- the target CPUID isn’t recognized and therefore the error message ‘Cannot identify target as a stm32x’ appears.
As I’m pretty sure I got here an genuine STM32F0 CPU, may something has changed in the IDs?
However, does anybody know how to fix this?
I’d really love to program my STM32F0 using my main-OS Linux and love Eclipse for developing.
Thanks and I’m looking forward for your answers!
Best regards
Markus
P.s. Sorry for the direct console output in the text, but I wasn’t unable to find code-tags or similar? :/