Remote access to OpenOCD running on Pi 3 B

Open source ARM Debugger

Moderator: phalanx

Post Reply
Posts: 1
Joined: Fri Jun 22, 2018 5:06 am

Remote access to OpenOCD running on Pi 3 B

Post by crylla » Fri Jun 22, 2018 5:17 am

I have installed OpenOCD onto a Raspberry Pi 3, following the instructions here: ... 32-and-RPi

OpenOCD appears to run ok and says that it is listening on port 3333 for GDB commands and on port 444 for telnet commands (it can be issued commands via either protocol)

According to the link above, it should be possible to send GDB or telnet commands remotely from a PC connected to the same network as the RPi.

However, when I try to connect to OpenOCD on port 3333 from a Windows 10 PC running a a gdb client:

(gdb) target remote

I get the error message: No connection could be made because the target machine actively refused it.

Similarly, if I try to connect to OpenOCD on port 4444 from a Windows 10 PC via telnet

C:\WINDOWS\system32>telnet 4444

I get the error message:

Connecting To not open connection to the host, on port 4444: Connect failed

If I run the following command on the Raspberry Pi

netstat -an | grep tcp

I get:

tcp 0 0* LISTEN
tcp 0 0* LISTEN
tcp 0 0* LISTEN
tcp 0 0* LISTEN
tcp 0 0* LISTEN
tcp 0 0* LISTEN
tcp6 0 0 :::5900 :::* LISTEN
tcp6 0 0 :::22

I can establish the following PC to RPi connections:
SSH, VNC and telnet on the standard port 23.

On the RPi, I can connect via telnet to port 4444 at the loopback address

I can also connect to port 3333 at The connection is immediately dropped , presumably because the GDB protocol is not used, however I thing this proves that OpenGDB is listening on this port.

I am not a network expert but I think the problem may be that OpenGDB is listening to ports 3333 and 4444 at the local loopback address instead of the generic (all addresses) address. So connection requests to the RPi's address on the local network are being ignored.

Earlier versions of Raspian and or RPi hardware did seem to work with OpenOCD so I am assuming that this has something to do with changes to the standard RPi network setup.

But eaqualy this could be a fault with OpenOCD not choosing the address correctly.

Does anyone have any ideas on how to solve this?

Here is the contents of my hosts file on the RPi: localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters raspberrypi

I have not been fiddling with any of the standard setup and have only installed OpenOCD and various application like telnet, telnetd and iperf in an attempt at diagnosing the problem.

Posts: 4
Joined: Sat May 07, 2011 3:04 am

Re: Remote access to OpenOCD running on Pi 3 B

Post by iamseer » Wed Jul 25, 2018 11:08 pm

I had an exactly same problem today. After a few minutes searching "" in the source code. I found the solution is actually in manual.

Command: bindto [name]
Specify hostname or IPv4 address on which to listen for incoming TCP/IP connections. By default, OpenOCD will listen on the loopback interface only. If your network environment is safe, bindto can be used to cover all available interfaces.

So just add "bindto" in your cfg file then it will work.

Post Reply