cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with GDB Server

Moritz1
Associate III

I am using STM32CubeIDE V1.11.0

I have exactly the same issue which was described in this post:

https://community.st.com/t5/stm32-mcus-boards-and-hardware/st-link-gdb-server-issues/m-p/64010#M623

Multiple weeks everything works fine. But suddenly it stops working and i always get this error message when I try to Debug my code in CubeIDE:

Failed to bind to port 61235, error code -1: No error
Failure starting SWV server on TCP port: 61235
Failed to bind to port 61234, error code -1: No error
Failure starting GDB server: TCP port 61234 not available.
Shutting down...
Exit.

 I tried multiple things:

  • Shuting down PC completely (and disconnect from power supply) and booting again multiple times - it didn't change anything
  • I changed the Port in the Settings to 61238 - same error message, but with the 61238 port number
  • I changed the ST-Link Device - same error message
  • I connected the ST-Link to an other board with an other controller (and selected the appropriate project in cube) but get the same error - so this error seems to be independent of the selected project and Microcontroller.
  • I tryed to connect to the target with STM32CubeProgrammer. This works. I can read out the Flash and I did a full chip erase. Than I changed back to the CubeIDE and tryed again to download and debug - but I get the same error message again.

I enabled the "log file" option in the debugger settings. This file says:

COM frequency = 4000 kHz
Target connection mode: Attach
Reading ROM table for AP 0 @0xe00fefd0
Hardware watchpoint supported by the target
ST-LINK Firmware version : V2J40S7
Device ID: 0x450
PC: 0x79fb70
ST-LINK device status: LOCKUP
Enter STM32_SystemReset() function
ST-LINK detects target voltage = 3.24 V
Device in lock up state, possibly "read and debug" protected. Use monitor commands to remove the protection
ST-LINK device initialization OK
Stm32Device, pollAndNotify running...
ST-LINK device status: HALT_MODE
Failed to bind to port 61235, error code -1: No error
Failure starting SWV server on TCP port: 61235
Failed to bind to port 61234, error code -1: No error
Failure starting GDB server: TCP port 61234 not available.
GdbSrv, deInit entry.
Shutting down...
GdbSessionManager, deInit entry.
GdbSessionManager, deInit exit
SwvSrv deInit entry
SwvSrv deInit exit
Stm32Device, closeDevice() entry
Stm32Device, pollAndNotify stopped
Stm32Device, closeDevice() exit
Stm32Device, deInit success
GdbSrv, deInit exit.
Exit.

What does it mean with "Device in lock up state"? There are no lock fuses set in the target. And the CubeProgrammer can read and write the target without any problems.

I am completly stucked with this problem. And everything I read in the Internet about this error does not helped. Maybe some one here can help me?

 

1 ACCEPTED SOLUTION

Accepted Solutions

I think, i would not try to play around with this sick...

Update or better : install new version of IDE , should work with the new. (you can have more > 1 IDE same time).

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

View solution in original post

12 REPLIES 12
Rim LANDOLSI
ST Employee

Hello @Moritz1 and welcome to the community,

 

Can you provide the used board?

 

Thanks,

Rim

Its a very complex self made board - i cant provide you the complete Schematic/Design.

But it worked multiple weeks with this board without any problem.

And as I told: I also tryed out other Controllers on other boards (which previously worked). With all of them I have exactly the same issue. I also tryed it on an original NUCLEO-H743 with the integrated ST-LINK - still the same error.

The second point is: If I use the CubeProgrammer I can read and write the Controller on my board without any problems.

So I do not think that the issue has something to do with the board.

AScha.3
Chief III

You could try switching to other debug : in configurations.. -> openOCD

AScha3_0-1702987745730.png

+ set in generator options : software reset , or try "under reset" :

AScha3_1-1702987902757.png

 

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

Thanks for your answer.

With openOCD everything works fine.

Rim LANDOLSI
ST Employee

Hello,

The issue does not exist for Nucleo-H743ZI with a combination of following software versions:

  • STLINK-V3 firmware V3J13M4
  • STLINK-gdbserver Version 7.5.0

Try the ST-Link upgrade . Otherwise, it would be better to re-install ST-LINK server software.

 

Thanks,

Rim

Rim LANDOLSI
ST Employee

Hello,

Could you also provide the settings for the debug configuration?

Moritz1
Associate III

Which settings you mean exactly? How can I provide them?

Hello, 

I mean the Debug configuration as shown in the screenshot:

RimLANDOLSI_0-1703513265543.png

 

Moritz1
Associate III

This is my setting (it should be default, I havent changed anything here):

Moritz1_0-1703856983907.png