comparison packages/hal/arm/pid/current/src/Notes_GDB_stub @ 76:435cced73e2f ecos-v1_3_1-release

eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
author jlarmour
date Tue, 28 Mar 2000 14:10:45 +0000
parents
children ff3f181b64bd
comparison
equal deleted inserted replaced
75:41bf073c0c32 76:435cced73e2f
1 ===========================================================================
2 ####COPYRIGHTBEGIN####
3
4 -------------------------------------------
5 The contents of this file are subject to the Red Hat eCos Public License
6 Version 1.1 (the "License"); you may not use this file except in
7 compliance with the License. You may obtain a copy of the License at
8 http://www.redhat.com/
9
10 Software distributed under the License is distributed on an "AS IS"
11 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
12 License for the specific language governing rights and limitations under
13 the License.
14
15 The Original Code is eCos - Embedded Configurable Operating System,
16 released September 30, 1998.
17
18 The Initial Developer of the Original Code is Red Hat.
19 Portions created by Red Hat are
20 Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
21 All Rights Reserved.
22 -------------------------------------------
23
24 ####COPYRIGHTEND####
25 ===========================================================================
26
27 27 Oct 1999, revised on 2000.01.28
28
29 How to build and install the GDB module on the PID
30
31 Make GDB module
32 ~~~~~~~~~~~~~~~
33 Configure and build using the 'stubs' template for the PID
34 target. These are the necessary CLI instructions. It can also be done
35 from the Configtool by selecting the appropriate templates.
36
37 % cd /tmp
38 % mkdir stubs
39 % cd stubs
40 % ecosconfig new pid stubs
41 % ecosconfig tree
42 % make
43
44 This will install some files in ./install/bin:
45
46 cygmon.elf: The built stubs image
47 cygmon.bin: The image converted to binary (suitable for burning to ROM)
48 cygmon.img: The relocated ELF image (suitable for FLASH writing, see below)
49
50
51 Make FLASH tool
52 ~~~~~~~~~~~~~~~
53 Make FLASH tool
54 ~~~~~~~~~~~~~~~
55
56 Again, these are the necessary CLI instructions. It can also be done
57 from the Configtool by selecting the appropriate templates, and
58 enabling the option.
59
60 % cd /tmp
61 % mkdir pid-flash
62 % cd pid-flash
63 % ecosconfig new pid
64 % <edit ecos.ecc, enabling the CYGBLD_BUILD_FLASH_TOOL option:>
65 --- ecos.ecc.orig Fri Jan 28 11:21:43 2000
66 +++ ecos.ecc Fri Jan 28 11:22:01 2000
67 @@ -150,7 +150,7 @@
68 cdl_option CYGBLD_BUILD_FLASH_TOOL {
69 # Flavor: bool
70 # No user value, uncomment the following line to provide one.
71 - # user_value 0
72 + user_value 1
73 # value_source default
74 # Default value: 0
75 # Requires: CYG_HAL_STARTUP == "RAM"
76 % ecosconfig resolve
77 % ecosconfig tree
78 % make
79
80 The flash tool is installed in ./install/bin
81
82
83 Prepare board for eCos
84 ~~~~~~~~~~~~~~~~~~~~~~
85 1. Set jumper 7-8 on LK6 [using the Angle code in the 16 bit EPROM]
86 2. Set jumper 5-6 on LK6 [select 8bit ROM mode]
87 3. Set jumper LK18 [ROM remap - this is also required for eCos]
88 4. Set S1 to 0-0-1-1 [20MHz operation]
89
90
91 Program FLASH
92 ~~~~~~~~~~~~~
93 1. Download the image onto the PID board:
94 % cd /tmp
95 % arm-elf-gdb -nw stubs/install/bin/gdb_image.img
96
97 (gdb) target rdi s=<serial device>
98 Angel Debug Monitor V1.04 (Advanced RISC Machines SDT 2.11a) for PID
99 Built with Serial(x1), Parallel, DCC
100 Rebuilt on Apr 7 1998 at 22:20:43
101 Serial Rate: 9600
102 Connected to ARM RDI target.
103 (gdb) load
104 Loading section .rom_vectors, size 0x60 lma 0x60000
105 Loading section .text, size 0xeea8 lma 0x60060
106 Loading section .rodata, size 0x304c lma 0x6ef08
107 Loading section .data, size 0x7f8 lma 0x71f54
108 Start address 0x60060 , load size 75596
109 Transfer rate: 5548 bits/sec.
110 (gdb) quit
111
112 This will download the stubs onto the board at 0x60000..0x80000
113
114 Use /dev/ttyS0, COM1 or similar for the <serial device> name.
115
116 2. Now download the FLASH programmer tool
117 % arm-elf-gdb -nw pid-flash/install/bin/prog_flash.img
118
119 (gdb) target rdi s=<serial device>
120 Angel Debug Monitor V1.04 (Advanced RISC Machines SDT 2.11a) for PID
121 Built with Serial(x1), Parallel, DCC
122 Rebuilt on Apr 7 1998 at 22:20:43
123 Serial Rate: 9600
124 Connected to ARM RDI target.
125 (gdb) load
126 Loading section .rom_vectors, size 0x60 lma 0x4000
127 Loading section .text, size 0x4964 lma 0x4060
128 Loading section .rodata, size 0x384 lma 0x89c4
129 Loading section .data, size 0x28c lma 0x8d48
130 Start address 0x4060 , load size 20436
131 Transfer rate: 5449 bits/sec.
132 (gdb) cont
133
134 3. The FLASH tool will output some text on the board serial port B at
135 38400 baud:
136
137 ARM eCos
138 FLASH here!
139 manuf: 8, device: 40
140 Error: Wrong Manufaturer: 08
141 ... Please change FLASH jumper
142
143 4. This text is repeated until you remove the jumper 7-8 on LK6. Then
144 the output should be:
145
146 manuf: 1F, device: A4
147 AT29C040A recognised
148 About to program FLASH using data at 60000..80000
149 *** Press RESET now to abort!
150
151 5. You have about 10 seconds to abort the operation by pressing
152 reset. After this timeout, the FLASH programming happens:
153
154 ...Programming FLASH
155 All done!
156
157 6. Quit/kill the GDB process which will hang.
158
159 7. Next time you reset the board, the stub will be in control, communicating
160 on serial port A at 38400 baud. See documentation for further details
161 on how to connect with GDB.
162
163
164
165 Big-Endian operation
166 ~~~~~~~~~~~~~~~~~~~~
167
168 1) If the board is to be used in big-endian mode, the stub should be
169 configured for platform 'pidbe' instead of 'pid'.
170
171 2a) If a big-endian rom controller is installed on the board, the
172 programming of a new stub into flash is covered in the ARM PID
173 manual.
174
175 2b) If a big-endian rom controller is _not_ used, this is what you
176 must do:
177
178 1) Follow the above instructions (including jumper settings) ,
179 but instead of building and using the 'prog_flash' FLASH
180 tool, use the 'prog_flash_BE_image_LE_system' FLASH tool
181 (build it by enabling CYGBLD_BUILD_FLASH_TOOL_BE)
182
183 2) Instead of resetting the board after the FLASH has been
184 programmed, switch off the power and enable jumper LK4.
185
186 If you have to re-program the FLASH later, you can follow the
187 steps above again, but also disable jumper LK4 when changing the
188 other jumpers.