cancel
Showing results for 
Search instead for 
Did you mean: 

gdbgui and STLink debug

Dat Tran
Senior II

From instructions, I opened two console:

Console 1: openocd -f board/stm32mp15x_dk2.cfg

This looks good as output:

 

```

...

Info : stm32mp15x.cm4: Cortex-M4 r0p1 processor detected

Info : stm32mp15x.cm4: target has 6 breakpoints, 4 watchpoints

Info : stm32mp15x.cpu0: hardware has 6 breakpoints, 4 watchpoints

Info : stm32mp15x.cpu0 rev 5, partnum c07, arch f, variant 0, implementor 41

Info : stm32mp15x.cpu0: MPIDR level2 0, cluster 0, core 0, multi core, no SMT

Info : stm32mp15x.cm4: external reset detected

Info : stm32mp15x.cpu1: hardware has 6 breakpoints, 4 watchpoints

Info : stm32mp15x.cpu1 rev 5, partnum c07, arch f, variant 0, implementor 41

Info : stm32mp15x.cpu1: MPIDR level2 0, cluster 0, core 1, multi core, no SMT

Info : gdb port disabled

Info : gdb port disabled

Info : gdb port disabled

Info : starting gdb server for stm32mp15x.cpu0 on 3333

Info : Listening on port 3333 for gdb connections

Info : starting gdb server for stm32mp15x.cm4 on 3334

Info : Listening on port 3334 for gdb connections

 

```

 

Console 2:

gdbgui -g "arm-ostl-linux-gnueabi-gdb -x gdb-script/Setup.gdb"

 

gdb-script folder is in same location where I run run command.

 

If I don't pass '-p 3333' then default is 127.0.0.1:5000 and failed.

If I add -p 3333 then:

 

OSError: [Errno 98] Address already in use

 

I already reset computer to "kill the gdbgui instance running in background" but did not help!

 

Anyone know how fix this issue?

 

And, the port is 5000 or 3333 if I want to debug over ST link?

 

edit:

Look to me port 3333 is right one. When look at console 1 where openocd start, I see:

 

```

Info : New GDB Connection: 1, Target stm32mp15x.cpu0, state: halted

Warn : ignoring character 0x47

Warn : ignoring character 0x45

.....

Warn : keep_alive() was not invoked in the 1000 ms timelimit. GDB alive packet not sent! (1016 ms). Workaround: increase "set remotetimeout" in GDB

```

 

When use port 5000 nothing happen at all.

Still see "OSError: [Errno 98] Address already in use" from gdbgui console if use port 3333

 

 

 

 

 

 

 

 

This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
OlivierK
ST Employee

Hi Dat Tran (Community Member),

port 3333 is indeed the correct one to use

Open On-Chip Debugger 0.11.0-rc2-dirty (2021-10-29-14:02)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.org/doc/doxygen/bugs.html

srst_only srst_pulls_trst srst_gates_jtag srst_open_drain connect_deassert_srst

Info : Listening on port 6666 for tcl connections

Info : Listening on port 4444 for telnet connections

Info : STLINK V2J36M26 (API v2) VID:PID 0483:3752

Info : Target voltage: 3.259064

Info : Unable to match requested speed 5000 kHz, using 4000 kHz

Info : Unable to match requested speed 5000 kHz, using 4000 kHz

Info : clock speed 4000 kHz

Info : stlink_dap_op_connect(connect)

Info : SWD DPIDR 0x6ba02477

Info : stlink_dap_op_connect(connect)

Info : SWD DPIDR 0x6ba02477

Info : stm32mp15x.cm4: hardware has 6 breakpoints, 4 watchpoints

Info : stm32mp15x.cpu0: hardware has 6 breakpoints, 4 watchpoints

Info : stm32mp15x.cpu1: hardware has 6 breakpoints, 4 watchpoints

Info : stm32mp15x.cm4: external reset detected

Info : starting gdb server for stm32mp15x.cpu0 on 3333

Info : Listening on port 3333 for gdb connections

Info : starting gdb server for stm32mp15x.cm4 on 3334

Info : Listening on port 3334 for gdb connections


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Dat Tran
Senior II

Yes, I will focus only on port 3333 from now.

But when Openocd listen at port 3333

And gdbgui also listen at port 3333,

This causes another error: "Address already in use", and I read python source code, "SO_REUSEADDR" already set before bind socket.

Do you have any idea?