1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
12 >AM33 STB Hardware Setup</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos User Guide"
20 HREF="ecos-user-guide.html"><LINK
23 HREF="appendix-target-setup.html"><LINK
25 TITLE="MN10300 Architectural Simulator Setup"
26 HREF="setup-mn10300-sim.html"><LINK
28 TITLE="TX39 Hardware Setup"
29 HREF="setup-tx39-jmr3904.html"></HEAD
40 SUMMARY="Header navigation table"
57 HREF="setup-mn10300-sim.html"
65 >Appendix A. Target Setup</TD
71 HREF="setup-tx39-jmr3904.html"
85 NAME="SETUP-AM33-STB">AM33 STB Hardware Setup</H1
87 >The Matsushita AM33 STB System Reference Board may be used
88 in two modes: via a JTAG debugger, or by means of a GDB stub ROM.</P
94 NAME="AEN3223">Use with GDB Stub ROM</H2
96 >The eCos Developer’s Kit package comes with a ROM
97 image which provides GDB support for
98 the Matsushita(R) AM33 STB System Reference Board. To install the
99 GDB stub ROM requires the use of the JTAG debugger and the Flash ROM
100 programming code available from Matsushita. An image of this ROM
101 is also provided at <TT
103 >loaders/am33-stb/gdbload.bin</TT
105 the root of your eCos installation.</P
107 >Ensure that there is a Flash ROM card in MAIN MEMORY SLOT <0>.
108 Follow the directions for programming a Flash ROM supplied with
109 the programming software.</P
111 >The final programming of the ROM will need to be done with
112 a command similar to the following:</P
120 CLASS="PROGRAMLISTING"
121 >fdown "gdbload.bin",0x80000000,16,1</PRE
126 >Once the ROM has been programmed, close down the JTAG debugger,
127 turn the STB off, and disconnect the JTAG cable. Ensure that the
128 hardware switches are in the following configuration:</P
136 CLASS="PROGRAMLISTING"
139 D = lower part of rocker switch pushed in
140 U = upper part of rocker switch pushed in</PRE
145 >This is also the configuration required by the Flash programming
146 code, so it should not be necessary to change these.</P
148 >Restart the STB and the stub ROM will now be able to communicate
152 >. eCos programs should be built
155 >Programs can then be downloaded via a standard RS232 null
156 modem serial cable connected to the SERIAL1 connector on the STB
157 front panel (the AM33"s serial port 0). This line is programmed
158 to run at 38400 baud, 8 data bits, no parity and 1 stop bit (8-N-1)
159 with no flow control. A gender changer may also be required. Diagnostic
160 output will be output to GDB using the same connection.</P
162 >This procedure also applies for programming ROM startup eCos
163 programs into ROM, given a binary format image of the program from<TABLE
170 CLASS="PROGRAMLISTING"
171 > mn10300-elf-objcopy.</PRE
182 NAME="AEN3238">Use with the JTAG debugger</H2
184 >To use eCos from the JTAG debugger, executables must be built
185 with ROM startup and then downloaded via the JTAG debugger. For
186 this to work there must be an SDRAM memory card in SUB MEMORY SLOT <0> and
187 the hardware switches on the front panel set to the following: </P
195 CLASS="PROGRAMLISTING"
198 D = lower part of rocker switch pushed in
199 U = upper part of rocker switch pushed in</PRE
204 >Connect the JTAG unit and run the debugger as described in
205 the documentation that comes with it.</P
207 >eCos executables should be renamed to have a “.out” extension
208 and may then be loaded using the debugger"s “l” or “lp” commands.</P
210 >Diagnostic output generated by the program will be sent out
211 of the AM33"s serial port 0 which is connected to the SERIAL1
212 connector on the STB front panel. This line is programmed to run
213 at 38400 baud, 8 data bits, no parity, and one stop bit (8-N-1)
214 with no flow control. Connection to the host computer should be
215 using a standard RS232 null modem serial cable. A gender changer
216 may also be required.</P
223 NAME="AEN3245">Building the GDB stub ROM image</H2
225 >eCos comes with a pre-built GDB stub ROM image for the AM33-STB
226 platform. This can be found at <TT
228 >loaders/am33-stb/gdbload.bin</TT
230 to the eCos installation directory.</P
232 >If necessary, the ROM image can be re-built as follows:</P
239 > On Windows hosts, open a Bash session using
244 >Start->Programs->Red Hat eCos->eCos
245 Development Environment</I
251 >Create a build directory and cd into it</P
255 >Run (all as one line):
264 CLASS="PROGRAMLISTING"
265 >cygtclsh80 BASE_DIR/packages/pkgconf.tcl \
266 --target=mn10300_am33 --platform stb --startup rom \
267 --disable-kernel --disable-uitron --disable-libc --disable-libm \
268 --disable-io --disable-io_serial --disable-wallclock
269 --disable-watchdog</PRE
276 >where BASE_DIR is the path to the eCos installation
281 >Edit the configuration file
286 in the build directory tree by ensuring the following configuration
287 options are set as follows:
296 CLASS="PROGRAMLISTING"
297 >#define CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
298 #define CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
299 #undef CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT
300 #define CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
301 #define CYG_HAL_ROM_MONITOR</PRE
314 >Run: make -C hal/common/current/current/src/stubrom</P
321 >hal/common/current/src/stubrom</TT
323 will be an ELF format executable of the ROM image. Use mn10300-elf-objcopy to
324 convert this to the appropriate format for loading into the Matsushita
325 FLASH ROM programmer, mode “binary” in this case:
334 CLASS="PROGRAMLISTING"
335 >$ mn10300-elf-objcopy -O binary hal/common/current/src/stubrom/ \
336 stubrom stubrom.img</PRE
350 SUMMARY="Footer navigation table"
361 HREF="setup-mn10300-sim.html"
370 HREF="ecos-user-guide.html"
379 HREF="setup-tx39-jmr3904.html"
389 >MN10300 Architectural Simulator Setup</TD
395 HREF="appendix-target-setup.html"
403 >TX39 Hardware Setup</TD