STM32-103STK + ARM-USB-TINY cannot get started

I today received my first Olimex products and despite very carefully following the instructions (with minor adjustments where they do not match the software on the CD) have not been successful in getting them to work. There’s probably something obvious wrong, but I am not at all familiar with the toolchain. Here are the details:

Hardware: STM32-103STK Starter Kit for Cortex M3 and ARM-USB-TINY

I followed the instructions in the HOW_TO_INSTALL.txt – see detailed notes below – but they fail near the end with unable to find the project directory (and hence main.out). Any idea what could be the problem? The notes below were on Windows 7, by I have also tried XP and the default installation directory, with identical results.

Mike Cowlishaw, UK


Following HOW TO INSTALL.txt:

Installed software from CD using wizard, to c:\olimex; wizard warned 3 drivers to install

Connected plain USB for power, then ARM-USB-TINY to JTAG.

Initally failed to install driver (not unexpected … is on CD)

→ device manager, right click on Olimex OpenOCD device → update driver → browse for driver → c:\olimex\ARM-USB-OCD-DRIVER [Security prompt: Install anyway]

→ device manager, repeat for other Olimex device [no security prompt]

→ device manager, repeat for ARM serial port that appeared (became COM6) [Security prompt: Install anyway]

Start Eclipse (Ganymede); shows a list of projects, chose: stm32f103-stk, expanded, double-clicked main.c.

Got ‘resource is out of sync with the file system’ (possibly expected); did Project→Build All as stated – plausible output – make OK; main.c now shown

Window→Show View→Other…→Debug→OK (window in bottom pane now activated)

Click on main.c pane to activate

Run→External Tools→Open OCD Tiny [Security prompt: allow on private network ]; various ‘JTAG device found’ messages

Run→Debug Configurations…→zylin Embedded debug (Cygwin); click on project (stm32f103-stk Debug), then Debug button. Console shows:

Warning: /cygdrive/C/olimex/projects/stm32f103-stk: No such file or directory.

No source file named main.out.

No source file named main.out.

No source file named main.out.

No source file named main.out.

No source file named main.out.

No source file named main.out.

No source file named main.out.

No source file named main.out.

No source file named main.out.

No source file named main.out.

No source file named main.out.

No source file named main.out.

No source file named main.out.

No source file named main.out.

No source file named main.out.

No source file named main.out.

No source file named main.out.

No source file named main.out.

No source file named main.out.

No registers.

target remote localhost:3333

0x08000120 in ?? ()

monitor soft_reset_halt

requesting target halt and executing a soft reset

monitor flash erase_sector 0 0 3

erased sectors 0 through 3 on flash bank 0 in 0.118007s

monitor flash write_image main.bin 0x0

No flash at address 0x00000000

wrote 0 byte from file main.bin in 0.005001s (0.000000 kb/s)

1breakpointkeepy 0x00000014in main at main.c:43

Breakpoint 1 at 0x14: file main.c, line 43.

break main

cont

Program received signal 0, Signal 0.

0xfffffffe in ?? ()

Finally got a reply from Olimex – in short, the debug commands pre-loaded in Eclipse are unsuitable for the STK. Here are my revised notes including the replacement of the commands.

Connect just USB; confirmed jumper position matches EXT/BAT (i.e., jumper nearer GND pin for EXT). No preloaded test app.

Following HOW TO INSTALL.txt, modified to match actual Eclipse on the CD and to use new commands etc. from Olimex:

Installed software from CD using wizard, to c:\gccfd; wizard warned of 3 drivers to install

Connected plain USB for power, then ARM-USB-TINY to JTAG.

Initally failed to install driver (not unexpected … is on CD)

→ device manager, right click on Olimex OpenOCD device → update driver → browse for driver → c:\olimex\ARM-USB-OCD-DRIVER [Security prompt: Install anyway]

→ device manager, repeat for other Olimex device [no security prompt]

→ device manager, repeat for ARM serial port that appeared (became COM6) [Security prompt: Install anyway]

Start Eclipse (Ganymede); shows a list of projects, choose: stm32f103-stk, right-click→Open Project to expand, double-click main.c.

Got ‘resource is out of sync with the file system’ (possibly expected); did Project→Build All as stated – plausible GCC console output; main.c now shown.

Window→Show View→Other…→Debug→OK (window in bottom pane now activated).

Run→Debug Configurations…→zylin Embedded debug (Cygwin); click on project (stm32f103-stk Debug)

Click on commands tab, replace ‘Run’ commands shown with:

target remote localhost:3333

monitor soft_reset_halt

monitor sleep 500

monitor flash erase_sector 0 0 31

monitor flash write_image main.bin 0x08000000

monitor reset

monitor sleep 500

monitor soft_reset_halt

thbreak main

continue

Run→Remove All Breakpoints (one is set by the above commands)

Click on main.c pane to activate

Run→External Tools→Open OCD Tiny [Security prompt: allow on private network ]; various ‘JTAG device found’ messages

Run→Debug Configurations…→zylin Embedded debug (Cygwin); click on project (stm32f103-stk Debug), then Debug button.

Console should show commands being activated and downloading, and then halt at start of main.c; main.c window updated to show first line of code.

Run→Resume to continue running the program.

Have you checked the stm32 forums?

https://my.st.com/public/STe2ecommuniti … Items.aspx

Or the best arm7 support pages evah?

http://www.siwawi.arubi.uni-kl.de/avr_p … index.html

Poke around that site a while and you will eventually find what you need.

Personally I dislike Eclipse a great deal, I rather use ProgrammersNotepad2/CrimsonEditor or CodeBlocks.

Sorry I wasn’t clearer … with the revised commands it works as expected.

Mike