cancel
Showing results for 
Search instead for 
Did you mean: 

Cube IDE 1.17.0 Windows 11 cannot launch openocd

sdtbb
Associate II

Fresh installation of CubeIDE 1.17.0 on Windows 11.

Attempting to program U585 IoT kit following instructions here: 

https://community.st.com/t5/stm32-mcus/getting-started-with-stm32u5-iot-discovery-kit-and-aws/ta-p/49682

The project builds (with some warnings), but when I attempt to flash with run->run it immediately bails with the error:

Failed to start GDB server
Error launching GDB server. Session terminated
Cannot run program ""${stm32cubeide_openocd_path}\openocd"": Code 0x10b: The directory name is invalid.

This appears to be the default path in the run configuration (and the debug configuration) - problem is I have no idea of the value of the env var stm32cubeide_openocd_path - and whether it does contain a bad path.

I had expected this would "just work" - would be very grateful for any pointers.  Hopefully it's something straightforward. Thanks.

7 REPLIES 7
sdtbb
Associate II

I should add I'm able to connect and flash the board (U585 IoT kit) with STMCubeProgrammer V 2.18, using the ST Link on the dev kit - confirming that there is no hardware issue.

sdtbb
Associate II

I was able to get CubeIDE working by manually entering the full path to openocd installed during the CubeIDE installation:

C:\ST\STM32CubeIDE_1.17.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.openocd.win32_2.4.0.202409170845\tools\bin\openocd.exe

This is great - but seems kind of a hack. I'll see if there's a way to view / update the env var stm32cubeide_openocd_path

What if you just remove the quotes from the path? The double quotes in the error message makes me wonder.

If you feel a post has answered your question, please click "Accept as Solution".
sdtbb
Associate II

Thanks for the suggestion - I tried removing the quotes and I get the same error (with one less set of quotes in the error message):

Error launching GDB server. Session terminated
Cannot run program "${stm32cubeide_openocd_path}\openocd": Code 0x10b: The directory name is invalid.

when you click to show the "Show Command Line" button  what does it resolve to?

STM_Thirty2_0-1736462090357.png

 

If you feel a post has answered your question, please click "Accept as Solution"

When I click on "Show Command Line" I get this:

${stm32cubeide_openocd_path}\openocd.exe "-f" "b_u585i_iot02a_ntz_debug.cfg" "-s" "C:/iot-reference-stm32u5/Projects/b_u585i_iot02a_ntz" "-s" "C:/ST/STM32CubeIDE_1.17.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.debug.openocd_2.3.0.202411041438/resources/openocd/st_scripts" "-s" "C:/ST/STM32CubeIDE_1.17.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mpu.debug.openocd_2.2.0.202409171044/resources/openocd/st_scripts" "-c" "gdb_report_data_abort enable" "-c" "gdb_port 3333" "-c" "tcl_port 6666" "-c" "telnet_port 4444"

 Unfortunately it doesn't resolve the path variable - as you can see.

One way you can check what the actual env variable resolves to by adding a post build command.

Right click on your project and select: Properties->C/C++ Build->Settings

STM_Thirty2_0-1736547743955.png

STM_Thirty2_1-1736547760567.png

 

If you feel a post has answered your question, please click "Accept as Solution"