A serial connection allows the IDE to debug a program but not to use any profiling or analysis
tools. You generally set up this connection type only when TCP/IP networking isn't available on the target.
First, you must physically connect the host and target machines through a serial port.
Then, you must configure your target to use the serial link:
-
If it's not already running, start the appropriate serial driver on the target.
Typically, x86-based machines use the
devc-ser8250 driver. ARM-based machines use a board-specific
driver; for details on the starting the right driver, consult your BSP User's Guide.
When the serial driver is running, you can run
lsĀ /dev/ser* to see the path of the serial device.
-
Start the pseudo-terminal communications manager,
devc-pty, by entering the following command:
# devc-pty &
-
Determine the baud rate used by the serial port, using stty
(this example assumes that you're using the first serial port):
# stty </dev/ser1
This command lists all parameters of the serial port.
Look for the baud=baudrate entry; you'll need this information
to properly configure both the target and host sides of the connection.
-
Start the debugging agent,
pdebug, while specifying the previously reported baud rate:
# pdebug /dev/ser1,115200 &
This example uses a baud rate of 115200 but the stty-reported rate on your system may differ.
You can now use the newly enabled serial link
to debug a program on the target.
The link transports data between the debugger on the host (GDB) and the supporting agent on the target
(
pdebug).