1
votes

I'm trying to remote debug using gdbserver.

I connect my target device to my PC through USB port using this command to open terminal controlling my device :

minicom -D "/dev/ttyUSB0".

Now on my target device, I need to run gdbserver with this cmd:

gdbserver /dev/my_USB_serial_port my_Program.

However, I can't find ttyUSB0, all I got ís a bunch of ttyx(with x is a number) as below:

~ # /dev/tty
tty    tty14  tty20  tty27  tty33  tty4   tty46  tty52  tty59  tty8
tty0   tty15  tty21  tty28  tty34  tty40  tty47  tty53  tty6   tty9
tty1   tty16  tty22  tty29  tty35  tty41  tty48  tty54  tty60  ttyS0
tty10  tty17  tty23  tty3   tty36  tty42  tty49  tty55  tty61  ttyS1
tty11  tty18  tty24  tty30  tty37  tty43  tty5   tty56  tty62
tty12  tty19  tty25  tty31  tty38  tty44  tty50  tty57  tty63
tty13  tty2   tty26  tty32  tty39  tty45  tty51  tty58  tty7

How could I find which one is the correct serial port of my USB port ?

Update 1: As Employed Russian mentioned in the answer, I got confused about the USB port but I still couldn't connect to gdbserver using his command.

2

2 Answers

1
votes

However, I can't find ttyUSB0

You are confused -- of course you will not find ttyUSB0 on the target -- the target doesn't have anything plugged into its USB port.

On the target, you want to run gdbserver - my_Program &, then disconnect minicom, and finally use gdb and target remote /dev/ttyUSB0 on the host.

0
votes

Make sure getty isn't running on the same serial port as gdbserver on the target.

If you've got an interactive shell with minicom, check the serial port (usually ttyS0) on the target that's connected to it. If it's ttyS0, you start gdbserver on some other port, and connect another FTDI cable from that port to a second USB port on your host.