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