Can't find openocd.cfg

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

$URL: http://svn.berlios.de/svnroot/repos/ope … /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?

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:

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

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

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

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

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

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

$URL: http://svn.berlios.de/svnroot/repos/ope … /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?

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

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

$URL: http://svn.berlios.de/svnroot/repos/ope … /openocd.c $

500 kHz

Error: unable to open ftdi device: device not found

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

abhinav:
$URL: http://svn.berlios.de/svnroot/repos/ope … /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

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

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.

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

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
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
interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG"
ft2232_layout olimex-jtag
ft2232_vid_pid 0x15ba 0x0003

REFERENCE: 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

abhinav:

REFERENCE: 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

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?

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:

sudo openocd -d3 -f openocd.cfg

BR

Johan

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?

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/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

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.