1 ===========================================================================
2 #####ECOSGPLCOPYRIGHTBEGIN####
3 ## -------------------------------------------
4 ## This file is part of eCos, the Embedded Configurable Operating System.
5 ## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
7 ## eCos is free software; you can redistribute it and/or modify it under
8 ## the terms of the GNU General Public License as published by the Free
9 ## Software Foundation; either version 2 or (at your option) any later version.
11 ## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
12 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 ## You should have received a copy of the GNU General Public License along
17 ## with eCos; if not, write to the Free Software Foundation, Inc.,
18 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20 ## As a special exception, if other files instantiate templates or use macros
21 ## or inline functions from this file, or you compile this file and link it
22 ## with other works to produce a work based on this file, this file does not
23 ## by itself cause the resulting work to be covered by the GNU General Public
24 ## License. However the source code for this file must still be made available
25 ## in accordance with section (3) of the GNU General Public License.
27 ## This exception does not invalidate any other reasons why a work based on
28 ## this file might be covered by the GNU General Public License.
30 ## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
31 ## at http://sources.redhat.com/ecos/ecos-license/
32 ## -------------------------------------------
33 #####ECOSGPLCOPYRIGHTEND####
34 ===========================================================================
36 1999-01-05, revised 1999-03-11, revised 2000.01.26
38 How to build and install the GDB module on the AEB-1
39 ====================================================
44 The ARM AEB-1 comes with tools in ROM. These include a simple FLASH
45 management tool and the Angel (R) monitor. eCos for the ARM AEB-1
46 comes with GDB stubs suitable for programming into the onboard FLASH.
47 GDB is the preferred debug environment for eCos, but Angel must be
48 used to initially install the GDB stubs.
50 Once this bootstrapping is done, you can use GDB to load and debug
51 programs on the AEB-1 board.
53 The following steps will have you:
55 * talk to the AEB-1 board with a terminal emulator (or a real
58 * enable ARM's Angel ROM monitor
60 * use GDB with Angel or the Angel ROM monitor to download a
61 configuration of eCos with GDB stubs which will act as a ROM monitor
63 * talk to the AEB-1 with a terminal emulator again, and tell it to
64 write the new module to flash
66 * tell the board to use this new monitor, and then hook GDB up to it
72 Connect a terminal or computer's serial port to the ARM AEB-1. On a
73 PC with a 9-pin serial port, you can use the cable shipped by ARM with
76 Set the terminal or terminal emulator to 9600N1 (9600 baud, no parity,
79 Reset the board by pressing the little reset button on the top. You
80 will see the following text:
82 ARM Evaluation Board Boot Monitor 0.01 (19 APR 1998)
83 Press ENTER within 2 seconds to stop autoboot
85 Press ENTER quickly, and you will get the boot prompt:
90 Downloading the GDB stubs
91 -------------------------
93 Run the angel monitor by typing the following at the Boot: prompt:
98 Then exit the terminal emulator and start up gdb with the GDB module:
100 $ arm-elf-gdb -nw loaders/arm-aeb/gdb_module.img
101 (gdb) set remotebaud 9600
102 (gdb) target rdi s=<YOUR SERIAL PORT>
104 On Windows, the serial port could be com1, com2, etc. On a UNIX or
105 Linux system, the serial port would be /dev/cua0 or /dev/cua1.
108 (gdb) target rdi s=com1
109 (gdb) target rdi s=/dev/cua0
111 Finally, load the GDB stubs image:
114 Loading section .rom_vectors, size 0x44 lma 0xc000
115 Loading section .text, size 0x3544 lma 0xc044
116 Loading section .rodata, size 0x164 lma 0xf588
117 Loading section .data, size 0x110 lma 0xf6ec
118 Start address 0xc044 , load size 14332
119 Transfer rate: 12739 bits/sec.
121 (Note that the sizes may not exactly match the ones you see on your
124 Once the loading is done, quit GDB:
129 Activating the GDB stubs
130 ------------------------
132 Connect a terminal emulator to the board again, reset the board, and
133 type enter within two seconds to get the Boot: prompt. This is the
134 same thing you did at the beginning of this procedure.
136 Commit the GDB stubs module to flash:
138 Boot: flashwrite 4018000 C000 8000
140 Verify that the eCos/"GDB stubs" module is now added in the list of
141 modules in the board:
145 You should see the following output:
148 04000004 04000000 040034a8 BootStrap 1.00 (14 Aug 1998)
149 04003a74 04003800 04003bc0 Production Test 1.00 (13 Aug 1998)
150 0400e4f4 04004000 0400e60f Angel 1.02 (12 MAY 1998)
151 0401ac00 04018000 0401aed8 eCos 1.2 (26 Feb 1999) GDB stubs
153 Now make the eCos/"GDB stubs" module be the default monitor:
158 Running and debugging an application
159 ------------------------------------
161 Configure eCos from scratch for the ARM AEB-1 platform, and build your
162 application. Remember that the AEB-1 board only has 128K of RAM.
164 Exit from the terminal emulator (you will not need it anymore for
165 normal operations), and run gdb:
167 $ arm-elf-gdb -nw executable
168 (gdb) set remotebaud 38400
169 (gdb) target remote <YOUR SERIAL PORT>
172 You can now run your program in the usual way under GDB'S control
174 Notice that the GDB stub runs at 38400 baud.
177 Building the GDB stubs
178 ----------------------
180 We provide the GDB stubs image in the directory
181 loaders/arm-aeb/gdb_module.img, but here are instructions on how to
182 rebuild them if you should ever need to.
184 % ecosconfig new aeb stubs
188 The newlt built files are installed in ./bin/install.
191 Alternate way of loading the initial stubs
192 ------------------------------------------
194 Using the AEB-1 module tool, install the GDB stubs from the provided
197 >>> This is an annotated 'terminal' session with the AEB-1 monitor:
199 ARM Evaluation Board Boot Monitor 0.01 (19 APR 1998)
200 Press ENTER within 2 seconds to stop autoboot
202 Module is BootStrap 1.00 (14 Aug 1998)
204 Help is available on:
205 Help Modules ROMModules UnPlug PlugIn
206 Kill SetEnv UnSetEnv PrintEnv DownLoad
207 Go GoS Boot PC FlashWrite
211 Ready to download. Use 'transmit' option on terminal emulator to download file.
213 ... at this point, I told my terminal emulator (minicom) to download
214 the ASCII file gdb_module.img.UU (probably needs a different name
215 on Win/NT) I had to enter ^D when the download was complete to
216 get the monitor to come back.
218 Loaded file gdb_module.img.raw at address 0000c000, size = 13905
220 Boot: flashwrite 4018000 c000 8000
222 As above, this command actually programs the FLASH.
226 04000004 04000000 040034a8 BootStrap 1.00 (14 Aug 1998)
227 04003a74 04003800 04003bc0 Production Test 1.00 (13 Aug 1998)
228 0400e4f4 04004000 0400e60f Angel 1.02 (12 MAY 1998)
229 0401b608 04018000 0401b844 eCos 1.3 (Jan 26 2000) GDB stubs
231 This verifies that the eCos GDB stubs are available in FLASH.
235 This makes the eCos GDB stubs the default "monitor." When reset the
236 AEB-1 will start the GDB stubs, after the initial 2 second escape