Serial communications

Before you can configure your target for serial communications, you must establish a working serial connection between your host and target machines.
Note: On Linux, disable and stop mgetty before setting up serial communications.
To configure your target for serial communications:
  1. If it's not already running, start the serial device driver appropriate for your target.
    Typically, x86-based machines use the devc-ser8250 driver.
  2. Confirm the serial driver is running by entering the following command: ls /dev/ser*
    You'll see an entry such as /dev/ser1 or /dev/ser2.
  3. Type the following command to start the pseudo-terminal communications manager: devc-pty &
  4. Type the following command to start the debug agent (this command assumes that you're using the first serial port on your target): pdebug /dev/ser1 &
    Note: If you change the above command to pdebug /dev/ser1,57600, you can later see how ser1 is configured so that you can take note of the baud rate, then specify the same number in the launch configuration. The baud rate of the device that pdebug uses can be specified in the launch configuration (in this example, 57600).
  5. Determine the serial port parameters by entering the following command (again, this command assumes the first serial port): stty </dev/ser1
    This command produces a lot of output. Look for the baud=baudrate entry; you'll need this information to properly configure the host portion of the connection.

When you create a launch configuration, select C/C++ QNX PDebug (Serial) as its type. This lets you configure the host portion of a serial connection. For more information, see "Launch configuration types".

When a debugging session ends, the pdebug support agent always exits. If you use qconn, you don't have to restart pdebug because it's automatically restarted by qconn with each new debugging session. However, if you're debugging over a serial link, you must either manually restart pdebug or reset the target if pdebug is launched during startup.

The following script shows how to quickly restart pdebug to keep it running:
while true 
     pidin | grep -q pdebug 
     if [ $? -ne 0 ] 
        echo Start pdebug 
        pdebug /dev/ser1,115200 
     sleep 1