cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to bind to port 61234

Andrew Neil
Super User

So I'd been merrily using STM32CubeIDE all morning, doing the usual code-download-debug cycle with no problems at all.

Then, after some code updates & successful build, it suddenly can't reach the GDB server:

 

STMicroelectronics ST-LINK GDB server. Version 7.4.0
Copyright (c) 2023, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
InitWhile : Enabled

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

 

Several people seem to have had this recently; eg,

https://community.st.com/t5/stm32cubeide-mcus/cubeide-1-18-cannot-detect-st-link-anymore/m-p/784313?search-action-id=49992011530&search-result-uid=784313

https://community.st.com/t5/stm32cubeide-mcus/st-link-error-failed-to-bind-to-port-61235-failure-starting-swv/m-p/784642?search-action-id=49992011530&search-result-uid=784642

 

So why should this change when nothing has been updated - I'm just working in the IDE as usual ?!

 

This is CubeIDE v1.13.0 - so old, yes - but surely no reason for it to just give up in the middle of a session?

On Windows-11 - no updates have happened.

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
11 REPLIES 11

I ran into this issue way to often by now and for me at least this gave me the best hint why the debug session failed. Now I need to find out who reserved a certain Port range and why it does not happen sometimes.


@MWiel.1 wrote:

 I need to find out who reserved a certain Port range and why it does not happen sometimes.


maybe it's nothing to do with Port reservations?

See the possible explanation in the marked solution - which, I think, fits better with "happen sometimes" ... ?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.