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