# Flash-programming with OpenOCD doesn’t work

**URL:** <https://community.sparkfun.com/t/flash-programming-with-openocd-doesn-t-work/6373>\
**Category:** MicroMod\
**Tags:** arm-lpc\
**Created:** [February 3, 2008, 11:24am UTC](https://community.sparkfun.com/t/flash-programming-with-openocd-doesn-t-work/6373 "2008-02-03T11:24:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisbb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@chrisbb](https://community.sparkfun.com/u/chrisbb)\
**Post date:** [February 3, 2008, 11:24am UTC](https://community.sparkfun.com/t/flash-programming-with-openocd-doesn-t-work/6373/1 "2008-02-03T11:24:39Z")

</div>

Hello,

I have purchased Olimex’ SAM7-P256 board (with AT91SAM7S256) together with ARM-USB-OCD JTAG-Interface but I cannot flash the microcontroller.

I have installed the toolchain from YAGARTO and used Jim Lynch’s very detailed manual, but for some reason it still doesn’t work.

Using Jim’s example files (“demo\_at91sam7\_blink\_flash”), I can build the files for the uC, but as soon as I want to transfer the files into Flash-memory, the answer in the “console”-view is:

make program

Flash Programming with OpenOCD…

'C:\Programme\openocd-r247\bin'openocd-ftd2xx.exe -f 'C:\Programme\openocd-r247\bin'at91sam7s256-armusbocd-flash-program.cfg # program the onchip FLASH here

/usr/bin/sh: C:\Programme\openocd-r247\bin\openocd-ftd2xx.exe: command not found

make: \*\*\* [program] Error 127

It doesn’t matter if the board is actually connected to the PC or not, I always get the same response. Therefor I think the problem is somewhere in the toolchain setup rather than hardware.

As you might have guessed from this description, I’m quite new to the whole “embedded systems” world. Therefore I assume my problem is hopefully nothing more than a beginner’s mistake.

Any help is highly appreciated,

chris

P.S. I’m using the makefile and Open OCD-config files like available for download, therefore I didn’t attach them. If required, I can send them

---

<div class="post-metadata">

**Author:** ![mifi](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@mifi](https://community.sparkfun.com/u/mifi)\
**Post date:** [February 3, 2008, 1:00pm UTC](https://community.sparkfun.com/t/flash-programming-with-openocd-doesn-t-work/6373/2 "2008-02-03T13:00:30Z")

</div>

Hello Chris,

> /usr/bin/sh: C:\Programme\openocd-r247\bin\openocd-ftd2xx.exe: command not found

The openocd-ftd2xx binary is not found. Have you installed OpenOCD

on your PC? If not, take a look here:

[http://www.yagarto.de/howto/openocd/index.html](http://www.yagarto.de/howto/openocd/index.html)

Best regards,

Michael

---

<div class="post-metadata">

**Author:** ![chrisbb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@chrisbb](https://community.sparkfun.com/u/chrisbb)\
**Post date:** [February 3, 2008, 2:22pm UTC](https://community.sparkfun.com/t/flash-programming-with-openocd-doesn-t-work/6373/3 "2008-02-03T14:22:31Z")

</div>

Hi Michael,

thanks for the quick reply.

I have installed OpenOCD right from the beginning, or at least I followed all the steps mentioned in your link. I also tested successfully the installation like suggested (with C:\make --version and C:\>openocd-pp -h), but I still get the same error.

You mention that the openocd-ftd2xx binary is not found. What exactly is the name of the missing file? - openocd-ftd2xx.bin?

I made a file search for openocd-ftd2xx.bin, nothing on my PC.

And when I start OpenOCD as external tool from Eclipse, it works and I can see the according process in windows task manager.

chris

---

<div class="post-metadata">

**Author:** ![mifi](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@mifi](https://community.sparkfun.com/u/mifi)\
**Post date:** [February 3, 2008, 2:28pm UTC](https://community.sparkfun.com/t/flash-programming-with-openocd-doesn-t-work/6373/4 "2008-02-03T14:28:53Z")

</div>

Hello Chris,

```auto
What exactly is the name of the missing file? - openocd-ftd2xx.bin? 

```

It is openocd-ftd2xx.exe try to type in at your command:

openocd-ftd2xx -h

Regards,

Michael

---

<div class="post-metadata">

**Author:** ![chrisbb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@chrisbb](https://community.sparkfun.com/u/chrisbb)\
**Post date:** [February 3, 2008, 9:49pm UTC](https://community.sparkfun.com/t/flash-programming-with-openocd-doesn-t-work/6373/5 "2008-02-03T21:49:29Z")

</div>

Hi michael,

your command works, if I type in openocd-ftd2xx -h, i get the version number and a summary of all the commands i can use (-h, -f, -d, -l).

But I still get “error 127” when I try to program my board…

chris

---

<div class="post-metadata">

**Author:** ![chrisbb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@chrisbb](https://community.sparkfun.com/u/chrisbb)\
**Post date:** [February 4, 2008, 3:37pm UTC](https://community.sparkfun.com/t/flash-programming-with-openocd-doesn-t-work/6373/6 "2008-02-04T15:37:25Z")

</div>

Hi Michael,

just to inform you that my problem is solved!

Instead of using the standard-makefile code lines, I encoded the OpenOCD-parameters directly, so the program rule section looks like this:

# program the AT91SAM7S256 internal flash memory

program: $(TARGET)

@echo “Flash Programming with OpenOCD…” #display a message on the console

C:\Programme\openocd-r247\bin\openocd-ftd2xx.exe -f C:\Programme\openocd-r247\bin\at91sam7s256-armusbocd-flash-program.cfg

# $(OPENOCD) -f $(OPENOCD\_CFG) # program the onchip FLASH here

@echo “Flash Programming Finished.” # display a message on the console

With this change flashing of uC worked perfectly.

If I have time, I will check again where the difference between the original code line and my code line is, but that’s only low priority

Once again, thanks for your suggestions,

chris
