📄 notes
字号:
===========================================================================####COPYRIGHTBEGIN####-------------------------------------------The contents of this file are subject to the Cygnus eCos Public LicenseVersion 1.0 (the "License"); you may not use this file except incompliance with the License. You may obtain a copy of the License athttp://sourceware.cygnus.com/ecosSoftware distributed under the License is distributed on an "AS IS"basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See theLicense for the specific language governing rights and limitations underthe License.The Original Code is eCos - Embedded Cygnus Operating System, releasedSeptember 30, 1998.The Initial Developer of the Original Code is Cygnus. Portions createdby Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved.-------------------------------------------####COPYRIGHTEND####===========================================================================1999-01-05, revised 1999-03-11How to build and install the GDB module on the AEB-1====================================================Overview--------The ARM AEB-1 comes with tools in ROM. These include a simple FLASHmanagement tool and the Angel (R) monitor. eCos for the ARM AEB-1comes with GDB stubs suitable for programming into the onboard FLASH.GDB is the preferred debug environment for eCos, but Angel must beused to initially install the GDB stubs.Once this bootstrapping is done, you can use GDB to load and debugprograms on the AEB-1 board.The following steps will have you:* talk to the AEB-1 board with a terminal emulator (or a real terminal!)* enable ARM's Angel ROM monitor* use GDB with Angel to download a configuration of eCos with GDB stubs which will act as a ROM monitor* talk to the AEB-1 with a terminal emulator again, and tell it to write the new module to flash* tell the board to use this new monitor, and then hook GDB up to it for real debuggingTalking to the board--------------------Connect a terminal or computer's serial port to the ARM AEB-1. On aPC with a 9-pin serial port, you can use the cable shipped by ARM withno modification.Set the terminal or terminal emulator to 9600N1 (9600 baud, no parity,1 stop bit).Reset the board by pressing the little reset button on the top. Youwill see the following text: ARM Evaluation Board Boot Monitor 0.01 (19 APR 1998) Press ENTER within 2 seconds to stop autobootPress ENTER quickly, and you will get the boot prompt: Boot:Downloading the GDB stubs-------------------------Run the angel monitor by typing the following at the Boot: prompt: Boot: plugin angel Boot: angelThen exit the terminal emulator and start up gdb with the GDB module: $ arm-elf-gdb -nw loaders/arm-aeb/gdb_module.img (gdb) set remotebaud 9600 (gdb) target rdi s=<YOUR SERIAL PORT>On Windows, the serial port could be com1, com2, etc. On a UNIX orLinux system, the serial port would be /dev/cua0 or /dev/cua1.Examples are: (gdb) target rdi s=com1 (gdb) target rdi s=/dev/cua0Finally, load the GDB stubs image: (gdb) load Loading section .rom_vectors, size 0x44 lma 0xc000 Loading section .text, size 0x3544 lma 0xc044 Loading section .rodata, size 0x164 lma 0xf588 Loading section .data, size 0x110 lma 0xf6ec Start address 0xc044 , load size 14332 Transfer rate: 12739 bits/sec.(Note that the sizes may not exactly match the ones you see on yoursystem.)Once the loading is done, quit GDB: (gdb) quitActivating the GDB stubs------------------------Connect a terminal emulator to the board again, reset the board, andtype enter within two seconds to get the Boot: prompt. This is thesame thing you did at the beginning of this procedure.Commit the GDB stubs module to flash: Boot: flashwrite 4018000 C000 8000Verify that the eCos/"GDB stubs" module is now added in the list ofmodules in the board: Boot: rommodulesYou should see the following output: Header Base Limit 04000004 04000000 040034a8 BootStrap 1.00 (14 Aug 1998) 04003a74 04003800 04003bc0 Production Test 1.00 (13 Aug 1998) 0400e4f4 04004000 0400e60f Angel 1.02 (12 MAY 1998) 0401ac00 04018000 0401aed8 eCos 1.2 (26 Feb 1999) GDB stubsNow make the eCos/"GDB stubs" module be the default monitor: Boot: plugin eCosRunning and debugging an application------------------------------------Configure eCos from scratch for the ARM AEB-1 platform, and build yourapplication. Remember that the AEB-1 board only has 128K of RAM.Exit from the terminal emulator (you will not need it anymore fornormal operations), and run gdb: $ arm-elf-gdb -nw executable (gdb) set remotebaud 38400 (gdb) target remote <YOUR SERIAL PORT> (gdb) loadYou can now run your program in the usual way under GDB'S controlNotice that the GDB stub runs at 38400 baud.Building the GDB stubs----------------------We provide the GDB stubs image in the directoryloaders/arm-aeb/gdb_module.img, but here are instructions on how torebuild them if you should ever need to.1. Configure a minimal eCos system with all packages except 'infra' disabled. If you are doing manual configuration, you can do so with tcl /work2/ecc/ecc/pkgconf.tcl \ --target=arm --platform=aeb --startup=stubs \ --disable CYGPKG_KERNEL --disable CYGPKG_UITRON \ --disable CYGPKG_LIBC --disable CYGPKG_LIBM \ --disable CYGPKG_ERROR --disable CYGPKG_IO \ --disable CYGPKG_IO_SERIAL --disable CYGPKG_DEVICES_WALLCLOCK \ --disable CYGPKG_DEVICES_WATCHDOG and if you are using the Configuration Tool GUI, you can select the ARM AEB platform, with GDB stubs startup, and enable the HAL and INFRA packages and disable all other packages.2. Edit <hal/hal.h> to enable GDB: #define CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS #undef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT #undef CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT you can use the following patch:--- pkgconf/hal.h~ Wed Mar 10 13:08:58 1999+++ pkgconf/hal.h Thu Mar 11 15:53:16 1999@@ -356,9 +356,9 @@ }}CFG_DATA */ -#undef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS+#define CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS #undef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT-#define CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT+#undef CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT /* * NOTE:3. make miscThe gdb_module.img file will be built in the directoryhal/arm/aeb/current/miscAlternate way of loading the initial stubs------------------------------------------Using the AEB-1 module tool, install the GDB stubs from the provided".UU" file.>>> This is an annotated 'terminal' session with the AEB-1 monitor:ARM Evaluation Board Boot Monitor 0.01 (19 APR 1998)Press ENTER within 2 seconds to stop autobootBoot: helpModule is BootStrap 1.00 (14 Aug 1998)Help is available on: Help Modules ROMModules UnPlug PlugIn Kill SetEnv UnSetEnv PrintEnv DownLoad Go GoS Boot PC FlashWrite FlashLoad FlashEraseBoot: download c000Ready to download. Use 'transmit' option on terminal emulator to download file. ... at this point, I told my terminal emulator (minicom) to download the ASCII file gdb_module.img.UU (probably needs a different name on Win/NT) I had to enter ^D when the download was complete to get the monitor to come back.Loaded file gdb_module.img.raw at address 0000c000, size = 13905Boot: flashwrite 4018000 c000 4000 As above, this command actually programs the FLASH.Boot: rommodulesHeader Base Limit04000004 04000000 040034a8 BootStrap 1.00 (14 Aug 1998)04003a74 04003800 04003bc0 Production Test 1.00 (13 Aug 1998)0400e4f4 04004000 0400e60f Angel 1.02 (12 MAY 1998)0401b608 04018000 0401b844 eCos 1.2 (26 Feb 1999) GDB stubs This verifies that the eCos GDB stubs are available in FLASH.Boot: plugin ecos This makes the eCos GDB stubs the default "monitor." When reset the AEB-1 will start the GDB stubs, after the initial 2 second escape period.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -