Mercurial > flash_v2
annotate packages/hal/arm/aeb/current/misc/Notes @ 64:c38311975d4f ecos-sw-2000-01-28
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
| author | jlarmour |
|---|---|
| date | Fri, 28 Jan 2000 04:59:39 +0000 |
| parents | 18ee5a9c102e |
| children | bf00f99aec69 |
| rev | line source |
|---|---|
| 2 | 1 =========================================================================== |
| 2 ####COPYRIGHTBEGIN#### | |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
3 |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
4 ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
5 The contents of this file are subject to the Red Hat eCos Public License |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
6 Version 1.0 (the "License"); you may not use this file except in |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
7 compliance with the License. You may obtain a copy of the License at |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
8 http://sourceware.cygnus.com/ecos |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
9 |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
10 Software distributed under the License is distributed on an |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
11 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
12 License for the specific language governing rights and limitations under |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
13 the License. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
14 |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
15 The Original Code is eCos - Embedded Configurable Operating System, |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
16 released September 30, 1998. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
17 |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
18 The Initial Developer of the Original Code is Red Hat. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
19 Portions created by Red Hat are |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
20 Copyright (C) 1998, 1999, 2000 Red Hat, Inc. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
21 All Rights Reserved. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
22 ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
28
diff
changeset
|
23 |
| 2 | 24 ####COPYRIGHTEND#### |
| 25 =========================================================================== | |
| 26 | |
| 27 1999-01-05, revised 1999-03-11 | |
| 28 | |
| 29 How to build and install the GDB module on the AEB-1 | |
| 30 ==================================================== | |
| 31 | |
| 32 Overview | |
| 33 -------- | |
| 34 | |
| 35 The ARM AEB-1 comes with tools in ROM. These include a simple FLASH | |
| 36 management tool and the Angel (R) monitor. eCos for the ARM AEB-1 | |
| 37 comes with GDB stubs suitable for programming into the onboard FLASH. | |
| 38 GDB is the preferred debug environment for eCos, but Angel must be | |
| 39 used to initially install the GDB stubs. | |
| 40 | |
| 41 Once this bootstrapping is done, you can use GDB to load and debug | |
| 42 programs on the AEB-1 board. | |
| 43 | |
| 44 The following steps will have you: | |
| 45 | |
| 46 * talk to the AEB-1 board with a terminal emulator (or a real | |
| 47 terminal!) | |
| 48 | |
| 49 * enable ARM's Angel ROM monitor | |
| 50 | |
| 51 * use GDB with Angel to download a configuration of eCos with GDB | |
| 52 stubs which will act as a ROM monitor | |
| 53 | |
| 54 * talk to the AEB-1 with a terminal emulator again, and tell it to | |
| 55 write the new module to flash | |
| 56 | |
| 57 * tell the board to use this new monitor, and then hook GDB up to it | |
| 58 for real debugging | |
| 59 | |
| 60 Talking to the board | |
| 61 -------------------- | |
| 62 | |
| 63 Connect a terminal or computer's serial port to the ARM AEB-1. On a | |
| 64 PC with a 9-pin serial port, you can use the cable shipped by ARM with | |
| 65 no modification. | |
| 66 | |
| 67 Set the terminal or terminal emulator to 9600N1 (9600 baud, no parity, | |
| 68 1 stop bit). | |
| 69 | |
| 70 Reset the board by pressing the little reset button on the top. You | |
| 71 will see the following text: | |
| 72 | |
| 73 ARM Evaluation Board Boot Monitor 0.01 (19 APR 1998) | |
| 74 Press ENTER within 2 seconds to stop autoboot | |
| 75 | |
| 76 Press ENTER quickly, and you will get the boot prompt: | |
| 77 | |
| 78 Boot: | |
| 79 | |
| 80 | |
| 81 Downloading the GDB stubs | |
| 82 ------------------------- | |
| 83 | |
| 84 Run the angel monitor by typing the following at the Boot: prompt: | |
| 85 | |
| 86 Boot: plugin angel | |
| 87 Boot: angel | |
| 88 | |
| 89 Then exit the terminal emulator and start up gdb with the GDB module: | |
| 90 | |
| 91 $ arm-elf-gdb -nw loaders/arm-aeb/gdb_module.img | |
| 92 (gdb) set remotebaud 9600 | |
| 93 (gdb) target rdi s=<YOUR SERIAL PORT> | |
| 94 | |
| 95 On Windows, the serial port could be com1, com2, etc. On a UNIX or | |
| 96 Linux system, the serial port would be /dev/cua0 or /dev/cua1. | |
| 97 Examples are: | |
| 98 | |
| 99 (gdb) target rdi s=com1 | |
| 100 (gdb) target rdi s=/dev/cua0 | |
| 101 | |
| 102 Finally, load the GDB stubs image: | |
| 103 | |
| 104 (gdb) load | |
| 105 Loading section .rom_vectors, size 0x44 lma 0xc000 | |
| 106 Loading section .text, size 0x3544 lma 0xc044 | |
| 107 Loading section .rodata, size 0x164 lma 0xf588 | |
| 108 Loading section .data, size 0x110 lma 0xf6ec | |
| 109 Start address 0xc044 , load size 14332 | |
| 110 Transfer rate: 12739 bits/sec. | |
| 111 | |
| 112 (Note that the sizes may not exactly match the ones you see on your | |
| 113 system.) | |
| 114 | |
| 115 Once the loading is done, quit GDB: | |
| 116 | |
| 117 (gdb) quit | |
| 118 | |
| 119 | |
| 120 Activating the GDB stubs | |
| 121 ------------------------ | |
| 122 | |
| 123 Connect a terminal emulator to the board again, reset the board, and | |
| 124 type enter within two seconds to get the Boot: prompt. This is the | |
| 125 same thing you did at the beginning of this procedure. | |
| 126 | |
| 127 Commit the GDB stubs module to flash: | |
| 128 | |
| 129 Boot: flashwrite 4018000 C000 8000 | |
| 130 | |
| 131 Verify that the eCos/"GDB stubs" module is now added in the list of | |
| 132 modules in the board: | |
| 133 | |
| 134 Boot: rommodules | |
| 135 | |
| 136 You should see the following output: | |
| 137 | |
| 138 Header Base Limit | |
| 139 04000004 04000000 040034a8 BootStrap 1.00 (14 Aug 1998) | |
| 140 04003a74 04003800 04003bc0 Production Test 1.00 (13 Aug 1998) | |
| 141 0400e4f4 04004000 0400e60f Angel 1.02 (12 MAY 1998) | |
| 142 0401ac00 04018000 0401aed8 eCos 1.2 (26 Feb 1999) GDB stubs | |
| 143 | |
| 144 Now make the eCos/"GDB stubs" module be the default monitor: | |
| 145 | |
| 146 Boot: plugin eCos | |
| 147 | |
| 148 | |
| 149 Running and debugging an application | |
| 150 ------------------------------------ | |
| 151 | |
| 152 Configure eCos from scratch for the ARM AEB-1 platform, and build your | |
| 153 application. Remember that the AEB-1 board only has 128K of RAM. | |
| 154 | |
| 155 Exit from the terminal emulator (you will not need it anymore for | |
| 156 normal operations), and run gdb: | |
| 157 | |
| 158 $ arm-elf-gdb -nw executable | |
| 159 (gdb) set remotebaud 38400 | |
| 160 (gdb) target remote <YOUR SERIAL PORT> | |
| 161 (gdb) load | |
| 162 | |
| 163 You can now run your program in the usual way under GDB'S control | |
| 164 | |
| 165 Notice that the GDB stub runs at 38400 baud. | |
| 166 | |
| 167 | |
| 168 Building the GDB stubs | |
| 169 ---------------------- | |
| 170 | |
| 171 We provide the GDB stubs image in the directory | |
| 172 loaders/arm-aeb/gdb_module.img, but here are instructions on how to | |
| 173 rebuild them if you should ever need to. | |
| 174 | |
| 175 1. Configure a minimal eCos system with all packages except 'infra' | |
| 176 disabled. If you are doing manual configuration, you can do so | |
| 177 with | |
| 178 | |
| 179 tcl /work2/ecc/ecc/pkgconf.tcl \ | |
| 180 --target=arm --platform=aeb --startup=stubs \ | |
| 181 --disable CYGPKG_KERNEL --disable CYGPKG_UITRON \ | |
| 182 --disable CYGPKG_LIBC --disable CYGPKG_LIBM \ | |
| 183 --disable CYGPKG_ERROR --disable CYGPKG_IO \ | |
| 184 --disable CYGPKG_IO_SERIAL --disable CYGPKG_DEVICES_WALLCLOCK \ | |
| 185 --disable CYGPKG_DEVICES_WATCHDOG | |
| 186 | |
| 187 and if you are using the Configuration Tool GUI, you can select the | |
| 188 ARM AEB platform, with GDB stubs startup, and enable the HAL and | |
| 189 INFRA packages and disable all other packages. | |
| 190 | |
| 191 2. Edit <hal/hal.h> to enable GDB: | |
| 192 #define CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS | |
| 193 #undef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT | |
| 194 #undef CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT | |
| 195 | |
| 196 you can use the following patch: | |
| 197 | |
|
28
18ee5a9c102e
Merge from eCos master repository on 1999-08-09-17:04:48-BST
jlarmour
parents:
2
diff
changeset
|
198 patch -p0 <<END_OF_PATCH |
| 2 | 199 --- pkgconf/hal.h~ Wed Mar 10 13:08:58 1999 |
| 200 +++ pkgconf/hal.h Thu Mar 11 15:53:16 1999 | |
| 201 @@ -356,9 +356,9 @@ | |
| 202 | |
| 203 }}CFG_DATA */ | |
| 204 | |
| 205 -#undef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS | |
| 206 +#define CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS | |
| 207 #undef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT | |
| 208 -#define CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT | |
| 209 +#undef CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT | |
| 210 | |
| 211 /* | |
| 212 * NOTE: | |
| 213 | |
|
28
18ee5a9c102e
Merge from eCos master repository on 1999-08-09-17:04:48-BST
jlarmour
parents:
2
diff
changeset
|
214 END_OF_PATCH |
|
18ee5a9c102e
Merge from eCos master repository on 1999-08-09-17:04:48-BST
jlarmour
parents:
2
diff
changeset
|
215 |
| 2 | 216 |
| 217 3. make misc | |
| 218 | |
| 219 The gdb_module.img file will be built in the directory | |
| 220 hal/arm/aeb/current/misc | |
| 221 | |
| 222 | |
| 223 Alternate way of loading the initial stubs | |
| 224 ------------------------------------------ | |
| 225 | |
| 226 Using the AEB-1 module tool, install the GDB stubs from the provided | |
| 227 ".UU" file. | |
| 228 | |
| 229 >>> This is an annotated 'terminal' session with the AEB-1 monitor: | |
| 230 | |
| 231 ARM Evaluation Board Boot Monitor 0.01 (19 APR 1998) | |
| 232 Press ENTER within 2 seconds to stop autoboot | |
| 233 Boot: help | |
| 234 Module is BootStrap 1.00 (14 Aug 1998) | |
| 235 | |
| 236 Help is available on: | |
| 237 Help Modules ROMModules UnPlug PlugIn | |
| 238 Kill SetEnv UnSetEnv PrintEnv DownLoad | |
| 239 Go GoS Boot PC FlashWrite | |
| 240 FlashLoad FlashErase | |
| 241 | |
| 242 Boot: download c000 | |
| 243 Ready to download. Use 'transmit' option on terminal emulator to download file. | |
| 244 | |
| 245 ... at this point, I told my terminal emulator (minicom) to download the ASCII file | |
| 246 gdb_module.img.UU (probably needs a different name on Win/NT) | |
| 247 I had to enter ^D when the download was complete to get the monitor to come back. | |
| 248 | |
| 249 Loaded file gdb_module.img.raw at address 0000c000, size = 13905 | |
| 250 | |
| 251 Boot: flashwrite 4018000 c000 4000 | |
| 252 | |
| 253 As above, this command actually programs the FLASH. | |
| 254 | |
| 255 Boot: rommodules | |
| 256 Header Base Limit | |
| 257 04000004 04000000 040034a8 BootStrap 1.00 (14 Aug 1998) | |
| 258 04003a74 04003800 04003bc0 Production Test 1.00 (13 Aug 1998) | |
| 259 0400e4f4 04004000 0400e60f Angel 1.02 (12 MAY 1998) | |
| 260 0401b608 04018000 0401b844 eCos 1.2 (26 Feb 1999) GDB stubs | |
| 261 | |
| 262 This verifies that the eCos GDB stubs are available in FLASH. | |
| 263 | |
| 264 Boot: plugin ecos | |
| 265 | |
| 266 This makes the eCos GDB stubs the default "monitor." When reset the | |
| 267 AEB-1 will start the GDB stubs, after the initial 2 second escape | |
| 268 period. |
