?? target-setup.sgml
字號:
<!-- {{{ Banner --><!-- =============================================================== --><!-- --><!-- config-tool.sgml --><!-- --><!-- eCos User Guide --><!-- --><!-- =============================================================== --><!-- ####COPYRIGHTBEGIN#### --><!-- --><!-- =============================================================== --><!-- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. --><!-- This material may be distributed only subject to the terms --><!-- and conditions set forth in the Open Publication License, v1.0 --><!-- or later (the latest version is presently available at --><!-- http://www.opencontent.org/openpub/) --><!-- Distribution of the work or derivative of the work in any --><!-- standard (paper) book form is prohibited unless prior --><!-- permission obtained from the copyright holder --><!-- =============================================================== --><!-- --> <!-- ####COPYRIGHTEND#### --><!-- =============================================================== --><!-- #####DESCRIPTIONBEGIN#### --><!-- --><!-- ####DESCRIPTIONEND#### --><!-- =============================================================== --><!-- }}} --><appendix id="appendix-target-setup"><title>Target Setup</title><para>The following sections detail the setup of many of the targetssupported by eCos. </para><caution><para>This information is presented here only temporarily. It is intendedthat there will be separate documents detailing this information foreach target in future releases. Consequently not much effort has beenput into bringing the following documentation up to date -- much of itis obsolete, bogus or just plain wrong.</para></caution><!--<para>XXXXX Exactly which of these are really supported in 2.0. Can wedelete some of them. I'm reluctant to waste much time fixing up textthat is going to be largely rewritten anyway.XXXXX</para>--><!-- ==================================================== --><SECT1 id="setup-mn10300-stdeval1"><TITLE>MN10300 stdeval1 Hardware Setup</TITLE><PARA>The eCos Developer’s Kit package comes with a pairof EPROMs which provide GDB support for the Matsushita MN10300 (AM31)series evaluation board using CygMon, the Cygnus ROM monitor. Imagesof these EPROMs are also provided at <filename>BASE_DIR/loaders/mn10300-stdeval1/cygmon.bin</filename>.The LSB EPROM (LROM) is installed to socket IC8 on the board andthe MSB EPROM (UROM) is installed to socket IC9. Attention shouldbe paid to the correct orientation of these EPROMs during installation.</PARA><PARA>The CygMon stubs allows communication with GDB by way of theserial port at connector CN2. The communication parameters are fixedat 38400 baud, 8 data bits, no parity bit, and 1 stop bit (8-N-1).No flow control is employed. Connection to the host computer shouldbe made using a standard RS232C serial cable (not a null modem cable).A gender changer may also be required.</PARA></SECT1><!-- ==================================================== --><SECT1 id="setup-mn10300-sim"><TITLE>MN10300 Architectural Simulator Setup</TITLE><PARA>The MN10300 simulator is an architectural simulator for theMatsushita MN10300 that implements all features of the microprocessor necessary to run eCos. The current implementation provides accuratesimulation of the instruction set, interrupt controller, timers,and serial I/O.</PARA><PARA>In this release, you can run the same eCos binaries in thesimulator that can run on target hardware, if built for ROM start-up,with the exception of those that use the watchdog timer.</PARA><PARA>However, note that AM33 devices required to run eCos are notsimulated; therefore you cannot run eCos binaries built for theAM33 under the simulator. For the AM33, the simulator is effectivelyan instruction-set only simulator.</PARA><PARA>To simplify connection to the simulator, you are advised tocreate a GDB macro by putting the following code in your personalGDB start-up file (gdb.ini on Windows and .gdbinit on UNIX).</PARA><PROGRAMLISTING>define msim target sim --board=stdeval1 --memory-region 0x34004000,0x8 rbreak cyg_test_exit rbreak cyg_assert_fail end</PROGRAMLISTING><PARA>You can then connect to the simulator by invoking the command <PROGRAMLISTING>msim</PROGRAMLISTING> onthe command line:</PARA><PROGRAMLISTING>(gdb) msim</PROGRAMLISTING><PARA>You can achieve the same effect by typing out the macro’scontent on the command line if necessary.</PARA></SECT1><!-- ==================================================== --><SECT1 id="setup-am33-stb"><TITLE>AM33 STB Hardware Setup</TITLE><PARA>The Matsushita AM33 STB System Reference Board may be usedin two modes: via a JTAG debugger, or by means of a GDB stub ROM.</PARA><SECT2><TITLE>Use with GDB Stub ROM</TITLE><PARA>The eCos Developer’s Kit package comes with a ROMimage which provides GDB support forthe Matsushita(R) AM33 STB System Reference Board. To install theGDB stub ROM requires the use of the JTAG debugger and the Flash ROMprogramming code available from Matsushita. An image of this ROMis also provided at <filename>loaders/am33-stb/gdbload.bin</filename> underthe root of your eCos installation.</PARA><PARA>Ensure that there is a Flash ROM card in MAIN MEMORY SLOT <0>.Follow the directions for programming a Flash ROM supplied withthe programming software.</PARA><PARA>The final programming of the ROM will need to be done witha command similar to the following:</PARA><PROGRAMLISTING>fdown "gdbload.bin",0x80000000,16,1</PROGRAMLISTING><PARA>Once the ROM has been programmed, close down the JTAG debugger,turn the STB off, and disconnect the JTAG cable. Ensure that thehardware switches are in the following configuration:</PARA><PROGRAMLISTING>U U D D D U D DD = lower part of rocker switch pushed inU = upper part of rocker switch pushed in</PROGRAMLISTING><PARA>This is also the configuration required by the Flash programmingcode, so it should not be necessary to change these.</PARA><PARA>Restart the STB and the stub ROM will now be able to communicatewith <PRODUCTNAME>GDB</PRODUCTNAME>. eCos programs should be builtwith RAM startup.</PARA><PARA>Programs can then be downloaded via a standard RS232 nullmodem serial cable connected to the SERIAL1 connector on the STBfront panel (the AM33"s serial port 0). This line is programmedto run at 38400 baud, 8 data bits, no parity and 1 stop bit (8-N-1)with no flow control. A gender changer may also be required. Diagnosticoutput will be output to GDB using the same connection.</PARA><PARA>This procedure also applies for programming ROM startup eCosprograms into ROM, given a binary format image of the program from<PROGRAMLISTING> mn10300-elf-objcopy.</PROGRAMLISTING></PARA></SECT2><SECT2><TITLE>Use with the JTAG debugger</TITLE><PARA>To use eCos from the JTAG debugger, executables must be builtwith ROM startup and then downloaded via the JTAG debugger. Forthis to work there must be an SDRAM memory card in SUB MEMORY SLOT <0> andthe hardware switches on the front panel set to the following: </PARA><PROGRAMLISTING>D U D D D U D DD = lower part of rocker switch pushed inU = upper part of rocker switch pushed in</PROGRAMLISTING><PARA>Connect the JTAG unit and run the debugger as described inthe documentation that comes with it.</PARA><PARA>eCos executables should be renamed to have a “.out” extensionand may then be loaded using the debugger"s “l” or “lp” commands.</PARA><PARA>Diagnostic output generated by the program will be sent outof the AM33"s serial port 0 which is connected to the SERIAL1connector on the STB front panel. This line is programmed to runat 38400 baud, 8 data bits, no parity, and one stop bit (8-N-1)with no flow control. Connection to the host computer should beusing a standard RS232 null modem serial cable. A gender changermay also be required.</PARA></SECT2><SECT2><TITLE>Building the GDB stub ROM image</TITLE><PARA>eCos comes with a pre-built GDB stub ROM image for the AM33-STBplatform. This can be found at <filename>loaders/am33-stb/gdbload.bin</filename> relativeto the eCos installation directory.</PARA><PARA>If necessary, the ROM image can be re-built as follows:</PARA><ORDEREDLIST><LISTITEM><PARA> On Windows hosts, open a Bash session using <EMPHASIS>Start->Programs->Red Hat eCos->eCosDevelopment Environment</EMPHASIS></PARA></LISTITEM><LISTITEM><PARA>Create a build directory and cd into it</PARA></LISTITEM><LISTITEM><PARA>Run (all as one line):<PROGRAMLISTING>cygtclsh80 BASE_DIR/packages/pkgconf.tcl \ --target=mn10300_am33 --platform stb --startup rom \ --disable-kernel --disable-uitron --disable-libc --disable-libm \ --disable-io --disable-io_serial --disable-wallclock--disable-watchdog</PROGRAMLISTING> </PARA><PARA>where BASE_DIR is the path to the eCos installationdirectory.</PARA></LISTITEM><LISTITEM><PARA>Edit the configuration file <filename>pkgconf/hal.h</filename> in the build directory tree by ensuring the following configurationoptions are set as follows:<PROGRAMLISTING>#define CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS#define CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT#undef CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT#define CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT#define CYG_HAL_ROM_MONITOR</PROGRAMLISTING> </PARA></LISTITEM><LISTITEM><PARA>Run: make</PARA></LISTITEM><LISTITEM><PARA>Run: make -C hal/common/current/current/src/stubrom</PARA></LISTITEM><LISTITEM><PARA>The file <filename>hal/common/current/src/stubrom</filename> will be an ELF format executable of the ROM image. Use mn10300-elf-objcopy toconvert this to the appropriate format for loading into the MatsushitaFLASH ROM programmer, mode “binary” in this case: <PROGRAMLISTING>$ mn10300-elf-objcopy -O binary hal/common/current/src/stubrom/ \ stubrom stubrom.img</PROGRAMLISTING></PARA></LISTITEM></ORDEREDLIST></SECT2></SECT1><!-- ==================================================== --><SECT1 id="setup-tx39-jmr3904"><TITLE>TX39 Hardware Setup</TITLE><PARA>The eCos Developer’s Kit package comes with a pairof ROMs that provide GDB support forthe Toshiba JMR-TX3904 RISC processor reference board by way of CygMon. </PARA><PARA>Images of these ROMs are also provided at <filename>BASE_DIR/loaders/tx39-jmr3904/cygmon50.bin</filename> and <filename>BASE_DIR/loaders/tx39-jmr3904/cygmon66.bin</filename> for50 MHz and 66 MHz boards respectively. The ROMs are installed tosockets IC6 and IC7 on the memory daughterboard according to theirlabels. Attention should be paid to the correct orientation of theseROMs during installation.</PARA><PARA>The GDB stub allows communication with GDB using the serialport (channel C) at connector PJ1. The communication parametersare fixed at 38400 baud, 8 data bits, no parity bit, and 1 stopbit (8-N-1). No handshaking is employed. Connection to the hostcomputer should be made using an RS232C null modem cable.</PARA><PARA>CygMon and eCos currently provide support for a 16Mbyte 60ns72pin DRAM SIMM fitted to the PJ21 connector. Different size DRAMsmay require changes in the value stored in the DCCR0 register. Thisvalue may be found near line 211 in <filename>hal/mips/arch/<replaceable>&Version;</replaceable>/src/vectors.S</filename>in eCos, and near line 99 in <filename>libstub/mips/tx39jmr/tx39jmr-power.S</filename> inCygMon. eCos does not currently use the DRAM for any purpose itself,so it is entirely available for application use.</PARA></SECT1><!-- ==================================================== --><SECT1 id="setup-tx39-sim"><TITLE>TX39 Architectural Simulator Setup</TITLE><PARA>The TX39 simulator is an architectural simulator which implementsall the features of the Toshiba TX39 needed to run eCos. The currentimplementation provides accurate simulation of the instruction set, interrupt controller, and timers, as well as having generic supportfor diagnostic output, serial I/O, and exceptions.</PARA><PARA>In this release, you can run the same eCos binaries in thesimulator that can run on target hardware, if it is built for ROMstart-up.</PARA><PARA>To simplify connection to the simulator, you are advised tocreate a GDB macro by putting the following code in your personalGDB start-up file (gdb.ini on Windows and .gdbinit on UNIX).</PARA><PROGRAMLISTING>define tsim target sim --board=jmr3904pal --memory-region 0xffff8000,0x900 \ --memory-region 0xffffe000,0x4 \ --memory-region 0xb2100000,0x4 rbreak cyg_test_exit rbreak cyg_assert_failend</PROGRAMLISTING><PARA>You can then connect to the simulator by invoking the command <command>tsim</command> onthe command line:</PARA><PROGRAMLISTING>(gdb) tsim</PROGRAMLISTING><PARA>You can achieve the same effect by typing out the macro’scontent on the command line if necessary.</PARA></SECT1><!-- ==================================================== --><SECT1 id="setup-tx49-ref4955"><TITLE>TX49 Hardware Setup</TITLE><PARA>The eCos installation CD contains a copy of the eCos GDB stubsin SREC format which must be programmed into the board’sFLASH memory.</PARA><SECT2><TITLE>Preparing the GDB stubs</TITLE><PARA>These stub preparation steps are not strictly necessary asthe eCos distribution ships with pre-compiled stubs in the directory <filename>loaders/tx49-ref4955</filename> relativeto the installation root.</PARA><SECT3><TITLE>Building the GDB stub image with the eCos Configuration Tool</TITLE><ORDEREDLIST><LISTITEM><PARA> Start with a new document - selecting the <EMPHASIS>File->New</EMPHASIS> menu item if necessary to do this.</PARA></LISTITEM><LISTITEM><PARA>Choose the <EMPHASIS>Build->Templates</EMPHASIS> menu item, and then select the TX49 REF4955 hardware.</PARA></LISTITEM><LISTITEM><PARA>While still displaying the <EMPHASIS>Build->Templates</EMPHASIS> dialog box, select the stubs package template to build a GDB stub.Click <EMPHASIS>OK</EMPHASIS>.</PARA></LISTITEM><LISTITEM>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -