openocd | The GNU MCU Eclipse OpenOCD | Code Editor library
kandi X-RAY | openocd Summary
kandi X-RAY | openocd Summary
The GNU MCU Eclipse OpenOCD project is a fork of OpenOCD, customised for a better/more convenient integration with the GNU MCU OpenOCD Debugging plug-in. Expect GNU MCU Eclipse OpenOCD to follow official OpenOCD releases, plus several intermediate releases, as needed.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of openocd
openocd Key Features
openocd Examples and Code Snippets
Community Discussions
Trending Discussions on openocd
QUESTION
I am using Openocd to debug my code remotely for STM32 via Raspberry pi as detailed in this tutorial: https://learn.adafruit.com/programming-microcontrollers-using-openocd-on-raspberry-pi
Whenever I run openocd it starts gdb server on port 3333 which is default of course as shown in the picture above. My question is that, is there a way to provide a different port number for openocd to start the gdb-debugger on... For example, if I want to run openocd where i want gdb server to start on 3334 instead of 3333 how can i do that.
I intend to do that so that i can run multiple openocd instances for different targets simultaneously connected to a single raspberry pi. Any help will be greatly appreciated. Thanks in advance.
...ANSWER
Answered 2021-Jun-14 at 14:29OpenOcd manual explains how to select a specific port number inside the configuration file as shown in image below:
QUESTION
I want to implement an embedded project using stm32F0 (arm-based) with VS Code. The project ran properly on other systems.
- I Added C/C++ extension to visual studio
- I installed a compiler for cortex-m0 arm: GNU Arm Embedded toolchain/gcc arm for windows.
- Makefiles installed: binaries file + dependencies file
- openOCD installed (open On Chip Debugger)
- tasks.json (build instructions), c_cpp_properties.json (compiler path and IntelliSense settings) were created. I modified the Include path because my program includes header files that aren't in my workspace, and that is not in the standard library path.
c_cpp_properties.json file
...ANSWER
Answered 2021-May-27 at 13:45Cannot open source file avr/io.h (dependency of hal.h)
You appear to be using ChibiOS whhich has a file hal.h which includes halconf.h which includes mcuconf.h. Clearly you appear to have an AVR port of ChibiOS where you need STM32 or ARM Cortex-M support.
But, how VS Code can find dependencies before compiling?
The same way as the compiler/pre-processor do, by having include paths configured, parsing the project files and accounting for any externally defined (command line) macros.
I also was wondering if I should add a path for main.cpp file and other C and CPP files in the configuration file of VS Code to solve these problems?
I believe it will parse project files in any case. It only needs to find the header files included in a source file to provide context for the parsing of the sourcefile.
For debugging, I don't see any debugger in the list, though I installed openOCD and add the path in the environment variable
That is an entirely different question - post a new question for that.
QUESTION
I'm having a hard time getting openocd to start. I attached an STM32F3 Discovery
board.
When I run openocd -f interface/stlink.cfg -f target/stm32f3x.cfg
I get the following error:
ANSWER
Answered 2021-Apr-29 at 20:47Turned out that the cable I used was just a power cable which didn't support data transmission.
With a proper mini USB cable that has all 4 lines it worked right away.
QUESTION
I am debugging board STM32f4 Discovery on Ubuntu 20.04 with openocd and arm-none-eabi-none. Things work well until yesterday. Today, when I connect the gdb to localhost:4444, following assertion happened and ocd quit:
...ANSWER
Answered 2021-Apr-26 at 01:45I found the issue: I scale up the clock speed without switching to appropriate Flash Latency so the debugger will lose the track of program address as mentioned here, in Clocks and initial settings part: https://vjordan.info/log/fpga/first-steps-with-the-stm32f4.html
QUESTION
I am using the Raspberry Pico and attempting to use the debugging tool in VS Code from VSCode on a Raspberry Pi 4, but I am getting the following error:
OpenOCD GDB executable "arm-none-eabi-gdb" was not found. Please configure "cortex-debug.armToolchainPath" correctly.
I have the following config for launch.json
...ANSWER
Answered 2021-Feb-17 at 11:45There has been a fix recently in the documentation.
As explained in this link: https://github.com/raspberrypi/pico-examples/issues/8
When setting a Raspberry Pi up as described in the Getting Started guide, two problems arise when launching the debugger:
Setting "gdbpath" in launch.json is marked as not allowed When launching the setting is ignored, and arm-none-eabi-gdb is used, which is unavailable It seems that setting "cortex-debug.gdbpath" can only be set in settings.json
So remove.
"gdbpath" : "gdb-multiarch" from launch.json and add "cortex-debug.gdbPath": "gdb-multiarch" to settings.json.
QUESTION
Some devs on our team have J-Link debuggers while others are working with ST-Link debuggers. All of us work on the same hardware with the same firmware, basically everything else is the same. The current setup requires to start OpenOCD with a different cfg file for each adapter. I would like to have this done automatically.
Is there a way to configure OpenOCD to automatically choose the correct cfg file based on the connected adapter?
...ANSWER
Answered 2021-Feb-02 at 13:47With linux you could use the USB-VendorID/ProductID to choose the config file.
You could start via a shell script like
QUESTION
I'm learning how to use OpenOCD and GDB according to the Rust Embedded Book.
There is a moment when you connect to the running OpenOCD:
...ANSWER
Answered 2021-Jan-15 at 16:39When you connect to the target with target remote
GDB asks the target for its current register state, including the $pc
value. GDB does NOT (at that point) modify the remote state in any way.
When you first connected the remote reported a $pc
value of 0x0
. If the remote changed state for some reason, lets say, you ran something on the remote, then the $pc
value might change, say to 0x08000bbe
.
If you then disconnect and reconnect the remote target might still have a $pc
value of 0x08000bbe
which is what GDB will see.
As was mentioned in the comments, GDB is just trying to map the $pc
value onto the debug information in your program. The ??
shows that GDB can't find any symbols at address 0x0
. While GDB did find the symbol __c_m_sh_syscall
near to address 0x08000bbe
. However, this is information doesn't mean much at this point, you've not yet loaded anything onto the target, so you're not really in the function __c_m_sh_syscall
, it's just the current address of the remote.
When you do the load
command this is when GDB loads the executable onto the target, and writes to the $pc
.
TL;DR; If your work flow is target remote
then load
, don't worry about the state of the target immediately after the target remote
, this is just whatever random state happens to be in the target when you connect.
QUESTION
I am programming a C# application which will be used to program and test STM32 microcontrollers during production. I would like to program and verify the chip, then write some configuration to the flash memory and finally set the read-out protection. As a backend I decided to use OpenOCD and its Tcl interface running at port 6666.
The problem: I am able to execute commands and get their results, but I don't know how to check if the command was successfully executed or not. E.g. the reset
command returns empty string no matters the target is connected or not... Some other commands like mdw
return data or error string, but I am looking for some generic way how to check if the command succeeded or not.
Thank you for your ideas.
...ANSWER
Answered 2021-Jan-13 at 17:12Assuming your Tcl code has a bit in its heart doing sendBack [eval $script]
, you'd change it to do this:
QUESTION
I want to be able to run and debug a binary generated from pure assembly on an ARM Cortex-M4 microcontroller without having to use inline assembly inside a C program.
I have a linker script and some utility C startup code, which sets up the interrupt vector table, implements the Reset_Handler
function, copies the .data
section from flash to SRAM and then calls main()
. This workflow works ok, but it's a bit clunky, and I would rather write assembly directly instead of inline in a C program that is nothing more than main()
with the assembly mnemonics. I also want to know out of interest - maybe there is a better way altogether of going about this. The Reset_Handler
function looks like this:
ANSWER
Answered 2020-Nov-14 at 18:45Your linker script
QUESTION
I am trying to make an extremely minimal stm32f215 firmware to teach myself its boot-up intricacies. As it is now I have this dump which, to my knowledge, should write the stack address to r0 and loop forever:
...ANSWER
Answered 2020-Jul-01 at 15:23And the culprit has been found! It appears the st-util debugger (from the project mentioned above) causes an error somehow. openocd works like a charm and with that the minimal code above works.
Anyway, bug reports to write and all that...
Thank you all so much for verifying my assembler and helping me with dotting all the t's and crossing all the i's!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install openocd
How to publish
Change log
See the releases page. Binaries for most platforms can be downloaded from GitHub Releases.
Credit to Shields IO and Somsubhra/github-release-stats.
GitHub gnu-mcu-eclipse/openocd.git latest release all releases
xPack @gnu-mcu-eclipse/openocd latest release, per month all releases
individual file counters (grouped per release)
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page