Getting Started with eCosTM
Prev | Chapter 10. Hardware setup | Next

# ARM7 PID hardware setup

The optimal environment for eCos is provided by running GDB stubs on the PID/7T board. The GDB stubs comprise a minimal environment for downloading and debugging eCos programs. The stubs can be programmed into either the programmable ROM (U12) or the FLASH (U13). A pre-built set of GDB stubs is included for this environment, along with a tool that will program the stubs into the FLASH memory on the board. Note that some unreliability has been experienced in downloading files using Angel 1.00. Angel 1.02 appears to be more robust in this application.

## Installing the stubs into FLASH

1. Configure the PID board to run Angel from ROM:

   Attach a serial cable from Serial A on the PID board to con1 on the development system. Install jumper LK6 pins 7-8 which enables Angel (the ARM debug agent) from the ROM.

   > Note: On the PID boards that have been tested, the jumper for pins 7-8 chooses FLASH vs. ROM mode. However, this does not match the ARM documentation which refers to the jumper from pins 5-6 for this selection.

2. Download the GDB stubs image using the host GDB tool and Angel:

   Change directory to the installed eCos repository at the bash prompt of the eCos Development Environment:

   `bash$` `cd /Program\ Files/Cygnus\ Solutions/eCos/`

   Run GDB to load the image into RAM (note that on UNIX the serial device name, e.g. `/dev/ttyS0` should be used in place of `com1` here):

        bash$ arm-elf-gdb loaders/arm-pid/gdb_module.img
        GNU gdb 4.17.1
        Copyright 1998 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-cygwin32 --target=arm-elf".
        (no debugging symbols found)...
        (gdb) target rdi com1
        Angel Debug Monitor for PID (Built with Serial(x1), Parallel, DCC) 1.00 (Advanced RISC Machines SDT 2.10)
        Angel Debug Monitor rebuilt on Jan 20 1997 at 02:33:43
        Connected to ARM RDI target.
        (gdb) load
        Loading section .rom_vectors, size 0x44 lma 0x60000
        Loading section .text, size 0x1f3c lma 0x60044
        Loading section .rodata, size 0x2c lma 0x61f80
        Loading section .data, size 0x124 lma 0x61fac
        Start address 0x60044 , load size 8400
        Transfer rate: 5169 bits/sec.
        (gdb) q
        The program is running.  Exit anyway? (y or n) y

3. Download and execute the FLASH programming tool:

        bash$ arm-elf-gdb loaders/arm-pid/prog_flash.img
        GNU gdb 4.17.1
        Copyright 1998 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-cygwin32 --target=arm-elf".
        (gdb) target rdi com1
        Angel Debug Monitor for PID (Built with Serial(x1), Parallel, DCC) 1.00 (Advanced RISC Machines SDT 2.10)
        Angel Debug Monitor rebuilt on Jan 20 1997 at 02:33:43
        Connected to ARM RDI target.
        (gdb) load
        Loading section .rom_vectors, size 0x44 lma 0x40000
        Loading section .text, size 0x44a4 lma 0x40044
        Loading section .rodata, size 0x318 lma 0x444e8
        Loading section .data, size 0x1c8 lma 0x44800
        Start address 0x40044 , load size 18888
        Transfer rate: 5596 bits/sec.
        (gdb) c

4. Switch to FLASH mode by removing the jumper at LK6 pins 7-8. The FLASH will be reprogrammed once the jumper has been removed.

   > Note: There will be no output on the terminal at this point. Wait 30 seconds and press the reset button on the PID/7T board. The GDB session must then be aborted.

## Installing the stubs into ROM

1. Create a raw image:

   Change directories to the arm-pid loaders directory at the bash prompt of the eCos Development Environment:

   `$` `cd /Program\ Files/Cygnus\ Solutions/eCos/loaders/arm-pid`

   Strip the image and generate a binary version:

   `$` `arm-elf-objcopy --strip-all gdb_module.img gdb_module.tmp`

   `$` `arm-elf-objcopy -O binary gdb_module.tmp gdb_module.bin`

2. Program the raw image file `gdb_module.bin` into ROM referring to the instructions of your ROM programmer.

3. Plug the ROM into socket U12 and install jumper LK6 pins 7-8 to enable the ROM.

Prev | Home | Next
SPARClite hardware setup | Up | How to build and install the GDB module on the AEB-1