Olimex STM32-H103 + Olimex ARM-USB-TINY + openOCD + Eclipse

Dear friends,

this is the 3rd day of me sleeping 2 hours a day while trying tu put following configuration to work.

I am at the end of my strength and ideas and I need help.

OS: Windows Vista/ Windows XP

Board: Olimex STM32-H103 (Cortex M3 chip on it)

JTAG: Olimex ARM-USB-TINY + openOCD

IDE: Eclipse

So, after getting all this from Olimex I installed their “for Dummies” packet, containing Eclipse (with all what is needed for ARM), openOCD…

I followed the instructions to load the demo I found on their CD, and others that I have found on their internet site, but it doesn’t work.

First, the demo project doesnt compile (“Build Project”), it says it can not find some files.

Then, when starting the JTAG through Run → External Tools… the JTAG doesn’t work.

In the demo project that should be for STM32-H103 board there is lpc2xxx_armusbocd.cfg config file, and I’m not sure if that is for this board.

I have red and tried every advice that I have found on this forum, and it still doesn’t work.

I have modified config file adding “…TINY A”, “…TINY B”, replacing “jtag” with “olimex-jtag”. Some have adviced to change .INF driver files before installing it to be sure that the names are the sam in .cfg and .INF… have done all that but didn’t help.

Usually it would immediately return some error message.

And the best what I have done so far is to make it to “do” something for about 10sec (but I’m not sure if it is doing anything, but at least doesn’t return error message immediateyly) and then returns message that the specified numbers of data could not be red from ft2232, something like (0 < 81).

The red led on Olimex ARM-USB-TINY is turned on all the time.

So, if anybody has this board and arm-usb-tiny and it works on openOCD please tell me how you did it (what you config file look like, what you .INF files look like, and how could I compile demo examples from Olimes site. For example in my demo project there is no .hex file - how could I run demo without that!?)

I have tried all this on two different OS’s (Vista and XP), and on two different computers (laptop, and desktop) and it’s the same on both.

When installing drivers on Vista it asks only two times to install drivers, and on XP it asks three times, howewer both on Vista and XP there are three Olimex devices after installation.

Thanks and best regards,

omnix

Hallo again!

There has been some improvments since my last message but there are still some obstacles hard to get over.

I hope that someone will have a solution for this.

I have managed to compile the project without mistakes by using “cortexm3_macro.h” file that has inline asembler definitions and that I found on st-forum. The project is a ST Led_Blinking example (blink leds on pins 6, 7, 8 and 9 of port C).

Now it comes to loading it into the device.

I am using openOCD 1.0 (dated to 19 June 2008) and this are the configuration files:

oocdtiny.cfg

#daemon configuration

telnet_port 4444

gdb_port 3333

gdb_memory_map enable

gdb_flash_program enable

#interface

interface ft2232

ft2232_device_desc “Olimex OpenOCD JTAG TINY A”

ft2232_vid_pid 0x15ba 0x0004

ft2232_layout olimex-jtag

jtag_khz 400

script for stm32

jtag_nsrst_delay 10

jtag_ntrst_delay 10

#use combined on interfaces or targets that can’t set TRST/SRST separately

reset_config trst_and_srst

#jtag scan chain

set _CPUTAPID 0x3ba00477

set _BSTAPID 0x16410041

set _CHIPNAME stm32

set _TARGETNAME [format “%s.cpu” $_CHIPNAME]

jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID

jtag newtap $_CHIPNAME bs -irlen 5 -ircapture 0x1 -irmask 0x1 -expected-id $_BSTAPID

target create $_TARGETNAME cortex_m3 -endian little -chain-position $_TARGETNAME

$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x20000000 -work-area-size 0x5000 -work-area-backup 0

flash bank stm32x 0x08000000 0x00010000 0 0 0

init

reset halt

debug.gdbinit

target remote localhost:3333

set remote memory-write-packet-size 1024

set remote memory-write-packet-size fixed

set remote memory-read-packet-size 1024

set remote memory-read-packet-size fixed

set remote hardware-breakpoint-limit 6

monitor wait_halt

monitor sleep 500

monitor poll

monitor stm32x mass_erase 0

monitor flash write_image build/LedBlink.bin 0x08000000 bin

monitor soft_reset_halt

symbol-file build/LedBlink.out

break main

I am also using stm_h103_blink_rom.cmd from Olimex.

All this files are provided in attachment to this post in case that it can help someone other to get even to this point (as it was for me).

When I do Run → External Tools → OpenOCD ARM-USB-TINY (the last is the name I gave to this configuration) I got following:

Open On-Chip Debugger 0.1.0 (2009-01-21-21:15) Release

BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS

$URL: https://kc8apf@svn.berlios.de/svnroot/r … /openocd.c $

400 kHz

Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)

Info : JTAG Tap/device matched

Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (Manufacturer: 0x020, Part: 0x6410, Version: 0x1)

Info : JTAG Tap/device matched

Warn : no tcl port specified, using default port 6666

Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)

Info : JTAG Tap/device matched

Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (Manufacturer: 0x020, Part: 0x6410, Version: 0x1)

Info : JTAG Tap/device matched

target state: halted

target halted due to debug-request, current mode: Thread

xPSR: 0x01000000 pc: 0x000000e4

It seems everything is all right up to here, and I see some changes in console messages when I press reset button on the development board, which shoud mean that some communication exists between board and PC (big improvment since last time!).

Now, I don’t see anything flashes (I have connected external diods to port C), and none of the debug-commands (Step Into, Step Over, Run to Line…) is active under Run menu.

I suppose I have to start Debug command first, but when I do that i got the following error message:

Lounching LedBlinkDebug has encountered a problem.

Error creating session"

and under "Details >>" for this messsage it says:

Error creating session

Process Terminated

Process Terminated

Process Terminated

In console window there aren’t any error messages and I don’t know what to do next.

It would be nice if I could use debugging in Eclipse, but I would also be satisfied if I could just load the program into the device and see the leds blinking.

Does anybody know what is wrong with this setup?

edit:

PS I don’t know how to upload other files here (I don’t see that option). If I don’t find it soon, I’ll just quote the text from files if somebody needs them.

Hello omnix,

i think your debug settings in the Eclipse are not proper.

Please try the following…

  1. Open “debug” perspective in Eclipse

  2. click the down arrow near the “debug button” (bug sysmbol) on the toolbar.

  3. Select “Debug Configurations”, The dialog box opens

  4. On the left side, check if “GDB Hardware Debugging” exists, and you have configuration below that.

  5. On the right side, you need to do certain settings. which are explained in detail on the FreeRTOS site. (I do not remember the link exactly)

I hope i am giving right pointers.

Regards.

Hello omnix,

Please follow this link, you may get the detailed info.

http://sites.google.com/a/stf12.net/dev … lipse-demo

Hemant, thanks for your post,

but it didn’t help.

I belive that something’s wrong with the cygwin.

Previous results were obtained with arm-elf-gdb.exe debuuger from the gnuarm packet, but I have switched to gdb.exe from cygwin and got the following error message:

Warning: /EclipseProjects/LedBlink/LedBlinkDebug/;C: No such file or directory

putpkt: wite failed: Software caused connection abort.

I have written only one warning above, but there are more and they all have this irregular path with the C: at the end, which should be at the beggining. It seams that cygwin has some problems reading windows paths. I have checked all settings concerning paths, but they are all ok.

I have no ideas any more. I have not find two people that have used same settings. No one can tell right from wrong. Olimex examples don’t work too. They can’t even compile because of numerous compiler errors!?

I’m already 3 weeks late with my project, and there’s no end to this misery. I now perfectly understend why are commercial tools worth of its price. If I have worked so hard on something else for previous 3 weeks as I have worked on this, I could earn enough money to buy excelent arm IDE together with “plug and enjoy” interface, and a new bike.

I’m going to try all this configuration now on another computer. Maybe it’ll work. I can’t think of anything else.

Thanks again.

I am having the same problems as you , brother.

I was able to get a cortex M3 project to compile and download

via Eclipse GCC GDB and ARM-USB-TINY, but now I am stuck

attempting to get a simple break point to work in a flash programmed

blink the LED “blinky” program. Does this $50 JTAG and open OCD

support normal debug of flash based full sized programs ??

See my other post of June 20.

Joe

To All,

Q: Does this $50 JTAG and open OCD

support normal debug of flash based full sized programs ??

A: It appears to be true !

(Well, my “blinky” probram is not full sized but it is a start.)

It turns out my big breakpoint problem was due to my using a

makedefs file that configured the gnu compiler to optimize for size.

Apparently the debugger needs to have no optimizations on to work properly. Well I think I will rember this solution for a while !

Debug and optimization flags

Originally: DEBUG=-g -Os

IT TURNS OUT -Os may mess up debug breakpts DEBUG=-g -Os

may also try -ggdb to see if it helps ### not done yet…

July 10, 2009

DEBUG=-g

This works - what a relief !!!

Now my Eclipse environment appears to be working ok too.

Best regards,

Joe :slight_smile:

Thanks JoeEE, I’ll have to try that with my ‘old’ settings that didn’t work.

In the meantime, I’ve got a new version of Olimex CD and I tried it yesterday. It works out of a box!

Flashing, debugging (Start, Stop, Pause, Step in, Step out…) all works without problems.

The Olimex setup uses Zylin plugin for Eclipse.

I’m not sure if one can find this CD online. At least I didn’t see that option at Olimex’s site.

I’m currently not at home, and my interrnet connection here is a bit to slow for upploading a few hunderts of megabytes from Olimex CD, but I’ll do that as soon as I get home if there’s no any other place where one can find it.

Best regards,

Omnix

What version of the Olimex CD did you get and how did you get it? The CD I got when I ordered the JTAG USB OCD (http://www.sparkfun.com/commerce/produc … ts_id=7834) had “Olimex-GCCFD-20081015.exe” on it which is revision 6.0 - G according to the revision.txt file also on the cd.