4

I got some problems getting OpenOCD to communicate with my STM32F100RB Discovery board (it uses ST-Link).

I am not used to working with open source tools, and therefore I've never had problems programming and debugging my embedded platforms. In the past week I've had more problems than I had ever imagined, just trying to get an IDE + FreeRTOS + Debugging up and running.

I have now decided to use Eclipse + Sourcery G++ Lite + OpenOCD for my embedded application. I have a little application compiled (good start...) and are now trying to program and debug using OpenOCD. When I am doing that I get the following error:

Open On-Chip Debugger 0.7.0-rc2 (2013-04-28-12:55)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Error: Debug adapter doesn't support any transports?
Runtime Error: embedded:startup.tcl:20: 
in procedure 'script' 
at file "embedded:startup.tcl", line 58
at file "stm32f1x_stlink.cfg", line 17
in procedure 'transport' called at file "C:/openocd-0.7.0-            rc2/bin/../scripts/target/stm32_stlink.cfg", line 53
in procedure 'ocd_bouncer' 
at file "embedded:startup.tcl", line 20

I have no idea where to start, please help. Also: if anyone has a better opensource/free IDE for STM32 which "supports" FreeRTOS (i.e. for which a demo/template is available), I'll be very happy to hear about it :)

Edit:

Ok, I think that I used the wrong config-file in the first try. Now I am getting this instead:

C:\OpenOCD\openocd-0.7.0-rc2\bin>openocd-0.7.0-rc2.exe -f stlink-v2.cfg
Open On-Chip Debugger 0.7.0-rc2 (2013-04-28-12:55)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : This adapter doesn't support configurable speed
Error: session's transport is not selected.
Error: allow transport 'hla_swd'
Error: allow transport 'hla_jtag'
Error: allow transport 'stlink_swim'
in procedure 'transport'
in procedure 'init'
Nate W.
  • 9,141
  • 6
  • 43
  • 65
Jolle
  • 1,336
  • 5
  • 24
  • 36
  • 1
    "I am not used to working with open source tools, and therefore i've never had problems programming and debugging my embedded platforms." It sounds like a huge troll ;-) – Étienne Apr 30 '13 at 19:25
  • Why? :) .. I have always worked with tools coming from some vendor (either free or licenced), and mostly they are working fine without advanced configurations etc. – Jolle May 01 '13 at 07:19

4 Answers4

2

Why don't you just use the available board configuration? scripts/board/stm32vldiscovery.cfg This is for exactly your board. This way you won't need to specify interface and chip, just the board:

openocd-0.7.0-rc2.exe -f board/stm32vldiscovery.cfg
Freddie Chopin
  • 8,440
  • 2
  • 28
  • 58
0

To answer your second question, you didn't provide the configuration file for your board ( STM32F100RB Discovery), openocd only knows about your adapter (ST-Link), therefore the error message.

Étienne
  • 4,773
  • 2
  • 33
  • 58
0

You need to also reference the stm32f1x.cfg file:

openocd-0.7.0-rc2.exe -f stlink-v2.cfg -f stm32f1x.cfg
amo
  • 4,082
  • 5
  • 28
  • 42
  • Now i am getting a new error: "Invalid command name "jtag_ntrst_delay"? – Jolle May 02 '13 at 15:30
  • Did you enter the line exactly as I typed above? You can get that jtag_ntrst_delay error if you put the stm32f1x file before the stlink-v2 file. – amo May 02 '13 at 19:30
  • 1
    Shouldn't the target config file be `stm32f1x_stlink.cfg`? I could not find any doc, but from the description `# STM32f1x stlink pseudo target` it seems this is the target config file used by OpenOCD with a ST link. – Étienne May 29 '13 at 21:17
0

I encounter the same issue. When i try this command:

openocd-x64-0.8.0 -f interface\stlink-v2.cfg -f target\stm32f1x.cfg

I get the following:

c:\>openocd-x64-0.8.0 -f interface\stlink-v2.cfg -f target\stm32f1x.cfg
Open On-Chip Debugger 0.8.0 (2014-04-28-08:42)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
Error: session's transport is not selected.
Runtime Error: embedded:startup.tcl:20:
in procedure 'script'
at file "embedded:startup.tcl", line 58
in procedure 'swj_newdap' called at file "C:/openocd-0.8.0//scripts/target\stm32f1x.cfg", line 37
in procedure 'transport' called at file "C:/openocd-0.8.0//scripts/target/swj-dp.tcl", line 26
in procedure 'ocd_bouncer'
at file "embedded:startup.tcl", line 20

EDIT:

Nevermind, I found it... my stlink is a V2 version, so I tried with the V2 config and stm32f1x_stlink.cfg. No it started without a glitch. Next step is to connect with GDB and Eclipse.

Cheers!

Alex

Alexper
  • 143
  • 2
  • 8