Tip: Please refer to the section specific to your platform in the eCos and eCosPro Reference Guide for instructions on how to install either RedBoot or GDB stubs on your platform.
While eCos supports a variety of targets, communication with most targets happens in one of four ways. These are described in general below. Any details or variations from these descriptions will be found in the eCos and eCosPro Reference Guide.
Most targets will require RedBoot or GDB Stubs to be installed as part of the setup procedure described in the platform documentation for the target. These normally wait for GDB to connect at 38400 baud, using 8 data bit, no parity bit and 1 stop-bit and no hardware flow control. Check the documentation for your target to ensure it uses this speed. If not, adjust the following instructions accordingly.
The following instructions depend on your having selected the appropriate serial port on the host. That is, the serial port which connects to the target's (primary) serial port. On Linux this could be /dev/ttyS0 or /dev/ttyUSB0, while the same port on Windows would be named COM1. Substitute the proper serial port name in the below.
Connect to the target by issuing the following commands in GDB console mode:
(gdb) set remotebaud 38400 (gdb) target remote /dev/ttyS0
The program may then be loaded and executed, and optionally breakpoints set to make the program halt at specific points to allow debugging. For example:
(gdb) load Loading section [...] [...] (gdb) break main Breakpoint 1 at 0x12345678: file /work/main.c, line 20 (gdb) break file.c:123 Breakpoint 1 at 0x12346000: file /work/file.c, line 123 (gdb) continue Continuing.
For Eclipse, follow the instructions in the Debugging eCos applications chapter of the Eclipse/CDT for eCos application development manual.