0
\$\begingroup\$

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: segger jlink gdb server v6.62 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.

STM32CubeIDE

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?

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.