Questions tagged [openocd]

OpenOCD stands for Open On Chip Debugger and is a program used to debug embedded platforms, mostly via JTAG.

286 questions
73
votes
5 answers

How to use the GDB (Gnu Debugger) and OpenOCD for microcontroller debugging - from the terminal?

The standard (low-cost) way to program ARM microcontrollers is using Eclipse with a complex toolchain plugged into it. Eclipse has definitely its merits, but I'd like to feel independent from this IDE. I'd like to discover what happens behind the…
K.Mulier
  • 8,069
  • 15
  • 79
  • 141
19
votes
6 answers

STM32F0, ST-link v2, OpenOCD 0.9.0: open failed

I'm using Launchpad's gcc-arm-none-eabi 4.9-2015q2 to compile for an STM32F0, and now I'd like to debug using arm-none-eabi-gdb from that collection. My ST-Link v2 is part of a Nucleo F411RE board, with external hardware (the STM32F0 target)…
Christoph
  • 1,040
  • 3
  • 14
  • 29
18
votes
3 answers

STM32 GDB/OpenOCD Commands and Initialization for Flash and Ram Debugging

I am looking for assistance with the proper GDB / OpenOCD initializion and running commands (external tools) to use within Eclipse for flash and RAM debugging, as well as the proper modifications or additions that need to be incorporated in a…
user690605
  • 181
  • 1
  • 1
  • 4
17
votes
4 answers

How to script gdb (with python)? Example add breakpoints, run, what breakpoint did we hit?

I'm trying to create a little unit test with gdb, for a embedded mcu that is controlled by OpenOCD (that gives me control over my target via a gdb server). So I would like to automate this with some scripting of gdb. I would like to write some kind…
Johan
  • 20,067
  • 28
  • 92
  • 110
13
votes
2 answers

STM32 Read-out protection via OpenOCD

The STM32 family of microcontrollers features a read-out protection feature so proprietary code can't be read out via the debug interface (JTAG or SWD). Using OpenOCD, how can I enable/disable the read-out protection via a SWD/JTAG interface? How…
Uli Köhler
  • 13,012
  • 16
  • 70
  • 120
11
votes
2 answers

reason 7 - target needs reset -- unreliable debugging setup

I am having trouble getting a reliable debugging setup. I have seen other threads in some forums across the net with a similar title, but the circumstances seem different. Setup: Linux (Xubuntu) 64bit Eclipse CDT, Neon 4.6.0 "GDB Hardware…
user1847129
  • 1,010
  • 2
  • 9
  • 21
10
votes
0 answers

How to run OpenOCD GDB server from Visual studio Code

I'm developing applications on a Cortex-M3 microcontroller (STM32 family). I'm trying to use Visual Studio Code as the debugger interface, with a ST-Link v2 JTAG probe. I managed to configure OpenOCD to talk to my device, and VSCode to run a local…
Doub
  • 1,222
  • 1
  • 8
  • 15
10
votes
3 answers

openocd **Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED**

I am trying to setup a eclipse development environment to work with stm32f303 nucleo 32 board. http://www.st.com/en/evaluation-tools/nucleo-f303k8.html So far, the all the tools seems to be correctly installed and working: I have succefully compiled…
Raph9023
  • 111
  • 1
  • 1
  • 5
9
votes
4 answers

"No ST-LINK detected" error message, when trying to connect with ST-LINK Utility

I have a NUCLEO-F401RE board (with STM32F401RE) and it has been working fine for the most part. Here recently, I followed a tutorial in the book "Mastering STM32" where it says to install OpenOCD. I had been following along before this as well,…
Kbonde
  • 91
  • 1
  • 1
  • 4
9
votes
2 answers

OpenOCD fails to connect with cortex processor

I'm trying to flash a cortex m0 based SoC from a Raspberry Pi 3 Compute Module GPIOs but it keeps failing with the same error. Error: Could not initialize the debug port I'm following this…
Budius
  • 39,391
  • 16
  • 102
  • 144
8
votes
2 answers

How to ping a chip (detect if a chip is connected) with OpenOCD

1. The problem explained I'm trying to use OpenOCD for something uncommon. Instead of connecting to the chip, I'd like to merely detect the chip. The procedure I have in mind would look like this: Start OpenOCD with the probe config file (eg.…
K.Mulier
  • 8,069
  • 15
  • 79
  • 141
7
votes
3 answers

How can I configure Eclipse, GCC, and OpenOCD to work with the STM32F4Discovery board?

I am in possession of an STM32F4Discovery board, which contains both an STM32F4 microcontroller, and an ST-LINKv2 debugger interface. I would like to do some simple C programming on this setup, and would like to use freely available tools to do…
Mark
  • 11,257
  • 11
  • 61
  • 97
6
votes
1 answer

Where does STDOUT go with GDB, OopenOCD and semihosting?

I am trying to figure out semihostong on ARM (STM32042). I can see printf output if I run openocd directly from a command line and connect to it from gdb over TCP. But if I launch openocd from inside gdb, the output goes to some big /dev/null in the…
iter
  • 4,171
  • 8
  • 35
  • 59
5
votes
2 answers

Flash / Run Altera Cyclone IV with OpenOCD

I would like to run an Altera Cyclone IV IP with OpenOCD. No matter what file I need from quartus, but the execution should be done by OpenOCD. I am currently trying to do it with a sof file. The one that quartus uses for the programmer. Additional…
Cyborg-X1
  • 355
  • 1
  • 13
5
votes
2 answers

Gdb can't connect to OpenOCD on stm32

Trying to debug my sample blink_led code on STM32L476 Nucleo-64 board but gdb can't connect to OpenOCD (connection drops almost instantly with error). I've read plenty of posts here and there but none of them helped. Tried adding commands to OpenOCD…
M. Sh
  • 123
  • 2
  • 7
1
2 3
19 20