# Can't find openocd.cfg

**URL:** <https://community.sparkfun.com/t/cant-find-openocd-cfg/13031>\
**Category:** MicroMod\
**Tags:** arm-lpc\
**Created:** [October 26, 2009, 10:30am UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031 "2009-10-26T10:30:35Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhinav](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@abhinav](https://community.sparkfun.com/u/abhinav)\
**Post date:** [October 26, 2009, 10:30am UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/1 "2009-10-26T10:30:35Z")

</div>

hi all.i am sort of new in dev boards programming and am learning much from manuals.but i kind of freak out when things turn out to be different from what the manual says it would be.

my first trouble was getting the board to be recognised by the ubuntu desktop.for this i found out i have to use openocd.and i installed it form the links in google.when i try to run it from terminal,this id what i get as output.

abhinav@abhinav-desktop:~$ openocd

Open On-Chip Debugger 1.0 (2008-11-26-09:42) svn:unknown

BUGS? Read [http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS](http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS)

$URL: [http://svn.berlios.de/svnroot/repos/ope … /openocd.c](http://svn.berlios.de/svnroot/repos/openocd/trunk/src/openocd.c) $

Runtime error, file “?”, line 1:

Can’t find openocd.cfg

In procedure ‘script’ called at file “command.c”, line 436

In procedure ‘find’ called at file “embedded:startup.tcl”, line 166

i tried to google the error and found no luck.the config file is there in the same dir as openocd but i dont know why it spits out the error saying its not there…

my debugger is arm usb tiny and board is STM32-P103 FROM OLIMEX.any help for the novice?

---

<div class="post-metadata">

**Author:** ![jsiei97](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jsiei97](https://community.sparkfun.com/u/jsiei97)\
**Post date:** [October 26, 2009, 10:40am UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/2 "2009-10-26T10:40:55Z")

</div>

> abhinav:  
> i tried to google the error and found no luck.the config file is there in the same dir as openocd but i dont know why it spits out the error saying its not there…
> 
> my debugger is arm usb tiny and board is STM32-P103 FROM OLIMEX.any help for the novice?

I am also trying to get the stm32 to work, and I have documented my work here:

- [http://fun-tech.se/stm32/OpenOCD/index.php](http://fun-tech.se/stm32/OpenOCD/index.php)

Right now I can build and flash my dev card, but not debug it (“step the code”).

It is based on the Olimex STM32-H103 and the Olimex ARM-USB-OCD,

so it is quite close to your config…

> abhinav:  
> my first trouble was getting the board to be recognised by the ubuntu desktop.

What Ubuntu version are you using?

BR

Johan

---

<div class="post-metadata">

**Author:** ![abhinav](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@abhinav](https://community.sparkfun.com/u/abhinav)\
**Post date:** [October 26, 2009, 10:45am UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/3 "2009-10-26T10:45:59Z")

</div>

mine is 9.04 and how do i check if ithe board is recognised by the os?

---

<div class="post-metadata">

**Author:** ![jsiei97](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jsiei97](https://community.sparkfun.com/u/jsiei97)\
**Post date:** [October 26, 2009, 10:48am UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/4 "2009-10-26T10:48:27Z")

</div>

> abhinav:  
> mine is 9.04 and how do i check if ithe board is recognised by the os?

In the middle of that page there is a section called “Connect to the hardware”, and there you can see a bit from dmesg on my system after I connected the jtag.

You should get something similar.

BR

Johan

---

<div class="post-metadata">

**Author:** ![abhinav](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@abhinav](https://community.sparkfun.com/u/abhinav)\
**Post date:** [October 26, 2009, 10:49am UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/5 "2009-10-26T10:49:30Z")

</div>

yeah i got a similar one.does that mean that a connection has been established between them?

Bus 003 Device 002: ID 15ba:0004 Olimex Ltd. OpenOCD JTAG TINY

---

<div class="post-metadata">

**Author:** ![jsiei97](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jsiei97](https://community.sparkfun.com/u/jsiei97)\
**Post date:** [October 26, 2009, 10:51am UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/6 "2009-10-26T10:51:36Z")

</div>

> abhinav:  
> yeah i got a similar one.does that mean that a connection has been established between them?

Yes kind of,

that means that kernel knows about the hardware.

So I guess that now it is a question about getting OpenOCD to work.

BR

Johan

---

<div class="post-metadata">

**Author:** ![abhinav](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@abhinav](https://community.sparkfun.com/u/abhinav)\
**Post date:** [October 26, 2009, 10:55am UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/7 "2009-10-26T10:55:06Z")

</div>

ya but one question here.the error i got before connecting when i launched openocd from terminal was

abhinav@abhinav-desktop:~/Desktop$ openocd

Open On-Chip Debugger 1.0 (2008-11-26-09:42) svn:unknown

BUGS? Read [http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS](http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS)

$URL: [http://svn.berlios.de/svnroot/repos/ope … /openocd.c](http://svn.berlios.de/svnroot/repos/openocd/trunk/src/openocd.c) $

Runtime error, file “?”, line 1:

Can’t find openocd.cfg

In procedure ‘script’ called at file “command.c”, line 436

In procedure ‘find’ called at file “embedded:startup.tcl”, line 166

why was it not able to find the .cfg file when it was present all along?does that mean i am missing some file here?

---

<div class="post-metadata">

**Author:** ![jsiei97](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jsiei97](https://community.sparkfun.com/u/jsiei97)\
**Post date:** [October 26, 2009, 11:46am UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/8 "2009-10-26T11:46:07Z")

</div>

> abhinav:  
> abhinav@abhinav-desktop:~/Desktop$ openocd
> 
> Open On-Chip Debugger 1.0 (2008-11-26-09:42) svn:unknown
> 
> …
> 
> why was it not able to find the .cfg file when it was present all along?does that mean i am missing some file here?

Have you tried to specify where the file is with:

openocd -f openocd.cfg

BR

Johan

---

<div class="post-metadata">

**Author:** ![abhinav](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@abhinav](https://community.sparkfun.com/u/abhinav)\
**Post date:** [October 26, 2009, 12:32pm UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/9 "2009-10-26T12:32:59Z")

</div>

ya i even modified the path to include directory where the file is.still does not work

actually that command resulted in an output which said …

abhinav@abhinav-desktop:~$ openocd -f openocd.cfg

Open On-Chip Debugger 1.0 (2008-11-26-09:42) svn:unknown

BUGS? Read [http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS](http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS)

$URL: [http://svn.berlios.de/svnroot/repos/ope … /openocd.c](http://svn.berlios.de/svnroot/repos/openocd/trunk/src/openocd.c) $

500 kHz

Error: unable to open ftdi device: device not found

Runtime error, file “command.c”, line 436:

---

<div class="post-metadata">

**Author:** ![jsiei97](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jsiei97](https://community.sparkfun.com/u/jsiei97)\
**Post date:** [October 26, 2009, 1:10pm UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/10 "2009-10-26T13:10:01Z")

</div>

> abhinav:  
> $URL: [http://svn.berlios.de/svnroot/repos/ope … /openocd.c](http://svn.berlios.de/svnroot/repos/openocd/trunk/src/openocd.c) $
> 
> 500 kHz
> 
> Error: unable to open ftdi device: device not found
> 
> Runtime error, file “command.c”, line 436:

Looks like you now have to focus on what is inside your cfg file…

You can find my config here:

[http://fun-tech.se/stm32/OpenOCD/openocd.cfg](http://fun-tech.se/stm32/OpenOCD/openocd.cfg)

And I created it from

- some general config

- /usr/lib/openocd/interface/olimex-arm-usb-ocd.cfg

- /usr/lib/openocd/target/stm32.cfg

But since your hardware is a little bit different,

you may have to improvise a little here…

BR

Johan

---

<div class="post-metadata">

**Author:** ![abhinav](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@abhinav](https://community.sparkfun.com/u/abhinav)\
**Post date:** [October 26, 2009, 1:14pm UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/11 "2009-10-26T13:14:26Z")

</div>

i have seen ur config file and trying to make changes to it.can u recommend some?i can send u what all files u want.

---

<div class="post-metadata">

**Author:** ![jsiei97](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jsiei97](https://community.sparkfun.com/u/jsiei97)\
**Post date:** [October 26, 2009, 1:14pm UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/12 "2009-10-26T13:14:43Z")

</div>

> abhinav:  
> Bus 003 Device 002: ID 15ba:0004 Olimex Ltd. OpenOCD JTAG TINY

Please note that you can’t use mine config directly since my hardware is identified as:

Bus 003 Device 009: ID 15ba:0003 Olimex Ltd. OpenOCD JTAG

---

<div class="post-metadata">

**Author:** ![jsiei97](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jsiei97](https://community.sparkfun.com/u/jsiei97)\
**Post date:** [October 26, 2009, 1:18pm UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/13 "2009-10-26T13:18:33Z")

</div>

> abhinav:  
> i have seen ur config file and trying to make changes to it.can u recommend some?i can send u what all files u want.

Have a look at

- /usr/lib/openocd/interface/olimex-jtag-tiny-a.cfg

```auto
interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG TINY A"
ft2232_layout olimex-jtag

```

And compare that with “my”:

- /usr/lib/openocd/interface/olimex-arm-usb-ocd.cfg

```auto
interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG"
ft2232_layout olimex-jtag
ft2232_vid_pid 0x15ba 0x0003

```

---

<div class="post-metadata">

**Author:** ![abhinav](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@abhinav](https://community.sparkfun.com/u/abhinav)\
**Post date:** [October 26, 2009, 1:20pm UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/14 "2009-10-26T13:20:18Z")

</div>

# REFERENCE: [http://www.olimex.com/dev/arm-usb-tiny.html](http://www.olimex.com/dev/arm-usb-tiny.html)

interface ft2232

ft2232\_device\_desc “Olimex OpenOCD JTAG TINY A”

ft2232\_layout olimex-jtag

yeah i already maade that change

---

<div class="post-metadata">

**Author:** ![jsiei97](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jsiei97](https://community.sparkfun.com/u/jsiei97)\
**Post date:** [October 26, 2009, 1:36pm UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/15 "2009-10-26T13:36:23Z")

</div>

> abhinav:
> 
> # REFERENCE: [http://www.olimex.com/dev/arm-usb-tiny.html](http://www.olimex.com/dev/arm-usb-tiny.html)
> 
> interface ft2232
> 
> ft2232\_device\_desc “Olimex OpenOCD JTAG TINY A”
> 
> ft2232\_layout olimex-jtag
> 
> yeah i already maade that change

Running out of ideas…

But since lsusb told you “OpenOCD JTAG TINY”,

and the config talks about “OpenOCD JTAG TINY A”…

You could try without the “A” at the end.

BR

Johan

---

<div class="post-metadata">

**Author:** ![abhinav](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@abhinav](https://community.sparkfun.com/u/abhinav)\
**Post date:** [October 26, 2009, 1:43pm UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/16 "2009-10-26T13:43:06Z")

</div>

does not work still the same error.is that the only change required?what abt the line in error which says some command.c something.

also my lsusb output is slightly different from urs

Bus 003 Device 002: ID 15ba:0004 Olimex Ltd. OpenOCD JTAG TINY

so i modified my .cfg file to

interface ft2232

ft2232\_device\_desc “Olimex OpenOCD JTAG TINY”

ft2232\_layout olimex-jtag

ft2232\_vid\_pid 0x15ba 0x0004

is it right?

---

<div class="post-metadata">

**Author:** ![jsiei97](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jsiei97](https://community.sparkfun.com/u/jsiei97)\
**Post date:** [October 26, 2009, 1:46pm UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/17 "2009-10-26T13:46:16Z")

</div>

> abhinav:  
> does not work still the same error.is that the only change required?what abt the line in error which says some command.c something.

There is another thing, did you add the fix so you don’t have to use sudo?

Otherwise you could try:

```auto
sudo openocd -d3 -f openocd.cfg

```

BR

Johan

---

<div class="post-metadata">

**Author:** ![abhinav](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@abhinav](https://community.sparkfun.com/u/abhinav)\
**Post date:** [October 26, 2009, 3:01pm UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/18 "2009-10-26T15:01:07Z")

</div>

turns out it was some permissions problem.so finally got it working.thanks for ur help.now for the next part.did u try to execute anyother program than the demo program?can u give me details of the entire toolchain and process u used.did u use eclipse to compile?

---

<div class="post-metadata">

**Author:** ![jsiei97](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jsiei97](https://community.sparkfun.com/u/jsiei97)\
**Post date:** [October 26, 2009, 3:58pm UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/19 "2009-10-26T15:58:26Z")

</div>

> abhinav:  
> turns out it was some permissions problem.so finally got it working.thanks for ur help.now for the next part.did u try to execute anyother program than the demo program?can u give me details of the entire toolchain and process u used.did u use eclipse to compile?

This is what I have so far:

[http://fun-tech.se/stm32/gcc/index.php](http://fun-tech.se/stm32/gcc/index.php)

[http://fun-tech.se/stm32/gcc/compile\_blinky.php](http://fun-tech.se/stm32/gcc/compile_blinky.php)

It will produce the gcc for you, and that you can use to build i.e. blinky.

And I did not use Eclipse at all (even thou I plan to in the future).

BR

Johan

---

<div class="post-metadata">

**Author:** ![abhinav](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@abhinav](https://community.sparkfun.com/u/abhinav)\
**Post date:** [October 27, 2009, 9:46am UTC](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031/20 "2009-10-27T09:46:04Z")

</div>

hi i have been trying to follow what u did on my desktop ans in the newlib stage when we do

make $PARALLEL CFLAGS\_FOR\_TARGET="-ffunction-sections \

-fdata-sections \

-DPREFER\_SIZE\_OVER\_SPEED \

-D\_\_OPTIMIZE\_SIZE\_\_ \

-Os \

-fomit-frame-pointer \

-mcpu=cortex-m3 \

-mthumb \

-D\_\_thumb2\_\_ \

-D\_\_BUFSIZ\_\_=256" \

CCASFLAGS=“-mcpu=cortex-m3 -mthumb -D\_\_thumb2\_\_”

the output ended with an error

make[2]: Leaving directory `/home/abhinav/stm32/newlib-1.17.0/build/arm-none-eabi/newlib’

make[1]: \*\*\* [all-target-newlib] Error 2

this was repeated several times.is it an error?or is it the way it should be behaving?i got a similar error for binutils.gcc configured and built without any error.

[Next page](https://community.sparkfun.com/t/cant-find-openocd-cfg/13031.md?page=2)
