[ECOS] Problems building stand-alone gdb stub for ARM AEB

Ormund Williams ormundw@brainlink.com
Tue Oct 3 20:37:00 GMT 2000


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 <Timeout: 2 seconds>]Sending packet: $Hc-1#09...[<Timeout: 2
seconds>]Sending packet: $Hc-1#09...[-]Nak
Sending packet: $Hc-1#09...[<Timeout: 2 seconds>][<Timeout: 2
seconds>]Timed out.
[<Timeout: 2 seconds>]Timed out.
[<Timeout: 2 seconds>]Timed out.
Ignoring packet error, continuing...
Sending packet: $qC#b4...[<Timeout: 2 seconds>]Sending packet:
$qC#b4...[<Timeout: 2 seconds>]Sending packet: $qC#b4...[<Timeout: 2
seconds>]Sending packet: $qC#b4...[<Timeout: 2 seconds>][<Timeout: 2
seconds>]Timed out.
[<Timeout: 2 seconds>]Timed out.
[<Timeout: 2 seconds>]Timed out.
Ignoring packet error, continuing...
Sending packet: $qOffsets#4b...[<Timeout: 2 seconds>]Sending packet:
$qOffsets#4b...[<Timeout: 2 seconds>]Sending packet:
$qOffsets#4b...[<Timeout: 2 seconds>]Sending packet:
$qOffsets#4b...[<Timeout: 2 seconds>][<Timeout: 2 seconds>]Timed out.
[<Timeout: 2 seconds>]Timed out.
[<Timeout: 2 seconds>]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


More information about the Ecos-discuss mailing list