-1

I installed the ST-Link GDB server from the ST webpage (link)

ST created "ST-Link Server" (link) which bridges the architecture gap and enables us to comfortably monitor and debug the "running binary" (arm architecture) on our workstation PC (x86 or x86_64 architercture) using the "GDB" debugger.

To install the "ST-Link Server" I first download it's .zip file that I can get on the bottom of the page that i linked in the previous paragraph:

enter image description here

Then I uncompress it and run the .msi file that can be found in the compressed file structure. Note that installation wizard will install a command line tool stlinkserver.exe inside the folder:

/mnt/c/Program\ Files\ \(x86\)/STMicroelectronics/stlink_server/

So I move inside and prompt for help:

ziga@EN3310278:~$ cd /mnt/c/Program\ Files\ \(x86\)/STMicroelectronics/stlink_server/
ziga@EN3310278:stlink_server$ ./stlinkserver.exe --help
stlink-server
--help       | -h       display this help
--version    | -v       display STLinkserver version
--port       | -p       set tcp listening port
--debug      | -d       set debug level <0-5> (incremental, 0: Error, 1:Info, 2:Warning, 3:STlink, 4:Debug, 5:Usb)
--auto-exit  | -a       exit() when there is no more client
--log_output | -l       redirect log output to file <name>

There are very little parameters listed! Weird... Also useless... This seemed weird to me so I investigated further.

"ST-Link Server" has a nice documentation "UM2576" (link). But in the documentation there are more parameters listed than stlinkserver.exe returns to us.

At this point I was so confused that I tried executing one parameter i.e. -g listed in the "UM2576" and application really failed to recognize the parameter:

ziga@EN3310278:stlink_server$ ./stlinkserver.exe -g
stlinkserver.exe: unknown option -- g
Info : default port : 7184
Info : 127.0.0.1:7184
Info : ctrl_handler 0
Ctrl-C event

What is going on with ST? Why doesn't the "ST-Link GDB server" work? How do you use it? I am really confused... And most importantly... I can not connect to my board?

Should I just throw in the towel and use J-Link or OpenOCD???

Tom V
  • 4,827
  • 2
  • 5
  • 22
71GA
  • 1,132
  • 6
  • 36
  • 69
  • 1
    Are you aware that you need to start the *GDB server* and then start *gdb* (which is separate), load the binary file and connect to the GDB server? Are you using an IDE (which usually makes this far more comfortable)? – Codo Apr 20 '22 at 09:35
  • @Codo I understand how this is done usually. Up until now I used J-Link probes and there I just started their GDB server which gave me a port, and then I connected to the port with GDB. – 71GA Apr 20 '22 at 09:52
  • 1
    I have edited the title of your question to not be insulting, since this is a simple case of user error (albeit caused by unfortunately similar naming of two different tools). – Tom V Apr 20 '22 at 10:16

1 Answers1

1

ST-link server and ST-link GDB server are two different pieces of software.

ST-link server is a tool for sharing a debug adaptor between multiple programs, for example an IDE debugger and command-line programmer. It owns the USB connection and other programs connect to it over sockets.

ST-link GDB server is the server portion of the GNU debugger, configured to use an ST-link adaptor.

If you read the documentation for one and install the other I would expect the arguments not to match up!

Tom V
  • 4,827
  • 2
  • 5
  • 22
  • I can find *"ST-Link server"* [here](https://www.st.com/en/development-tools/st-link-server.html), but I can not find *"ST-Link GDB server"* anywhere. Where is it? – 71GA Apr 20 '22 at 09:47
  • Part of CubeIDE package. – Tom V Apr 20 '22 at 10:09
  • I suppose there is no standalone *"ST-Link GDB server"* package available? – 71GA Apr 20 '22 at 11:05
  • note that Documentation *"UM2576"* (link) is targeted for *"ST-Link GDB server"* but it is published on the website for *"ST-Link Server"*. This is extremely deceiving. Well not to say that ST's documentation often lacks precise information... Also check the 1st image in the *"UM2576"*... There is no evidence that *"ST-Link server"* even exists... Only *"ST-Link GDB server"* is mentioned... But! They mention *"GDB client"*... – 71GA Apr 20 '22 at 11:22
  • 1
    There is no need to get aggressive just because you made a simple mistake. I had the same misunderstanding myself a few years ago, it lasted a couple of minutes. Fortunately for you, the problem has been explained to you very quickly and simply, and for free on stackoverflow! If you want to suggest updates to the documentation then contact your FAE or sales rep. They can also arrange free training on this sort of thing if you promise to buy enough parts. – Tom V Apr 20 '22 at 17:00