SparkFun Forums 

Where electronics enthusiasts find answers.

Open source ARM Debugger
By thebigone
#178687
Hello all,

To start off with, I am a newbie with ARM boards / OpenOCD, but I have done a lot with AVR chips (not Arduino).

I have recently purchased a Nucleo board (specifically STM32F411 Nucleo) to get my feet wet with embedded ARM, and I am slowly getting used to it. However I have a question about OpenOCD.

To upload my program to the board, I need to first reset the chip. (Specifically, I need to hold down reset, start the openocd upload command, wait for a second, and then release reset). If I do not do this, I get the following error:
Code: Select all
Open On-Chip Debugger 0.9.0-dev-00223-g1567cae (2015-01-13-17:32)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.sourceforge.net/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: 2000 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : clock speed 2000 kHz
Info : STLINK v2 JTAG v23 API v2 SWIM v6 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.272439
Error: init mode failed
in procedure 'program' 
in procedure 'init' called at file "embedded:startup.tcl", line 459
in procedure 'ocd_bouncer' 
in procedure 'transport'
** OpenOCD init Failed **
shutdown command invoked
I am using the following command to upload the program:
Code: Select all
openocd -f board/st_nucleo_f411re.cfg -c "program test.hex verify reset"
Now, resetting to upload is not a big deal; slightly annoying, but perfectly doable. However, I get the same error if I try to connect using the command line (for telnet connection, or GDB, etc):
Code: Select all
theodore@localhost:~/Documents/programming/arm/stm32f411/test$ openocd -f board/st_nucleo_f411re.cfg
Open On-Chip Debugger 0.9.0-dev-00223-g1567cae (2015-01-13-17:32)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.sourceforge.net/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: 2000 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : clock speed 2000 kHz
Info : STLINK v2 JTAG v23 API v2 SWIM v6 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.275611
Error: init mode failed
in procedure 'init' 
in procedure 'ocd_bouncer' 
in procedure 'transport'
in procedure 'init'
As you can see, I am using the latest git head version, compiled yesterday (version 0.8.0 does not have support for my F411 chip).

Am I doing something wrong, or is it just an issue with the bleeding edge git version? I apologize if this is a n00b question, but I have read everything I can find.

I would greatly appreciate any help / pointers on the issue.

Cheers
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]