cancel
Showing results for 
Search instead for 
Did you mean: 

openOCD by STM

ADEVL.1
Associate II

Hello,

Is there a version of openOCD compiled by STM which contains all the latest cards (notably the NUCLEO-G071RB) and is it possible to obtain the command generated by STM32CubeIDE configured with openOCD.

Because I would like to use another IDE (CLION) and I have relative difficulty in configuring openOCD.

Thank you.

Alexis

17 REPLIES 17
KnarfB
Principal III

openocd is installed as a plugin during STM32CubeIDE install. You could use that.

When I select openOCD in STM32CubeIde for debugging, the Windows Task-Manager tells the command line:

C:\ST\STM32CubeIDE_1.1.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.openocd.win32_1.1.0.201910081157\tools\bin\openocd.exe -f "Hello_STM32L432_NUCLEO Debug.cfg" -s C:/Users/live/STM32CubeIDE/workspace/Hello_STM32L432_NUCLEO -s C:/ST/STM32CubeIDE_1.1.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.debug_1.1.0.201910101207/resources/openocd/st_scripts -c "gdb_port 3333" -c "tcl_port 6666" -c "telnet_port 4444"

hth

KnarfB

ADEVL.1
Associate II

The command will allow me to advance a little more however I work on linux and I do not know if I can use the plugin.

Thank you so much.

There is no downloadable version of openOCD ?

Andreas Bolsch
Lead II

I'm afraid you'll have to pick the relevant patches from http://openocd.zylin.com/#/q/status:open and (re-) build openocd for your platform.

E.g. for G0-series http://openocd.zylin.com/#/c/4807/.

I modified the command you give me, it seems to work,

/opt/st/stm32cubeide_1.1.0/plugins/com.st.stm32cube.ide.mcu.externaltools.openocd.linux64_1.1.0.201910081157/tools/bin/openocd -f /home/alexis/Documents/test/test/st_nucleo_g0.cfg -s /home/alexis/Documents/test/test/ -s /opt/st/stm32cubeide_1.1.0/plugins/com.st.stm32cube.ide.mcu.debug_1.1.0.201910101207/resources/openocd/st_scripts -c "gdb_port 3333" -c "tcl_port 6666" -c "telnet_port 4444"

but I'm not sure that it downloads my program.

Same under Linux, but use ps aux | grep ocd :

/opt/st/stm32cubeide_1.1.0/plugins/com.st.stm32cube.ide.mcu.externaltools.openocd.linux64_1.1.0.201910081157/tools/bin/openocd -f Hello_L432 Debug.cfg -s /home/frank/STM32CubeIDE/workspace_1.1.0/Hello_L432 -s /opt/st/stm32cubeide_1.1.0/plugins/com.st.stm32cube.ide.mcu.debug_1.1.0.201910101207/resources/openocd/st_scripts -c gdb_port 3333 -c tcl_port 6666 -c telnet_port 4444

ADEVL.1
Associate II

I tried with another source but it doesn't seem to work, I'm going to try again, Thx

I tried with another source but it doesn't seem to work, I'm going to try again, Thx

ADEVL.1
Associate II

ok it works using the plugin integrated in STM32CubeIDE and configure where is the library and projet generate by STM32CubeMX

/opt/st/stm32cubeide_1.1.0/plugins/com.st.stm32cube.ide.mcu.externaltools.openocd.linux64_1.1.0.201910081157/tools/bin/openocd \
-f /home/$USER/Documents/test/test/st_nucleo_g0.cfg \
-s /home/$USER/Documents/test/test/ \
-s /opt/st/stm32cubeide_1.1.0/plugins/com.st.stm32cube.ide.mcu.debug_1.1.0.201910101207/resources/openocd/st_scripts \
-c "gdb_port 3333" -c "tcl_port 6666" -c "telnet_port 4444" \
-c "program \"/home/$USER/Documents/test/test/cmake-build-debug/test.elf\"" \
-c reset

Uwe Bonnes
Principal II

BMP (Bl*ck M*g*c Debug probe) https://github.com/blacksphere/bl*ckmagic can be an alternative. Compiled via "make PROBE_HOST=pc-stlinkv2" you can run on an unmodified Stlinkv2 with recent firmware. You either start the resulting executable and connect to port :2000 to debug or you can do some flash modifications on the command line. E.g. "bl*ckm*g*ic_stlinkv2 bla.bin" loads the binary to 0x08000000". Look with -h for more options.