From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ormund Williams To: ecos Subject: Re: [ECOS] Problems building stand-alone gdb stub for ARM AEB Date: Tue, 03 Oct 2000 20:37:00 -0000 Message-id: <39DAA5F5.EFFFD4CE@brainlink.com> References: X-SW-Source: 2000-10/msg00021.html Gary Thomas wrote: > > > What does your memory layout look like? In particular, does it match > the AEB? A common case of this sort of failure is trying to download > something which overwrites the GDB/stubs memory space, resulting in > mayhem. > > Something you can try is to turn on remote debugging. This will provide > some useful info about what packets get sent and what happens to them. > Just issue this command before trying the first command that talks with > the board. > (gdb) set remotedebug 1 Thanks Gary The memory layout matches the board, gdb is failing to connect to the stub so I cannot even attempt to download any thing to the board. I have narrowed the problem down to the serial communications. It seems that when I send a character at a time to the stub it responds correctly but when I try gdb: bash$ arm-elf-gdb GNU gdb 5.0 Copyright 2000 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i586-pc-linux-gnu --target=arm-elf". (gdb) set debug remote 1 (gdb) set debug serial 1 (gdb) set remotebaud 38400 (gdb) target remote /dev/ttyS0 Remote debugging using /dev/ttyS0 Sending packet: $Hc-1#09...[ r ]Sending packet: $Hc-1#09...[]Sending packet: $Hc-1#09...[-]Nak Sending packet: $Hc-1#09...[][]Timed out. []Timed out. []Timed out. Ignoring packet error, continuing... Sending packet: $qC#b4...[]Sending packet: $qC#b4...[]Sending packet: $qC#b4...[]Sending packet: $qC#b4...[][]Timed out. []Timed out. []Timed out. Ignoring packet error, continuing... Sending packet: $qOffsets#4b...[]Sending packet: $qOffsets#4b...[]Sending packet: $qOffsets#4b...[]Sending packet: $qOffsets#4b...[][]Timed out. []Timed out. []Timed out. Ignoring packet error, continuing... Couldn't establish connection to remote target Malformed response to offset query, timeout (gdb) I modified the following code in plf_stub.c to output the line status register to the 4 LEDs: // Read one character from the current serial port. int hal_awt60_get_char(void) { char c; //, leds; cyg_uint8 lsr; static cyg_uint8 i; do { HAL_READ_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_LSR, lsr); } while ((lsr & SIO_LSR_DR) == 0); HAL_READ_UINT8 (CYG_DEVICE_SERIAL_RS232_16550_RBR, c); HAL_WRITE_UINT8 (PORT_C_LEDS, (lsr << 4)); return c; } Framing errors are my problem. Seems like a hardware problem, so I'll work on that next. Has any body seen this problem? -- Ormund