PSAS/ LPC2148Software/ debugging

GDB

Unfortunately, you can't use GDB when eCos is built in ROM. GDB steps through code by writing a command in place of the next command to step to, and that isn't possible in ROM. Both software breakpoints and hardware breakpoints can't be set while using the serial port for debugging. I've heard that you can set a maximum of two hardware breakpoints with a JTAG debugger. Until we have a JTAG device, we're stuck with print statements.

Printing

eCos will redirect printf statements through the serial port. However, printf currently makes the processor hang (it's probably in an infinite loop in an exception handler). It's probably because printf attempts to write to stdout, which I don't know how to set. diag_printf actually writes directly to the diagnosic serial port, so you should use that instead.

Devtab Entries

eCos also provides devtab entries that communicate through the serial port. However, /dev/tty0, /dev/tty1, and /dev/ser0 don't work. They don't make the system hang, but they don't send any information out the serial ports.

Using cyg_io_write with /dev/ttydiag works fine.