Arduino Zero bonus bin (openocd supported)

User avatar
sheepdoll
Posts: 236
Joined: Fri May 22, 2015 12:58 am
Location: Silicon Valley Vortex
Contact:

Re: Arduino Zero bonus bin (openocd supported)

Post by sheepdoll » Wed Jun 17, 2015 9:44 pm

I found the obvious "http://openocd.org" that is what I was looking for. Who bothers to read comment URLs in install files Wonder why giggle failed to find it when I searched last week? It may have taken me to the source forge page which looked like a sketchy wal-o-text for some guys thesis project.

Anyway the source forge page links to the eclipse plugin, which is sort of what I was looking for. Apart that I can not get eclipse to run unser OSX 10.7.5 It keeps looking for java 1.6. I had installed the jre1.8 to run cube. All the searches to make eclipse work have the user hacking paths to java JDK1.7 blech. I really did not want to download jdk1.8 but am doing it now.

Rather nasty install, as there seem to be no one click installs on the oracle page. The installer page is practically useless with what should be a click able link as outdated text.

Edit: I got eclipse to run after the install of the JDK. Not user friendly at all. I expect to see a text editor/tree browser for c/c++ on creation of a target project. Does look pretty powerful though.

Edit Edit! well that was a waste of an afternoon. After attempting to install openocd as an eclipse plugin, it crashes with illegal instruction 4. This install is stupid and ignorant. I just want a nice standalone GUI gdb debugger, not the kitchen sink.

One step of an installer wants me to remove the macports path from the .profile. WHAT!!! that breaks the links to ghostscript X11 and the tools I need to use for my everyday work.

This stuff is a joke, or it is for people who like hacking around the path system.

It may be possible to point the eclipse/gdb/openocd to the openocd I downloaded this morning from the Arduino.cc toolchain per the instructions above. That one at least gives me help and a version number when prompted. (It should give help an a naked run, but these tools are not created by professionals that need to get work done.)

User avatar
Rick Kimball
Posts: 1011
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Arduino Zero bonus bin (openocd supported)

Post by Rick Kimball » Thu Jun 18, 2015 12:37 pm

The openocd that comes with Zero seems to work fine with those ebay stlink v2 devices. I grabbed my discovery vl board (stm32f100rb with an STLink V1) and tried it with the ebay stlink v2 device instead to see how it easy it would be to upload a binary:

Code: Select all

$ openocd -s ${OPENOCD_PATH} -f ./stm32vldiscovery_v2.cfg -c 'telnet_port disabled; program stm32f100_blink_register.elf verify reset exit'
It worked great.

I guess I could have provided all the command line args to tell openocd that I wanted to use an stlinkv2 and an stm32f1. However, It seemed simpler to opt for a configuration file with all those commands:

Code: Select all

$ cat stm32vldiscovery_v2.cfg 
# This is an STM32VL discovery board with a single STM32F100RB chip.
# http://www.st.com/internet/evalboard/product/250863.jsp
source [find interface/stlink-v2.cfg]
transport select hla_swd
set WORKAREASIZE 0x2000
source [find target/stm32f1x.cfg]
reset_config none
So if i can make something silly like that work, I think there is hope we could use this directly from platform.txt with our boards. We just need to make some openocd configuration files for the different variants.

-rick
-rick

User avatar
Rick Kimball
Posts: 1011
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Arduino Zero bonus bin (openocd supported)

Post by Rick Kimball » Thu Jun 18, 2015 12:42 pm

sheepdoll wrote:One step of an installer wants me to remove the macports path from the .profile. WHAT!!! that breaks the links to ghostscript X11 and the tools I need to use for my everyday work.
The simplest thing to do is make a wrapper script for things that aren't standard. Set the PATH in there to what is needed and it only affects that executable.

myeclipse.sh

Code: Select all

#!/usr/bin/bash
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/somewackypath/bin
eclipse &
Then just run that instead of eclipse.
-rick

User avatar
RogerClark
Posts: 6895
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Arduino Zero bonus bin (openocd supported)

Post by RogerClark » Mon Jul 06, 2015 6:46 am

Guys,

Is this all still using Eclipse as the debugger ?

Any sign of any debugger support in the Arduino IDE ?? (or is it Atmel studio for Zero users)

User avatar
Rick Kimball
Posts: 1011
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Arduino Zero bonus bin (openocd supported)

Post by Rick Kimball » Mon Jul 06, 2015 2:34 pm

To be honest, I'm not actually using any of this. I mostly use a BMP debugger with arm-none-eabi-gdb launched in an xterm.

-rick
-rick

User avatar
sheepdoll
Posts: 236
Joined: Fri May 22, 2015 12:58 am
Location: Silicon Valley Vortex
Contact:

Re: Arduino Zero bonus bin (openocd supported)

Post by sheepdoll » Mon Jul 06, 2015 5:25 pm

TexannSTLink/GDB works for what I have. Not spent any more time with openOCD/eclipse other than it seems to be installed.

May get back to it, but I have other more interesting things to play with.

victor_pv
Posts: 1649
Joined: Mon Apr 27, 2015 12:12 pm

Re: Arduino Zero bonus bin (openocd supported)

Post by victor_pv » Tue Jul 07, 2015 5:17 am

I started using GDB to troubleshoot some code, and it helped my find some variables did not have the value expected, but I really hate having to type commands.
Has any of you found a good GDB GUI for Windows?

GDB is way better than nothing, thanks to Rick for showing how to load it automatically in Linux, now I do the same in Windows, but I really need a GUI.

User avatar
RogerClark
Posts: 6895
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Arduino Zero bonus bin (openocd supported)

Post by RogerClark » Tue Jul 07, 2015 5:37 am

Victor

I have researched this, and there currently isn't a GUI for GDB on Windows.

Eclipse where supposed to have released their Standalone Debugger (part of Their C development tools package), but I'm not sure if that has happened yet, and to be honest Eclipse is a massive install and the config is not that easy.

Nothing else that I have tried works on windows, e.g. I tried DDD using cygwin, but it had issues with slashes in paths, which meant it didnt work, I found some Java based editor with a GDB plugin, but the whole thing i.e. the editor, was no longer supported, so I could not get the GDB plugin to work.

It may be possible to use MS Visual Studio, but again I think its a sledgehammer to crack a nut.

To be honest, I think we should investigate how we can build some sort of simple UI to GDB into the Arduino IDE.
But the IDE won't even open C files (except in its sketch folder), so there would probably need to be a lot of hacking / changes to get that to work.

User avatar
Rick Kimball
Posts: 1011
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Arduino Zero bonus bin (openocd supported)

Post by Rick Kimball » Tue Jul 07, 2015 11:24 am

victor_pv wrote:... but I really hate having to type commands. ...
Tab completion built into arm-none-eabi-gdb is your friend. It works for commands and program symbols, so type the first few letters of a function name, variables, registers etc then press tab to get it started.

https://sourceware.org/gdb/onlinedocs/g ... etion.html

-rick
-rick

Post Reply