Hi,
suddenly I started getting the error target not halted in openocd 2020/04/20
Environment:
ESP32-wroom-32D
JTAG Adapter: ESP-prog
Eclipse withe
> Executing C:UsersLuisAppDataLocalProgramsPythonPython37python.exe C:UsersLuisespesp-idftoolsidf_tools.py list * xtensa-esp32-elf: Toolchain for Xtensa (ESP32) based on GCC - esp-2020r1-8.2.0 (recommended, installed) * xtensa-esp32s2-elf: Toolchain for Xtensa (ESP32-S2) based on GCC - esp-2020r1-8.2.0 (recommended, installed) * esp32ulp-elf: Toolchain for ESP32 ULP coprocessor - 2.28.51-esp-20191205 (recommended, installed) * esp32s2ulp-elf: Toolchain for ESP32-S2 ULP coprocessor - 2.28.51-esp-20191205 (recommended, installed) * cmake: CMake build system - 3.16.4 (recommended, installed) * openocd-esp32: OpenOCD for ESP32 - v0.10.0-esp32-20200420 (recommended, installed) * ninja: Ninja build system - 1.10.0 (recommended, installed) * idf-exe: IDF wrapper tool for Windows - 1.0.1 (recommended, installed) * ccache: Ccache (compiler cache) - 3.7 (recommended, installed) * dfu-util: dfu-util (Device Firmware Upgrade Utilities) - 0.9 (recommended, installed)
Operating System: Windows 10 (OS Build 18367.778)
GDB lauch confguration on Eclipse
Problem Description:
I do the following steps:
Import the blink project to Eclipse
Build the program to ESP32 Thing module with Eclipse and USB Connect the ESP-prog
Run OpenOCD
Run xtensa-esp32-elf-gdb
Eclipse build console output
Blink build.txt
Last two lines
Generated C:/Users/Luis/eclipse-workspace/blink2/build/blink.bin
Build complete (0 errors, 0 warnings): C:UsersLuiseclipse-workspaceblink2build
I lanch the blink project in debug mode but Openocd says target not halted
> Executing OpenOCD Debugger GDB... ["v0.10.0-esp32-20200420"] > Open On-Chip Debugger v0.10.0-esp32-20200420 (2020-04-20-16:15) > Licensed under GNU GPL v2 > For bug reports, read > http://openocd.org/doc/doxygen/bugs.html > adapter speed: 20000 kHz > WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release. > Info : Configured 2 cores > Info : Listening on port 6666 for tcl connections > Info : Listening on port 4444 for telnet connections > Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling" > Info : clock speed 20000 kHz > Error: JTAG scan chain interrogation failed: all ones > Error: Check JTAG interface, timings, target power, etc. > Error: Trying to use configured scan chain anyway... > Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01 > Warn : Bypassing JTAG setup events due to errors > Info : Listening on port 3333 for gdb connections > Info : accepting 'gdb' connection on tcp/3333 > Error: No symbols for FreeRTOS > Error: Target not examined yet > Error executing event gdb-attach on target esp32: > > Error: Target not halted > 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
I run it now using openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg -d3
Openocd -d3.txt
After that, I launch Openocd with
openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg -c "gdb_memory_map disable"
Executing OpenOCD Debugger GDB... ["v0.10.0-esp32-20200420"] Open On-Chip Debugger v0.10.0-esp32-20200420 (2020-04-20-16:15) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html adapter speed: 20000 kHz WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release. Info : Configured 2 cores Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling" Info : clock speed 20000 kHz Error: JTAG scan chain interrogation failed: all ones Error: Check JTAG interface, timings, target power, etc. Error: Trying to use configured scan chain anyway... Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01 Warn : Bypassing JTAG setup events due to errors Info : Listening on port 3333 for gdb connections Info : accepting 'gdb' connection on tcp/3333 Error: No symbols for FreeRTOS Error: Target not examined yet Error executing event gdb-attach on target esp32: Error: FreeRTOS_update_threads not TARGET_HALTED! Error: Target not examined yet Error: Could not read FreeRTOS thread count from target Error: Target not examined yet Error: JTAG scan chain interrogation failed: all ones Error: Check JTAG interface, timings, target power, etc. Error: Trying to use configured scan chain anyway... Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01 Warn : Bypassing JTAG setup events due to errors Info : cpu0: Debug controller 0 was reset. Info : cpu0: Core 0 was reset. Error: esp32_soc_reset: Couldn't halt target before SoC reset Error: JTAG scan chain interrogation failed: all ones Error: Check JTAG interface, timings, target power, etc. Error: Trying to use configured scan chain anyway... Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01 Warn : Bypassing JTAG setup events due to errors Error: esp32_soc_reset: Couldn't halt target before SoC reset embedded:startup.tcl:449: Error: ** Unable to reset target ** in procedure 'program_esp' in procedure 'program_error' called at file "C:/Users/Luis/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200420/openocd-esp32/bin/../share/openocd/scripts/target/esp_common.cfg", line 75 at file "embedded:startup.tcl", line 449 Error: Target not examined yet Warn : target esp32 is not halted (add breakpoint) Error: can't add breakpoint: target running
I run openocd with openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg -c "gdb_memory_map disable" -d3
Openocd -d3 2.txt
Now it connects but when I pause Eclipse to try to go step by step I get this error
I have a problem with OpenOCD and GDB. Debugging works fine if I erase at least the first sector of the lpc2148 – I use telnet for that (flash_erase_sector 0 0 0). So if I start a debugging session in Eclipse everything works fine. But if I stop the session and try to restart a new one I get this error.
Code: Select all
Open On-Chip Debugger 0.3.0-in-development (2009-08-19-10:19) svn:2596
$URL: svn://svn.berlios.de/openocd/trunk/src/openocd.c $
For bug reports, read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS
30 kHz
jtag_nsrst_delay: 200
jtag_ntrst_delay: 200
Info : device: 4 "2232C"
Info : deviceID: 67358712
Info : SerialNumber: 32OZPDQCA
Info : Description: Amontec JTAGkey A
Info : clock speed 30 kHz
Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)
Info : JTAG Tap/device matched
target state: halted
target halted in ARM state due to breakpoint, current mode: Supervisor
cpsr: 0x60000093 pc: 0x40000070
30 kHz
Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)
Info : JTAG Tap/device matched
Warn : srst pulls trst - can not reset into halted mode. Issuing halt after reset.
target state: halted
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0xa00000f3 pc: 0x7fffd2c2
requesting target halt and executing a soft reset
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0xa00000d3 pc: 0x00000000
1500 kHz
Info : accepting 'gdb' connection from 0
Warn : acknowledgment received, but no packet pending
background polling: on
TAP: lpc2148.cpu (enabled)
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0xa00000d3 pc: 0x00000000
requesting target halt and executing a soft reset
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0xa00000d3 pc: 0x00000000
30 kHz
Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)
Info : JTAG Tap/device matched
Warn : srst pulls trst - can not reset into halted mode. Issuing halt after reset.
target state: halted
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0xa00000f3 pc: 0x7fffd2c0
requesting target halt and executing a soft reset
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0xa00000d3 pc: 0x00000000
1500 kHz
0xe01fc040: 00000001
flash 'lpc2000' found at 0x00000000
Warn : Verification will fail since checksum in image (0xe1a00000) to be written to flash is different from calculated vector checksum (0xa1b11eac).
Warn : To remove this warning modify build tools on developer PC to inject correct LPC vector checksum.
Info : dropped 'gdb' connection - error -400
Info : accepting 'gdb' connection from 0
Warn : acknowledgment received, but no packet pending
background polling: on
TAP: lpc2148.cpu (enabled)
target state: halted
target halted in ARM state due to debug-request, current mode: System
cpsr: 0x8000001f pc: 0x00000320
requesting target halt and executing a soft reset
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x800000d3 pc: 0x00000000
30 kHz
Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)
Info : JTAG Tap/device matched
Warn : srst pulls trst - can not reset into halted mode. Issuing halt after reset.
target state: halted
target halted in ARM state due to debug-request, current mode: System
cpsr: 0x8000001f pc: 0x00000310
requesting target halt and executing a soft reset
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x800000d3 pc: 0x00000000
1500 kHz
0xe01fc040: 00000001
flash 'lpc2000' found at 0x00000000
Error: timed out while waiting for target halted
Warn : target not halted
Error: Target not halted
Error: error writing to flash at address 0x00000000 at offset 0x00000000 (-304)
Warn : target not halted
Info : can't add breakpoint while target is running (BPID: 13)
Warn : target not halted
Warn : target not halted
Eclipse Dialog:
Code: Select all
Execution is suspended because of error.
Warning:
Cannot insert hardware breakpoint 1.
Could not insert hardware breakpoints:
You may have requested too many hardware breakpoints/watchpoints.
As recently as I erase at least the first sector of the on chip flash via telnet it works fine again. Sometimes I must halt the target before the erase command works.
I use the latest Version of OpenOCD with FTDI-Lib and the latest Eclipse and Zylin tools.
These are my gdb init commands:
Code: Select all
target remote localhost:3333
monitor poll
monitor reset init
monitor sleep 500
monitor mww 0xE01FC040 0x0001
monitor mdw 0xE01FC040
# needed for gdb 6.8 and higher
set mem inaccessible-by-default off
monitor flash probe 0
load
break main
continue
I do not know what´s wrong.
thanks mgiaco
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
$begingroup$
I have a custom board with a STM32H7A3ZIT mcu. I’m programming it with a ST-Link V2 via SWD.
I’m trying to get an external hyperbus ram working, and immediately after programming the mcu with some questionable code, it no longer is able to be re-programmed. I get the error ST-LINK error (DEV_TARGET_NOT_HALTED)
Power-cycling the PCB, ST-Link and even the PC does not fix it.
I can tell the MCU is operating because it draws garbage on the LCD on powerup (problem I was working on before).
I believe the circuit is correct, because I’ve programmed this board dozens of times prior to this without issue.
The programming header on the board is routed to the MCU with no additional circuitry besides a 100nF cap on the NRST line. The BOOT0 pin is connected to gnd with a 1k resistor.
Has anyone else encountered this error and found a way to fix it?
asked Oct 6, 2021 at 8:02
$endgroup$
1
$begingroup$
I didn’t figure out what caused the problem, but I found a solution.
I used a probe connected to VDD, and forced BOOT0 high. I then powered up the PCB. With boot still tied high I ran the programming sequence, and it succeeded.
Forcing BOOT0 high only during the initial power up did not work.
Forcing NRST low at various points in the programming cycle also did not work. If I held it too long I would get TARGET_HELD_IN_RESET, and any time shorter I would get DEV_TARGET_NOT_HALTED.
Edit: I determined the cause of the hangup. I was working on initializing a hyperram IC. I had switched on memory mapped mode while the ram was still not work properly. This problem can be avoided by simply testing the ram in indirect-mode before entering memory mapped mode.
answered Oct 7, 2021 at 5:22
DrewDrew
5,4771 gold badge18 silver badges34 bronze badges
$endgroup$