# Cannot launch GDB client

I am new to embedded coding outside of Arduino, so I need a lot of hand holding. I made a custom board with just a STM32 chip (STM32L082) and a LED. I am trying to debug it using GDB (I hear that's the next thing after using printf's) and I know that I can flash code on it successfully (used JFlash-Lite and can have it toggle LED at different frequencies).(on MacOS Catalina)

However, I am trying to use the JLinkGDBServer (and I've also tried STM32CubeIDE) and I am able to get to a point where it says: So then I go to my terminal window and enter the following commands:

\$ arm-none-eabi-gdb
...
(gdb) target remote localhost:2331
localhost:2331: cannot resolve name: nodename nor servname provided, or not known
localhost:2331: No such file or directory.


And that's where I get stuck. I noticed that the LED stops blinking when JLink says it is connected, so I guess the program is pausing properly. I get the same issue with STM32CubeIDE as well.

Is there some configuration setting I'm missing and/or file I'm supposed to be putting somewhere? What should I try next to debug?

• Try replacing localhost with 127.0.0.1 – Eugene Sh. Jan 21 at 22:15
• woah! that worked. thanks so much. So why does localhost not work? Is localhost something that I need to define somewhere in config files? – lemonlime Jan 21 at 22:21
• No idea TBH. Especially on MAC which you seem to be using. On Linux I think it is in the hosts file – Eugene Sh. Jan 21 at 22:22