Hi
I’m trying to setup a project for a little dev board
http://www.ebay.de/itm/Arduino-IDE-kompatibles-Board-STM32-STM32f103C8T6-ST-ARM-32-bit-Cortex-M3-039-/221812183158?hash=item33a5095076:g:tI4AAOSwHnFVj5Aq
Using this Adapter
http://www.ebay.de/itm/ST-LINK-V2-ST-LINK-STM8-STM32-kompatibler-Emulator-USB-Programmer-Debugger-/171689684649?hash=item27f980aea9:g:iTsAAOSwMmBVpNes
I can upload sketches in the Arduino_STM32 environment with this thing.
I have installed “System Workbench for STM32” and its tools in eclipse now and have used a stand alone CubeMX for creating a project.
The project includes freeRTOS and builds without errors.
When I try to debug or just click on “run” Openocd throws errors (1)(2)
When I use Target -> Program Chip in the Project Explorers context menu nothing at all happens.
The config file for Openocd currently is:
# This is an STM32F103C8T6-mini board with a single STM32F103C8Tx chip. # Generated by System Workbench for STM32 source [find interface/stlink-v2.cfg] set WORKAREASIZE 0x5000 transport select "hla_swd" #source [find target/stm32f1x_stlink.cfg] # deprecated ? source [find target/stm32f1x.cfg] # use hardware reset, connect under reset #reset_config srst_only srst_nogate reset_config srst_nogate
When initial created by “System Workbench for STM32” using the instructions
from here http://www.openstm32.org/Importing+a+STCubeMX+generated+project it looked a bit diffent.
After my modifications it runs at least on the command line (3)
1. console (openocd) output when “debug” was started
Open On-Chip Debugger 0.9.0-dev-dirty (2015-11-13-11:40) 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 v17 API v2 SWIM v4 VID 0x0483 PID 0x3748 Info : using stlink api v2 Info : Target voltage: 3.240795 Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints Info : accepting 'gdb' connection on tcp/3333 Error: timed out while waiting for target halted TARGET: stm32f1x.cpu - Not halted in procedure 'reset' in procedure 'ocd_bouncer' Info : device id = 0x20036410 Warn : STM32 flash size failed, probe inaccurate - assuming 128k flash Info : flash size = 128kbytes Error: timed out while waiting for target halted TARGET: stm32f1x.cpu - Not halted in procedure 'reset' in procedure 'ocd_bouncer' Error: timed out while waiting for target halted TARGET: stm32f1x.cpu - Not halted in procedure 'reset' in procedure 'ocd_bouncer' Error: Target not halted Error: failed erasing sectors 0 to 6 Error: flash_erase returned -304
2. console output after “run” was started
Open On-Chip Debugger 0.9.0-dev-dirty (2015-11-13-11:40) 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 v17 API v2 SWIM v4 VID 0x0483 PID 0x3748 Info : using stlink api v2 Info : Target voltage: 3.237616 Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints Error: timed out while waiting for target halted TARGET: stm32f1x.cpu - Not halted in procedure 'program' in procedure 'reset' called at file "embedded:startup.tcl", line 478 in procedure 'ocd_bouncer' ** Unable to reset target ** shutdown command invoked
3. command line and then telnet connecting port 4444 on another terminal giving “reset halt”
db@zweistein:/opt/gnuarmeclipse/openocd/0.9.0-201505190955/scripts> /home/db/.p2/pool/plugins/fr.ac6.mcu.externaltools.openocd.linux64_1.7.0.201602121841/tools/openocd/bin/openocd -f /home/db/STM32-projekte/STM32F103C8T6-first/SW4STM32/STM32F103C8T6-first/STM32F103C8T6-mini2.cfg Open On-Chip Debugger 0.9.0-dev-dirty (2015-11-13-11:40) 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 none separate none separate 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 v17 API v2 SWIM v4 VID 0x0483 PID 0x3748 Info : using stlink api v2 Info : Target voltage: 3.239762 Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints Info : accepting 'telnet' connection on tcp/4444 target state: halted target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08000144 msp: 0x20000400
But the last has the “scripts” directory of an installation of Openocd outside the eclipse plugin stuff as current directory.
When trying the same while inside the scripts directory of the eclipes SWFSTM32’s plugin installation of Openocd and then telneting 4444 it gives the same error when saying “reset halt”
db@zweistein:~/.p2/pool/plugins/fr.ac6.mcu.debug_1.7.0.201602121829/resources/openocd/scripts> /home/db/.p2/pool/plugins/fr.ac6.mcu.externaltools.openocd.linux64_1.7.0.201602121841/tools/openocd/bin/openocd -f /home/db/STM32-projekte/STM32F103C8T6-first/SW4STM32/STM32F103C8T6-first/STM32F103C8T6-mini2.cfg Open On-Chip Debugger 0.9.0-dev-dirty (2015-11-13-11:40) 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 v17 API v2 SWIM v4 VID 0x0483 PID 0x3748 Info : using stlink api v2 Info : Target voltage: 3.240795 Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints Info : accepting 'telnet' connection on tcp/4444 Error: timed out while waiting for target halted TARGET: stm32f1x.cpu - Not halted in procedure 'reset' in procedure 'ocd_bouncer' Error: jtag status contains invalid mode value - communication failure Polling target stm32f1x.cpu failed, GDB will be halted. Polling again in 100ms ...
How should I proceed debugging this thing.
I even can not find “embedded:startup.tcl on my disk.
The installation of “System Workbench for STM32” inside Eclipse
following the instructions from here
http://www.openstm32.org/Installing+System+Workbench+for+STM32+from+Eclipse?structure=Documentation
was without any error messages.
Kind regards
Dieter
Viewing 7 posts — 1 through 7 (of 7 total)
-
Author
Posts
-
October 19, 2017 at 20:41
#12719
I’m trying to get a new board to compile and debug that is using the STM32F746VGT6 chip. I am using an STLINK V2.1 to program the chip. I can get STLink Utility to see, flash and verify the flashing just fine and Visual Studio isn’t throwing any errors when compiling. But when I go to debug the chip within the visual studio, I get the following error: “timed out while waiting for target halted”
Here is my output log from testing the stlink V2.1:
Open On-Chip Debugger 0.10.0 (2017-08-21) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport “hla_swd”. To override use ‘transport select <transport>’.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v25 API v2 SWIM v14 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.214145
Warn : Silicon bug: single stepping will enter pending exception handler!
Info : stm32f7x.cpu: hardware has 8 breakpoints, 4 watchpoints
Error: timed out while waiting for target halted
TARGET: stm32f7x.cpu – Not halted
in procedure ‘reset’
in procedure ‘ocd_bouncer’Here is the log from a successful connection with the stlink utility:
15:38:13 : ST-LINK SN : 0676FF515457725187243559
15:38:13 : ST-LINK Firmware version : V2J25M14
15:38:13 : Connected via SWD.
15:38:13 : SWD Frequency = 4,0 MHz.
15:38:13 : Connection mode : Connect Under Reset.
15:38:13 : Debug in Low Power mode enabled.
15:38:13 : Device ID:0x449
15:38:13 : Device flash Size : 1MBytes
15:38:13 : Device family :STM32F74x/F75xI have good communication through the STLink V2.1 through the STLink Utility but not through OpenOCD through Visual Studio/VisualGDB. I have used the same SWD pinout as many other STM32 boards using F4, F1, L1, L4 chips but this is the first time I’ve used an F7. I have tried on several boards with the same result. Can you help me please?
Thank you,
Jeremy-
This topic was modified 5 years, 3 months ago by
jeremyvnc.
October 20, 2017 at 01:24
#12723
Hi,
This could happen if your firmware was interfering with the SWD pins or power states, hence preventing the debugger from attaching. Please try setting the “connect under reset” flag in VisualGDB Project Properties -> Debug Settings.
October 20, 2017 at 15:18
#12729
Thank you for your response. There is no hardware connected to the JTAG/SWD pins except the programming connector and I’m just trying to load the LEDBlink example so no software conflicts.
I tried looking for the “connect under reset” under debug properties and I don’t see it. I am using 5.3 Preview 7 (build 1744). Also, I do want to note that the checkboxes under reset device “before” and “after” do not save when you hit apply. “Before” is always set and I cannot set “After” they revert after you click apply from whatever setting you point them to.
Update: Just updated to the latest build (1864) and the same issues as above.
October 21, 2017 at 03:33
#12733
Hi,
Please try updating your VisualGDB to v5.3R3 (latest maintenance release) and also update your OpenOCD package via Tools->VisualGDB->Manage VisualGDB Packages.
If you still don’t see the options, please try attaching a screenshot of your Debug Settings page so that we could see which version you are using and suggest a way to update it.
October 24, 2017 at 17:10
#12751
I have upgraded to the latest VisualGDB 5.3R3 and the latest OpenOCD. I still cannot get it to connect to my F7 board under debug. I also do not see an option to connect under reset under Debug Settings.
I have attached screenshots.
Attachments:
You must be logged in to view attached files.
October 24, 2017 at 19:58
#12756
Okay, I got the main issue solved. I needed to connect the reset line to NRST instead of the jtag JTNRST line. Now it works in both STLink and visual studio without error. Odd too because on the F4’s, I use the jtag reset line and it works everytime.
So, as for the other issues I mentioned. They still exist. There is no “connect under reset” checkbox or setting and when I change the reset behavior “Before” or “After” programming then hit accept, the changes always revert back to only “Before” checked. Not a big deal but thought you should know of the bug.
Thanks,
JeremyOctober 26, 2017 at 00:00
#12763
Hi,
Thanks, looks like the ‘connect under reset’ indeed doesn’t work on STM32F7. We have fixed this in the upcoming update to the OpenOCD package.
As a workaround, please try changing the following line in stm32f7x.cfg:
reset_config srst_only srst_nogate
replace it with the version from F4X:
Then VisualGDB will recognize it and show the “connect under reset” option.
-
This topic was modified 5 years, 3 months ago by
-
Author
Posts
Viewing 7 posts — 1 through 7 (of 7 total)
You must be logged in to reply to this topic.
Не смог стереть. У вас openOCD запущен отдельным процессом? Что он пишет в это время?
Запускаю из eclipse там же и выскакивает эта ошибка.
Started by GNU ARM Eclipse 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 v25 API v2 SWIM v4 VID 0x0483 PID 0x3748 Info : using stlink api v2 Info : Target voltage: 3.217221 Info : stm32w108.cpu: hardware has 6 breakpoints, 4 watchpoints Info : accepting 'gdb' connection on tcp/3333 Info : flash size = 64kbytes undefined debug reason 7 - target needs reset stm32w108.cpu: target state: halted target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08004160 msp: 0x20001ff8 semihosting is enabled Error: timed out while waiting for target halted TARGET: stm32w108.cpu - Not halted in procedure 'reset' in procedure 'ocd_bouncer' Error: Target not halted Error: failed erasing sectors 0 to 35 Error: flash_erase returned -304 Info : dropped 'gdb' connectionn
954,074 8^done 954,074 (gdb) 954,074 9-gdb-set breakpoint pending on 954,076 9^done 954,076 (gdb) 954,076 10-enable-pretty-printing 954,076 10^done 954,076 (gdb) 954,076 11-gdb-set python print-stack none 954,077 11^done 954,077 (gdb) 954,077 12-gdb-set print object on 954,080 12^done 954,080 (gdb) 954,080 13-gdb-set print sevenbit-strings on 954,092 13^done 954,092 (gdb) 954,093 14-gdb-set charset ISO-8859-1 954,102 14^done 954,102 (gdb) 954,103 15source .gdbinit 954,114 &"source .gdbinitn" 954,114 &".gdbinit: No such file or directory.n" 954,114 15^error,msg=".gdbinit: No such file or directory." 954,114 (gdb) 954,115 16set mem inaccessible-by-default off 954,125 &"set mem inaccessible-by-default offn" 954,125 =cmd-param-changed,param="mem inaccessible-by-default",value="off" 954,125 16^done 954,125 (gdb) 954,126 17-gdb-set auto-solib-add on 954,126 17^done 954,126 (gdb) 954,127 18-target-select remote localhost:3333 954,696 =thread-group-started,id="i1",pid="42000" 954,696 =thread-created,id="1",group-id="i1" 954,698 19-list-thread-groups --available 954,702 20-list-thread-groups 954,717 ~"0x00000000 in ?? ()n" 954,717 *stopped,frame={addr="0x00000000",func="??",args=[]},thread-id="1",stopped-threads="all" 954,718 18^connected 954,718 (gdb) 954,718 19^error,msg="Can not fetch data now." 954,718 (gdb) 954,719 20^done,groups=[{id="i1",type="process",pid="42000"}] 954,719 (gdb) 954,750 21monitor reset init 954,750 22monitor halt 954,750 23monitor arm semihosting enable 954,750 24symbol-file C:\Users\use\Desktop\work\Debug\test.elf 954,750 25load C:\Users\use\Desktop\work\Debug\test.elf 954,756 &"monitor reset initn" 955,005 @"stm32w108.cpu: target state: haltedn" 955,006 @"target halted due to debug-request, current mode: Thread n" 955,006 @"xPSR: 0x01000000 pc: 0x08004160 msp: 0x20001ff8n" 955,006 26-list-thread-groups i1 955,017 21^done 955,017 (gdb) 955,017 &"monitor haltn" 955,035 22^done 955,035 (gdb) 955,035 &"monitor arm semihosting enablen" 955,049 @"semihosting is enabledn" 955,052 23^done 955,053 (gdb) 955,053 &"symbol-file C:\\Users\\use\\Desktop\\work\\Debug\\test.elfn" 955,053 ~"Reading symbols from C:\Users\use\Desktop\work\Debug\test.elf..." 955,059 ~"done.n" 955,078 24^done 955,078 (gdb) 955,079 &"load C:\\Users\\use\\Desktop\\work\\Debug\\test.elfn" 956,117 &"Error erasing flash with vFlashErase packetn" 956,118 25^error,msg="Error erasing flash with vFlashErase packet" 956,118 (gdb) 956,119 27-gdb-exit 956,121 26^done,threads=[{id="1",target-id="Remote target",frame={level="0",addr="0x00000000",func=" ??",args=[]},state="stopped"}] 956,121 (gdb) 956,121 27^exit 956,121 =thread-group-exited,id="i1"