cancel
Showing results for 
Search instead for 
Did you mean: 

Why can STN32CubeIDE not find the ST-Link but STM32CubeProgrammer can?

David Annett
Associate III

I am trying to debug some proof of concept code on a STM32F746 Discovery but STM32CubeIDE throws a "No ST-LINK detected" error. However the STM32CubeProgrammer can access it fine after the firmware on the ST-Link part of the board was updated.

I have also tried using stlink-server. Again STM32CubeProgrammer works fine but STM32CubeIDE then shows a "Failed to start GDB server" error and at the same time stlink-server shows:

Info : STLINKV2-1 v2J40M27, PID 0x374B

Error: ERROR: recv failed. error = 104

I'm running out of ideas and most stuff I am finding about issues seem to be to do with Windows drivers whereas I am running Linux Mint.

3 REPLIES 3
Semer CHERNI
ST Employee

Hello @David Annett​ 

First le me thank you for having reported.

To be able of analyzing the issue I will need a verbose log of the GDB server.

To get this log lunch the ST-LINK_gdbserver from the command lines in the repertory where it is installed.

In my case under "ST\STM32CubeIDE_1.10.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.win32_2.0.300.202203231527\tools\bin"

Also you can check the "config.txt" to have an idea about how to lunch the tool.

I will be waiting for the log to be able to continue the analysis.

Kind regards,

Semer.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

David Annett
Associate III

Hi, thanks for that. I spent a lot of time trying to figure this out before asking so I am at a loss as to why I have never come across mention of ST-LINK_gdbserver. I have stlink-server on path so had naturally assumed that was the program to share it.

Armed with the info you have given I went digging. Someone at ST is a Douglas Adams' "Beware the Leopard" fan as I found it 6 levels deep in a hidden folder:

~/.eclipse/com.st.stm32cube.ide.mcu.rcp.product_1.4.0_941520327_linux_gtk_x86_64/plugins/com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.linux64_1.6.0.202101291314/tools/bin

I modified the last line of the config.txt file to be:

-cp /home/david/bin/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin

However it throws an error:

david@kobo:~/.eclipse/com.st.stm32cube.ide.mcu.rcp.product_1.4.0_941520327_linux_gtk_x86_64/plugins/com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.linux64_1.6.0.202101291314/tools/bin$ ./ST-LINK_gdbserver

ERROR: Couldn't locate STM32CubeProgrammer in '../STM32CubeProgrammer/bin/', use -cp <path>

That directory contains:

david@kobo:~/.eclipse/com.st.stm32cube.ide.mcu.rcp.product_1.4.0_941520327_linux_gtk_x86_64/plugins/com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.linux64_1.6.0.202101291314/tools/bin$ ls -lh /home/david/bin/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin

total 17M

drwxrwxrwx 6 david david 4.0K Feb 8 2021 ExternalLoader

-rwxrwxrwx 1 david david 280 Aug 25 21:36 FirmwareUpdate

drwxrwxrwx 2 david david 4.0K Feb 8 2021 FlashLoader

-rw-rw-rw- 1 david david 138K Aug 5 2021 hs_err_pid31594.log

-rw-rw-rw- 1 david david 144K Mar 17 2021 hs_err_pid3457367.log

drwxrwxrwx 3 david david 4.0K Feb 8 2021 HSM

drwxr-xr-x 4 david david 4.0K Feb 8 2021 jre

-rw-rw-rw- 1 david david 2.6M Jul 22 2020 libcrypto.so

-rw-rw-rw- 1 david david 537K Jul 22 2020 libssl.so

-rw-rw-rw- 1 david david 374K Sep 12 2019 libstp11_SAM.so

-rw-rw-rw- 1 david david 366 Feb 8 2021 libstp11_SAM.so.conf

drwxrwxrwx 5 david david 4.0K Feb 8 2021 RSSe

-rwxrwxrwx 1 david david 171 Aug 14 2020 STM32CubeProgrammer

-rwxrwxrwx 1 david david 8.9M Nov 18 2020 STM32CubeProgrammerLauncher

-rwxrwxrwx 1 david david 940K Jul 22 2020 STM32MP_KeyGen_CLI

-rwxrwxrwx 1 david david 967K Jul 22 2020 STM32MP_SigningTool_CLI

-rwxrwxrwx 1 david david 2.1M Nov 18 2020 STM32_Programmer_CLI

-rwxrwxrwx 1 david david 147 Apr 18 2018 STM32_Programmer.sh

drwxrwxrwx 2 david david 4.0K Feb 8 2021 STM32WLScripts

-rw-rw-rw- 1 david david   5 Nov 16 2020 version

What should I try next?

David Annett
Associate III

An update:

It is working now. It was ST-LINK_gdbserver.sh I should have been running. It was basically that one last step of actually using the config.txt file I had missed.