URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [sgml/] [user-guide/] [target-setup.sgml] - Rev 373
Go to most recent revision | Compare with Previous | Blame | View Log
<!-- {{{ 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 microprocessornecessary 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 msimtarget sim --board=stdeval1 --memory-region 0x34004000,0x8rbreak cyg_test_exitrbreak cyg_assert_failend</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 tsimtarget sim --board=jmr3904pal --memory-region 0xffff8000,0x900 \--memory-region 0xffffe000,0x4 \--memory-region 0xb2100000,0x4rbreak cyg_test_exitrbreak 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><PARA>Build eCos stubs using<EMPHASIS>Build->Library</EMPHASIS>.</PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. GDB stubimages have the prefix gdb_module.</PARA></LISTITEM></ORDEREDLIST></SECT3><SECT3><TITLE> Building the GDB stub image with ecosconfig</TITLE><ORDEREDLIST><LISTITEM><PARA> Make an empty directory to contain the build tree,and cd into it.</PARA></LISTITEM><LISTITEM><PARA>To build a GDB stub ROM image, enter the command:</PARA><PROGRAMLISTING>$ ecosconfig new ref4955 stubs </PROGRAMLISTING></LISTITEM><LISTITEM><PARA>Enter the commands:</PARA><PROGRAMLISTING>$ ecosconfig tree$ make</PROGRAMLISTING></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. GDB stubimages have the prefix gdb_module.</PARA></LISTITEM></ORDEREDLIST></SECT3></SECT2><SECT2><TITLE> Installing GDB stubs into FLASH</TITLE><PARA>Boot into the board’s firmware in little-endian mode:</PARA><PARA>Set the switches like this: </PARA><PARA>SW1: 10000000 (first lever up, the rest down)SW2: 10000010</PARA><PARA>Connect serial cable on the lower connector, configure terminalemulator for 38400, 8-N-1.</PARA><PARA>When booting the board, you should get this prompt:</PARA><PROGRAMLISTING>HCP5 rev 0.9B .HCP5?</PROGRAMLISTING><PARA>Select o (option), a (FLASH) and b (boot write). You shouldsee this:</PARA><PROGRAMLISTING>Boot ROM WriteROM address-ffffffffbd000000, Boot Bus-[32bit]ID2 0 4 ffffffffa002ad40zzz SS-40000 IV-1 CS-20000 CC-2Flash ROM-[28F640J5], [16bit chip] * 2 * 1Block size-00040000 count-64ROM adr ffffffffbd000000-ffffffffbe000000 mask-00fc0000Send Srecord file sa=00000000 size=ffffffffffffffffra=fffffffffe000000</PROGRAMLISTING><PARA>Now send the stub SREC data down to the board using the terminalemulator’s ‘send ASCII’ (or similar)functionality. </PARA><PARA>Red Hat has experienced some sensitivity to how fast the datais written to the board. Under Windows you should configure Minicomto use a line delay of 100 milliseconds. Under Linux, use the slow_cat.tclscript:</PARA><PROGRAMLISTING>% cd BASE_DIR/packages/hal/mips/ref4955/<replaceable>&Version;</replaceable>/misc% slow_cat.tcl < [path]/gdb_module.srec > /dev/ttyS0</PROGRAMLISTING><PARA>Power off the board, and change it to boot the GDB stubs inbig-endian mode by setting the switches like this:</PARA><PARA>SW1: 00000000 (all levers down)SW2: 10001010</PARA><PARA>The GDB stubs allow communication with GDB using the serialport at connector PJ7A (lower connector). The communication parametersare fixed at 38400 baud, 8 data bits, no parity bit and 1 stopbit (8-N-1). No flow control is employed. Connection to the hostcomputer should be made using a straight through serial cable.</PARA></SECT2></SECT1><!-- ==================================================== --><SECT1 id="setup-vr4300-vrc4373"><TITLE>VR4300 Hardware Setup</TITLE><PARA>The eCos Developer’s Kit package comes with an EPROMwhich provides GDB support for the NECVRC4373 evaluation board. An image of this EPROM is also providedat <filename>loaders/vr4300-vrc4373/gdbload.bin</filename> underthe root of your eCos installation.</PARA><PARA>The EPROM is installed to socket U12 on the board. Attentionshould be paid to the correct orientation of the EPROM during installation.Only replace the board"s existing ROM using a proper PLCCextraction tool, as the socket would otherwise risk getting damaged. </PARA><PARA>The GDB stub in the EPROM allows communication with GDB usingthe serial port at connector J1. The communication parameters arefixed at 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 straight-through serial cable. </PARA></SECT1><SECT1 id="setup-vr4300-vrc4375"><TITLE>VRC4375 Hardware Setup</TITLE><PARA>For information about setting up the VRC4375 to run with RedBoot,consult the RedBoot User"s Guide. If using serial debugging,the serial line runs at 38400 baud 8-N-1 and should be connectedto the debug host using the cable supplied with the board.</PARA></SECT1><SECT1 id="setup-mips-atlasmalta"><TITLE>Atlas/Malta Hardware Setup</TITLE><PARA>For information about setting up the Atlas and Malta boards torun with RedBoot, consult the RedBoot User"s Guide.</PARA></SECT1><SECT1 id="setup-ppc-cogent"><TITLE>PowerPC Cogent Hardware Setup</TITLE><PARA>The eCos Developer’s Kit package comes with an EPROMwhich provides GDB support for the Cogentevaluation board. An image of this EPROM is also provided at<filename>loaders/powerpc-cogent/gdbload.bin</filename> underthe root of your eCos installation. The same EPROM and image canbe used on all three supported daughterboards: CMA287-23 (MPC823),CMA287-50 (MPC850), and CMA286-60 (MPC860).</PARA><PARA>The EPROM is installed to socket U4 on the board. Attentionshould be paid to the correct orientation of the EPROM during installation. </PARA><PARA>If you are going to burn a new EPROM using the binary image,be careful to get the byte order correct. It needs to be big-endian.If the EPROM burner software has a hex-editor, check that the firstfew bytes of the image look like: </PARA><PROGRAMLISTING>00000000: 3c60 fff0 6063 2000 7c68 03a6 4e80 0020 <`..`c.|h..N.. </PROGRAMLISTING><PARA>If the byte order is wrong you will see 603c instead of 3c60etc. Use the EPROM burner software to make a byte-swap before youburn to image to the EPROM. </PARA><PARA>If the GDB stub EPROM you burn does not work, try reversingthe byte-order, even if you think you have it the right way around.At least one DOS-based EPROM burner program is known to have thebyte-order upside down.</PARA><PARA>The GDB stub in the EPROM allows communication with GDB usingthe serial port at connector P12 (CMA101) or P3 (CMA102). The communication parametersare fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit(8-N-1). No flow control is employed. Connection to the host computershould be made using a dedicated serial cable as specified in theCogent CMA manual.</PARA><SECT2><TITLE>Installing the Stubs into ROM</TITLE><SECT3><TITLE>Preparing the Binaries</TITLE><PARA>These two binary preparation steps are not strictly necessaryas the eCos distribution ships with pre-compiled binaries in thedirectory <filename>loaders/powerpc-cogent</filename> relative to the installationroot.</PARA><SECT4><TITLE>Building the ROM images 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 PowerPC CMA28x hardware.</PARA></LISTITEM><LISTITEM><PARA>While still displaying the<EMPHASIS>Build->Templates</EMPHASIS>dialog box, select the “stubs” package templateto build a GDB stub. Click<EMPHASIS>OK</EMPHASIS>.</PARA></LISTITEM><LISTITEM><PARA>Build eCos using<EMPHASIS>Build->Library</EMPHASIS>.</PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. GDB stubROM images have the prefix “gdb_module”.</PARA></LISTITEM></ORDEREDLIST></SECT4><SECT4><TITLE>Building the ROM images with ecosconfig</TITLE><ORDEREDLIST><LISTITEM><PARA>Make an empty directory to contain the build tree,and cd into it.</PARA></LISTITEM><LISTITEM><PARA>To build a GDB stub ROM image, enter the command:<PROGRAMLISTING>$ ecosconfig new cma28x stubs </PROGRAMLISTING></PARA></LISTITEM><LISTITEM><PARA>Enter the commands:<PROGRAMLISTING>$ ecosconfig tree$ make</PROGRAMLISTING></PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. GDB stubROM images have the prefix “gdb_module”.</PARA></LISTITEM></ORDEREDLIST></SECT4></SECT3><SECT3><TITLE> Installing the Stubs into ROM or FLASH</TITLE><ORDEREDLIST><LISTITEM><PARA>Program the binary image file gdb_module.bininto ROM or FLASH referring to the instructions of your ROM programmer.</PARA></LISTITEM><LISTITEM><PARA> Plug the ROM/FLASH into socket U4 as describedat the beginning of this <EMPHASIS>Hardware Setup</EMPHASIS> section.</PARA></LISTITEM></ORDEREDLIST></SECT3></SECT2></SECT1><SECT1 id="setup-ppc-mbx860"><TITLE>PowerPC MBX860 Hardware Setup</TITLE><PARA>The eCos Developer’s Kit package comes with an EPROMwhich provides GDB support for the MotorolaPowerPC MBX860 evaluation board. An image of this EPROM is alsoprovided at <filename>loaders/powerpc-mbx/gdbload.bin</filename> underthe root of your eCos installation.</PARA><PARA>The EPROM is installed to socket XU1 on the board. Attentionshould be paid to the correct orientation of the EPROM during installation.Only replace the board"s existing ROM using a proper PLCCextraction tool, as the socket would otherwise risk getting damaged.</PARA><PARA>The GDB stub in the EPROM allows communication with GDB usingthe serial port at connector SMC1/COM1. The communicationparameters are fixed at 38400 baud, 8 data bits, no parity bit and1 stop bit (8-N-1). No flow control is employed. Connection to thehost computer should be made using a suitable serial cable.</PARA><PARA>In order to make the board execute the EPROM that you justinstalled (rather than the on-board FLASH memory), it may be necessarymove some links on the board. Specifically, ensure that link J4is in position 1-2. If in doubt, refer to the MBX documentationfrom Motorola, ensuring that Boot Port Size=8 Bits/ROMfor BOOT (CS#7), in their terminology.</PARA><SECT2><TITLE>Installing the Stubs into FLASH</TITLE><SECT3><TITLE>Preparing the Binaries</TITLE><PARA>These two binary preparation steps are not strictly necessaryas the eCos distribution ships with pre-compiled binaries in thedirectory <filename>loaders/powerpc-mbx</filename> relative to the installationroot.</PARA><SECT4><TITLE>Building the ROM images 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 PowerPC Motorola MBX860/821hardware.</PARA></LISTITEM><LISTITEM><PARA>While still displaying the<EMPHASIS>Build->Templates</EMPHASIS>dialog box, select the “stubs” package templateto build a GDB stub. Click<EMPHASIS>OK</EMPHASIS>.</PARA></LISTITEM><LISTITEM><PARA>Build eCos using<EMPHASIS>Build->Library</EMPHASIS>. </PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. GDB stubROM images have the prefix “gdb_module”.</PARA></LISTITEM></ORDEREDLIST></SECT4><SECT4><TITLE>Building the ROM images with ecosconfig</TITLE><ORDEREDLIST><LISTITEM><PARA>Make an empty directory to contain the build tree,and cd into it.</PARA></LISTITEM><LISTITEM><PARA>To build a GDB stub ROM image, enter the command:<PROGRAMLISTING>$ ecosconfig new mbx stubs </PROGRAMLISTING></PARA></LISTITEM><LISTITEM><PARA>Enter the commands:<PROGRAMLISTING>$ ecosconfig tree$ make </PROGRAMLISTING></PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. GDB stubROM images have the prefix “gdb_module”.</PARA></LISTITEM></ORDEREDLIST></SECT4></SECT3><SECT3><TITLE> Installing the Stubs into ROM</TITLE><ORDEREDLIST><LISTITEM><PARA> Program the binary image file gdb_module.bininto ROM or FLASH referring to the instructions of your ROM programmer.</PARA></LISTITEM><LISTITEM><PARA> Plug the ROM/FLASH into socket XU1 as describednear the beginning of this <EMPHASIS>Hardware Setup</EMPHASIS> section.</PARA></LISTITEM></ORDEREDLIST></SECT3><SECT3><TITLE>Installing the Stubs into FLASH</TITLE><PARA>This assumes you have EPPC-Bug in the on-board FLASH. Thiscan be determined by setting up the board according to the belowinstructions and powering up the board. The EPPC-Bug prompt shouldappear on the SMC1 connector at 9600 baud, 8N1.</PARA><ORDEREDLIST><LISTITEM><PARA>Set jumper 3 to 2-3 [allow XU2 FLASH tobe programmed]</PARA></LISTITEM><LISTITEM><PARA>Set jumper 4 to 2-3 [boot EPPC-Bug]</PARA></LISTITEM></ORDEREDLIST><SECT4><TITLE> Program FLASH</TITLE><ORDEREDLIST><LISTITEM><PARA> Prepare EPPC-Bug for download:</PARA><PROGRAMLISTING>EPPC-Bug>lo 0</PROGRAMLISTING><PARA>At this point the monitor is ready for input. It will not returnthe prompt until the file has been downloaded.</PARA></LISTITEM><LISTITEM><PARA>Use the terminal emulator’s ASCII download feature(or a simple clipboard copy/paste operation) to downloadthe gdb_module.srec data.Note that on Linux, Minicom’s ASCII download feature seemsto be broken. A workaround is to load the file into Emacs (or anothereditor) and copy the full contents to the clipboard. Then pressthe mouse paste-button (usually the middle one) over the Minicomwindow.</PARA></LISTITEM><LISTITEM><PARA>Program the FLASH with the downloaded data:<PROGRAMLISTING>EPPC-Bug>pflash 40000 60000 fc000000</PROGRAMLISTING></PARA></LISTITEM><LISTITEM><PARA>Switch off the power, and change jumper 4 to 1-2. Turnon the power again. The board should now boot using the newly programmedstubs.</PARA></LISTITEM></ORDEREDLIST></SECT4></SECT3></SECT2></SECT1><SECT1 id="setup-ppc-sim"><TITLE>PowerPC Architectural Simulator Setup</TITLE><PARA>The PowerPC simulator is an architectural simulator whichimplements all the features of the PowerPC needed to run eCos. Thecurrent implementation provides accurate simulation of the instructionset and timers, as well as having generic support for diagnosticoutput and exceptions.</PARA><PARA>The simulator also allows devices to be simulated, but nodevice simulation support has been defined for the serial devicedrivers in this release.</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 psimtarget sim -o ’/iobus/pal@0xf0001000/reg 0xf0001000 32’rbreak cyg_test_exitrbreak cyg_assert_failend</PROGRAMLISTING><PARA>You can then connect to the simulator by invoking the command <command>psim</command> onthe command line:</PARA><PROGRAMLISTING>(gdb) psim</PROGRAMLISTING><PARA>You can achieve the same effect by typing out the macro’scontent on the command line if necessary.</PARA><NOTE><PARA>The PowerPC simulator cannot execute binaries built for anyof the supported hardware targets. You must generate a configurationusing the PowerPC simulator platform:<PROGRAMLISTING>$ ecosconfig new psim</PROGRAMLISTING>or some such.</PARA></NOTE></SECT1><SECT1 id="setup-sparclite-sleb"><TITLE>SPARClite Hardware Setup</TITLE><PARA>The eCos Developer’s Kit package comes with a ROMwhich provides GDB support for the Fujitsu SPARClite EvaluationBoard by way of CygMon<PRODUCTNAME>. </PRODUCTNAME></PARA><PARA>An image of this ROM is also provided at<filename>BASE_DIR/loaders/sparclite-sleb/cygmon.bin.</filename> TheROM is installed in socket IC9 on the evaluation board. Attentionshould be paid to the correct orientation of the ROM during installation.</PARA><PARA>The GDB stub allows communication with GDB using a TCP channelvia the ethernet port at connector J5.</PARA><SECT2><TITLE><!-- <index></index> --><!-- <xref> -->Ethernet Setup</TITLE><PARA>The ethernet setup is described in the board’s manual,but here is a recapitulation.</PARA><PARA>Set the board’s ethernet address using SW1 on themotherboard:</PARA><PROGRAMLISTING> SW1-4 SW1-3 SW1-2 SW1-1 Ethernet Address----- ----- ----- ----- ----------------OFF OFF OFF OFF No ethernet, use serialOFF OFF OFF ON 00:00:0E:31:00:01OFF OFF ON OFF 00:00:0E:31:00:02OFF OFF ON ON 00:00:0E:31:00:03OFF ON OFF OFF 00:00:0E:31:00:04OFF ON OFF ON 00:00:0E:31:00:05OFF ON ON OFF 00:00:0E:31:00:06OFF ON ON ON 00:00:0E:31:00:07ON OFF OFF OFF 00:00:0E:31:00:08ON OFF OFF ON 00:00:0E:31:00:09ON OFF ON OFF 00:00:0E:31:00:0AON OFF ON ON 00:00:0E:31:00:0BON ON OFF OFF 00:00:0E:31:00:0CON ON OFF ON 00:00:0E:31:00:0DON ON ON OFF 00:00:0E:31:00:0EON ON ON ON 00:00:0E:31:00:0F</PROGRAMLISTING><SECT3><!-- <index></index> --><TITLE>BOOTP/DHCP service on Linux</TITLE><PARA>Configure the BOOTP or DHCP server on the network to recognizethe evaluation board’s ethernet address so it can assignthe board an IP address. Below is a sample DHCP server configurationfrom a Linux system (<filename>/etc/dhcpd.conf</filename>).It shows a setup for three evaluation boards.</PARA><PROGRAMLISTING>## DHCP server configuration.#allow bootp;subnet 192.168.1.0 netmask 255.255.255.0 {host mb831evb {hardware ethernet 00:00:0e:31:00:01;fixed-address mb831evb;}host mb832evb {hardware ethernet 00:00:0e:31:00:02;fixed-address mb832evb;}host mb833evb {hardware ethernet 00:00:0e:31:00:03;fixed-address mb833evb;}} </PROGRAMLISTING></SECT3><SECT3><!-- <index></index> --><TITLE>BOOTP/DHCP boot process</TITLE><PARA>Even when configured to use a TCP channel, CygMon will stillprint a boot message to the serial channel. If the BOOTP processwas successful and an IP address was found, a message “BOOTPfound xxx.xxx.xxx.xxx” will be printed where xxx.xxx.xxx.xxxis the IP address assigned by the BOOTP or DHCP server. If the BOOTPprocess fails, a message indicating failure will be printed andthe serial port will be used as the debug channel.</PARA><PARA>Once the board finds an IP address it will respond to ICMPecho request packets (ping). This gives a simple means to test thehealth of the board.</PARA><PARA>As described in “Ethernet Setup” on page 72,it should now be possible to connect to the SPARClite board fromwithin GDB by using the command:</PARA><PROGRAMLISTING>(gdb) target remote <host>:1000</PROGRAMLISTING></SECT3></SECT2><SECT2><TITLE>Serial Setup</TITLE><PARA>The CygMon stubs also allow communication with GDB by wayof the serial port at connector CON1. The communication parametersare fixed at 19200 baud, 8 data bits, no parity bit and 1 stop bit(8-N-1). No flow control is employed. Connection to the host computershould be made using a null modem cable. A gender changer may alsobe required.</PARA></SECT2></SECT1><SECT1 id="setup-sparclite-sim"><TITLE>SPARClite Architectural Simulator Setup</TITLE><PARA>The ESA SPARClite simulator is an architectural simulatorwhich implements all the features of the SPARClite needed to runeCos. The current implementation provides accurate simulation ofthe instruction set, interrupt controller, and timers, as well ashaving generic support for diagnostic output and exceptions.</PARA><PARA>Note that the ESA SPARClite simulator is unsupported, butis included in the release as a convenience.</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 ssimtarget sim -nfp -sparclite -dumbiorbreak cyg_test_exitrbreak cyg_assert_failend</PROGRAMLISTING><PARA>You can then connect to the simulator by invoking the command <command>ssim</command> onthe command line:</PARA><PROGRAMLISTING>(gdb) ssim</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-arm-pid"><TITLE><!-- <index></index> --><!-- <xref> -->ARM PID Hardware Setup</TITLE><PARA>eCos comes with two ROM images that provide GDB support forthe ARM PID board. The first ROM image provides a port of the CygMonROM monitor, which includes a command-line interface and a GDB remotestub. The second ROM image provides a remote GDB stub only, whichis a minimal environment for downloading and debugging eCos programssolely using GDB.</PARA><PARA>eCos, CygMon and the GDB stubs all support the PID fittedwith both ARM7T and ARM9 daughterboards. CygMon and the stubs canbe programmed into either the programmable ROM (U12) or the FLASH(U13). Pre-built forms of both ROM images are provided in the directoryloaders/arm-pid under the root of your eCos installation,along with a tool that will program the stubs into the FLASH memory onthe board. CygMon images are prefixed with the name 'cygmon' andGDB stub ROM images are given the prefix 'gdb_module'.Images may be provided in a number of formats including ELF (.imgextension), binary (.bin extension) and SREC (.srec extension).Note that some unreliability has been experienced in downloadingfiles using Angel 1.00. Angel 1.02 appears to be more robust inthis application.</PARA><SECT2><TITLE>Installing the Stubs into FLASH</TITLE><SECT3><TITLE>Preparing the Binaries</TITLE><PARA>These two binary preparation steps are not strictly necessaryas the eCos distribution ships with pre-compiled binaries in thedirectory loaders/arm-pid relative to the installationroot.</PARA></SECT3><SECT3><TITLE>Building the ROM images with the eCos Configuration Tool</TITLE><ORDEREDLIST><LISTITEM><PARA>Start with a new document - selecting the<EMPHASIS>File</EMPHASIS>-><EMPHASIS>New</EMPHASIS>menu item if necessary to do this.</PARA></LISTITEM><LISTITEM><PARA>Choose the<EMPHASIS>Build</EMPHASIS>-><EMPHASIS>Templates</EMPHASIS>menu item, and then select the ARM PID hardware.</PARA></LISTITEM><LISTITEM><PARA>While still displaying the<EMPHASIS>Build</EMPHASIS>-><EMPHASIS>Templates</EMPHASIS>dialog box, select either the "stubs" package template to builda GDB stub image, or the "cygmon" template to build the CygMon ROMMonitor. Click<EMPHASIS>OK</EMPHASIS>.</PARA></LISTITEM><LISTITEM><PARA>Build eCos using<EMPHASIS>Build</EMPHASIS>-><EMPHASIS>Library</EMPHASIS></PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. GDB stubROM images have the prefix "gdb_module". CygMon imageshave the prefix "cygmon".</PARA></LISTITEM></ORDEREDLIST></SECT3><SECT3><TITLE>Building the ROM images with ecosconfig</TITLE><!-- <PARA>(See <XREF LINKEND="USING-ECOSCONFIG-ON-UNIX">)</PARA> --><ORDEREDLIST><LISTITEM><PARA> Make an empty directory to contain the build tree,and cd into it.</PARA></LISTITEM><LISTITEM><PARA>To build a GDB stub ROM image, enter the command:</PARA><PROGRAMLISTING>$ ecosconfig new pid stubs</PROGRAMLISTING><PARA>or to build a CygMon ROM monitor image, enter the command:</PARA><PROGRAMLISTING>$ ecosconfig new pid cygmon</PROGRAMLISTING></LISTITEM><LISTITEM><PARA>Enter the commands:</PARA><PROGRAMLISTING>$ ecosconfig tree$ make</PROGRAMLISTING></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. GDB stubROM images have the prefix "gdb_module". CygMon imageshave the prefix "cygmon".</PARA></LISTITEM></ORDEREDLIST></SECT3><SECT3><TITLE>Building the FLASH Tool with the eCos Configuration Tool</TITLE><ORDEREDLIST><LISTITEM><PARA>Start with a new document - selecting the<EMPHASIS>File</EMPHASIS>-><EMPHASIS>New</EMPHASIS>menu item if necessary to do this.</PARA></LISTITEM><LISTITEM><PARA>Choose the<EMPHASIS>Build</EMPHASIS>-><EMPHASIS>Templates</EMPHASIS>menu item, and then select the ARM PID hardware.</PARA></LISTITEM><LISTITEM><PARA>Enable the "Build flash programming tool" option in theARM PID HAL (CYGBLD_BUILD_FLASH_TOOL)and resolve any resulting configuration conflicts.</PARA></LISTITEM><LISTITEM><PARA>Build eCos using<EMPHASIS>Build</EMPHASIS>-><EMPHASIS>Library</EMPHASIS></PARA></LISTITEM><LISTITEM><PARA>When the build completes, the FLASH tool image file canbe found in the bin/ subdirectory of the install tree,with the prefix "prog_flash"</PARA></LISTITEM></ORDEREDLIST></SECT3><SECT3><TITLE>Building the FLASH Tool with ecosconfig</TITLE><!-- <PARA>(See <XREF LINKEND="USING-ECOSCONFIG-ON-UNIX">)</PARA> --><ORDEREDLIST><LISTITEM><PARA> Make an empty directory to contain the build tree,and cd into it</PARA></LISTITEM><LISTITEM><PARA>Enter the command:</PARA><PROGRAMLISTING>$ ecosconfig new pid</PROGRAMLISTING></LISTITEM><LISTITEM><PARA>Edit the file ecos.ecc and enable the option CYGBLD_BUILD_FLASH_TOOLby uncommenting its user_value property and setting itto 1.</PARA></LISTITEM><LISTITEM><PARA>Enter the commands:</PARA><PROGRAMLISTING>$ ecosconfig resolve</PROGRAMLISTING><PARA>[there will be some output]</PARA><PROGRAMLISTING>$ ecosconfig tree$ make</PROGRAMLISTING></LISTITEM><LISTITEM><PARA>When the build completes, the FLASH tool image file canbe found in the bin/ subdirectory of the install tree,with the prefix "prog_flash"</PARA></LISTITEM></ORDEREDLIST></SECT3><SECT3><TITLE>Prepare the Board for FLASH Programming</TITLE><PARA>Each time a new image is to be programmed in the FLASH, thejumpers on the board must be set to allow Angel to run:</PARA><ORDEREDLIST><LISTITEM><PARA> Set jumper 7-8 on LK6 [using the Angel codein the 16 bit EPROM]</PARA></LISTITEM><LISTITEM><PARA>Set jumper 5-6 on LK6 [select 8bit ROM mode]</PARA></LISTITEM><LISTITEM><PARA>Set jumper LK18 [ROM remap - this isalso required for eCos]</PARA></LISTITEM><LISTITEM><PARA>Set S1 to 0-0-1-1 [20MHz operation]</PARA></LISTITEM><LISTITEM><PARA>Open jumper LK4 [enable little-endian operation]Attach a serial cable from Serial A on the PID board to connector1 on the development system. This is the cable through which thebinaries will be downloaded. Attach a serial cable from Serial Bon the PID board to connector 2 on the development system (or anysystem that will work as a terminal). Through this cable, the FLASHtool will write its instructions (at 38400 baud).</PARA></LISTITEM></ORDEREDLIST></SECT3><SECT3><TITLE>Program the FLASH</TITLE><ORDEREDLIST><LISTITEM><PARA>Download the FLASH ROM image onto the PID board. Forexample. for the GDB stubs image:<PROGRAMLISTING>bash$ arm-elf-gdb -nw gdb_module.imgGNU gdb 4.18-DEVTOOLSVERSIONCopyright 1998 Free Software Foundation, Inc.GDB is free software, covered by the GNU General Public License,and you are welcome to change it and/or distribute copiesof it under certain conditions. Type "show copying" to see the conditions.There is absolutely no warranty for GDB. Type "show warranty" for details.This GDB was configured as "--host=i586-pc-cygwin32 --target=arm-elf".(no debugging symbols found)...(gdb) target rdi s=com1Angel Debug Monitor for PID (Built with Serial(x1), Parallel, DCC) 1.00(Advanced RISC Machines SDT 2.10)Angel Debug Monitor rebuilt on Jan 20 1997 at 02:33:43Connected to ARM RDI target.(gdb) loadLoading section .rom_vectors, size 0x44 lma 0x60000Loading section .text, size 0x1f3c lma 0x60044Loading section .rodata, size 0x2c lma 0x61f80Loading section .data, size 0x124 lma 0x61facStart address 0x60044 , load size 8400Transfer rate: 5169 bits/sec.(gdb) qThe program is running. Exit anyway? (y or n) y </PROGRAMLISTING><NOTE><PARA> On a UNIX or Linux system, the serial port must be/dev/ttyS0 instead of COM1.You need to make sure that the /dev/ttyS0 fileshave the right permissions:<SCREEN>$ suPassword:# chmod o+rw /dev/ttyS0*# exit</SCREEN>If you are programming the GDB stub image, it will now be locatedat 0x60000..0x64000. If you are programming the Cygmon ROM Monitor,it will be located at 0x60000..0x80000.</PARA></NOTE></PARA></LISTITEM><LISTITEM><PARA>Now download the FLASH programmer tool</PARA><PROGRAMLISTING>bash$ arm-elf-gdb prog_flash.imgGNU gdb 4.18-DEVTOOLSVERSIONCopyright 1998 Free Software Foundation, Inc.GDB is free software, covered by the GNU General Public License,and you are welcome to change it and/or distributecopies of it under certain conditions. Type "show copying" to seethe conditions. There is absolutely no warranty for GDB. Type "showwarranty" for details.This GDB was configured as "--host=i586-pc-cygwin32 --target=arm-elf".(gdb) target rdi s=com1Angel Debug Monitor for PID (Built with Serial(x1), Parallel, DCC) 1.00(Advanced RISC Machines SDT 2.10)Angel Debug Monitor rebuilt on Jan 20 1997 at 02:33:43Connected to ARM RDI target.(gdb) loadLoading section .rom_vectors, size 0x44 lma 0x40000Loading section .text, size 0x44a4 lma 0x40044Loading section .rodata, size 0x318 lma 0x444e8Loading section .data, size 0x1c8 lma 0x44800Start address 0x40044 , load size 18888Transfer rate: 5596 bits/sec.(gdb) c</PROGRAMLISTING></LISTITEM><LISTITEM><PARA>The FLASH tool will output some text on the board serialport B at 38400 baud:</PARA><PROGRAMLISTING>ARMeCosFLASH here!manuf: 8, device: 40Error: Wrong Manufaturer: 08... Please change FLASH jumper</PROGRAMLISTING></LISTITEM><LISTITEM><PARA>This text is repeated until you remove the jumper 7-8on LK6. Then the output will be:</PARA><PROGRAMLISTING>manuf: 1F, device: A4AT29C040A recognisedAbout to program FLASH using data at 60000..64000*** Press RESET now to abort!</PROGRAMLISTING></LISTITEM><LISTITEM><PARA> You have about 10 seconds to abort the operation by pressingreset. After this timeout, the FLASH programming happens:</PARA><SCREEN>...Programming FLASHAll done!</SCREEN></LISTITEM><LISTITEM><PARA>Quit/kill the GDB process, which will hang.</PARA></LISTITEM><LISTITEM><PARA>Next time you reset the board, the stub will be in control,communicating on Serial A at 38400 baud.</PARA></LISTITEM></ORDEREDLIST><NOTE><PARA>If you do not have two serial ports available on your hostcomputer, you may still verify the FLASH programming completed successfullyby quitting/killing the GDB process after running "c" instep 2 above. Then switch the serial cable on the PID from SerialA to Serial B and run a terminal emulator on the host computer.In a few seconds you should see the the repeated text describedin step 2 above and you may continue the remaining steps as normal.</PARA></NOTE></SECT3><SECT3><TITLE>Programming the FLASH for big-endian mode</TITLE><PARA>The process is almost identical to the previous instructionswhich apply to a PID board running in little-endian mode only.</PARA><PARA>The only adjustments to make are that if programming a <EMPHASIS>GDB</EMPHASIS> stubROM image (or CygMon ROM monitor image), you must enable the option "UseBig-endian mode" in the <EMPHASIS>eCos Configuration Tool</EMPHASIS> (CYGHWR_HAL_ARM_BIGENDIANif using ecosconfig and editing ecos.ecc).</PARA><PARA>When programming the FLASH there are two options:</PARA><ORDEREDLIST><LISTITEM><PARA>Program FLASH using the little-endian FLASH tool. Afterpowering off, replace the ROM controller with the special big-endianversion which can be acquired from ARM. (This has not been testedby Red Hat).</PARA></LISTITEM><LISTITEM><PARA>Use a special big-endian version of the FLASH tool whichbyte-swaps all the words as they are written to the FLASH.</PARA></LISTITEM></ORDEREDLIST><PARA>Build this tool by enabling the "Build flash programming toolfor BE images on LE boards" option (CYGBLD_BUILD_FLASH_TOOL_BE),resulting in a utility with the prefix "prog_flash_BE_image_LE_system"which should be used instead of "prog_flash".</PARA><PARA>Note that there is a limitation to this method: no sub-worddata can be read from the ROM. To work around this, the .rodatasection is folded into the .data section and thus copied to RAMbefore the system starts.</PARA><PARA>Given that Thumb instructions are 16 bit, it is not possibleto run ROM-startup Thumb binaries on the PID board using this method.</PARA><PARA>When the image has been programmed, power off the board, andset jumper LK4 to enable big-endian operation.</PARA></SECT3></SECT2><SECT2><TITLE>Installing the Stubs into ROM</TITLE><ORDEREDLIST><LISTITEM><PARA>Program the binary image file gdb_module.bininto ROM referring to the instructions of your ROM programmer.</PARA></LISTITEM><LISTITEM><PARA>Plug the ROM into socket U12 and install jumper LK6 pins7-8 to enable the ROM.</PARA></LISTITEM></ORDEREDLIST></SECT2></SECT1><SECT1 id="setup-arm-aeb1"><TITLE><!-- <index></index> -->ARM AEB-1 Hardware Setup</TITLE><SECT2><TITLE>Overview</TITLE><PARA>The ARM AEB-1 comes with tools in ROM. These include a simpleFLASH management tool and the Angel® monitor. eCos forthe ARM AEB-1 comes with GDB stubs suitable for programming intothe onboard FLASH. GDB is the preferred debug environment for GDB,and while Angel provides a subset of the features in the eCos GDBstub, Angel is unsupported.</PARA><PARA>Both eCos and the stubs support both Revision B and RevisionC of the AEB-1 board. Stub ROM images for both types of board canbe found in the loaders/arm-aeb directory under the rootof your eCos installation. You can select which board you are usingby selecting either the aeb or aebC platform by selecting the appropriateplatform HAL in the <EMPHASIS>eCos Configuration Tool</EMPHASIS>.</PARA><PARA>The GDB stub can be downloaded to the board for programmingin the FLASH using the board's on-board ROM monitor:</PARA><ORDEREDLIST><LISTITEM><PARA>talk to the AEB-1 board with a terminal emulator (ora real terminal!)</PARA></LISTITEM><LISTITEM><PARA>use the board's rom menu to download a UU-encodedversion of the GDB stubs which will act as a ROM monitor</PARA></LISTITEM><LISTITEM><PARA>tell the board to use this new monitor, and then hookGDB up to it for real debugging</PARA></LISTITEM></ORDEREDLIST></SECT2><SECT2><TITLE>Talking to the Board</TITLE><PARA>Connect a terminal or computer's serial port to theARM AEB-1. On a PC with a 9-pin serial port, you can use the cableshipped by ARM with no modification. </PARA><PARA>Set the terminal or terminal emulator to 9600N1 (9600 baud,no parity, 1 stop bit). </PARA><PARA>Reset the board by pressing the little reset button on thetop. You will see the following text: </PARA><PROGRAMLISTING> ARM Evaluation Board Boot Monitor 0.01 (19 APR 1998)Press ENTER within 2 seconds to stop autoboot</PROGRAMLISTING><PARA>Press ENTER quickly, and you will get the boot prompt: </PARA><PROGRAMLISTING> Boot:</PROGRAMLISTING></SECT2><SECT2><TITLE>Downloading the Stubs via the Rom Menu</TITLE><PARA>Using the AEB-1 rom menu to download the GDB stubs from theprovided ".UU" file.</PARA><NOTE><PARA>This is an annotated 'terminal' sessionwith the AEB-1 monitor:</PARA></NOTE><PROGRAMLISTING>+Boot: helpModule is BootStrap 1.00 (14 Aug 1998)</PROGRAMLISTING><PROGRAMLISTING>Help is available on:</PROGRAMLISTING><PROGRAMLISTING>Help Modules ROMModules UnPlug PlugInKill SetEnv UnSetEnv PrintEnv DownLoadGo GoS Boot PC FlashWriteFlashLoad FlashErase</PROGRAMLISTING><PROGRAMLISTING>Boot: download c000Ready to download. Use 'transmit' option on terminalemulator to download file.</PROGRAMLISTING><PROGRAMLISTING>... at this point, download the ASCII file "loaders/arm-aeb/gdb_module.img.UU". The details of this operation differdepending on which terminal emulator is used. It may benecessary to enter "^D" (control+D) when the download completesto get the monitor to return to command mode. </PROGRAMLISTING><PROGRAMLISTING>Loaded file gdb_module.img.bin at address0000c000, size = 19392 </PROGRAMLISTING></SECT2><SECT2><TITLE>Activating the GDB Stubs</TITLE><PARA>Commit the GDB stubs module to FLASH: </PARA><PROGRAMLISTING> Boot: flashwrite 4018000 C000 8000</PROGRAMLISTING><PARA>Verify that the eCos/"GDB stubs" module is now addedin the list of modules in the board: </PARA><PROGRAMLISTING> Boot: rommodules</PROGRAMLISTING><PARA>You should see output similar to the following: </PARA><PROGRAMLISTING> Header Base Limit04000004 04000000 040034a8 BootStrap 1.00 (14 Aug 1998)04003a74 04003800 04003bc0 Production Test 1.00 (13 Aug 1998)0400e4f4 04004000 0400e60f Angel 1.02 (12 MAY 1998)0401c810 04018000 0401cbc0 eCos 1.3 (27 Jan 2000)GDB stubs</PROGRAMLISTING><PARA>Now make the eCos/"GDB stubs" module be the defaultmonitor: </PARA><PROGRAMLISTING> Boot: plugin eCos</PROGRAMLISTING><NOTE><PARA>Since the GDB stubs are always linked at the same address(0x4018000), the operation of writing to the FLASH and selectingthe stubs as default monitor is an idempotent operation. You candownload a new set of stubs following the same procedure - you donot have to unregister or delete anything.</PARA></NOTE></SECT2><SECT2><TITLE>Building the GDB Stub FLASH ROM Images</TITLE><PARA>Pre-built GDB stubs images are provided in the directory loaders/arm-aebrelative to the root of your eCos installation, but here are instructionson how to rebuild them if you should ever need to.</PARA></SECT2><SECT2><TITLE>Building the GDB Stubs with the eCos Configuration Tool</TITLE><ORDEREDLIST><LISTITEM><PARA>Start with a new document - selecting the<EMPHASIS>File</EMPHASIS>-><EMPHASIS>New</EMPHASIS>menu item if necessary to do this.</PARA></LISTITEM><LISTITEM><PARA>Choose the<EMPHASIS>Build</EMPHASIS>-><EMPHASIS>Templates</EMPHASIS>menu item, and then select the ARM AEB-1 hardware.</PARA></LISTITEM><LISTITEM><PARA>While still displaying the<EMPHASIS>Build->Templates</EMPHASIS>dialog box, select the "stubs" package template to build a GDBstub image. Click<EMPHASIS>OK</EMPHASIS>.</PARA></LISTITEM><LISTITEM><PARA>If applicable, set the "AEB board revision" option to"C" from "B" depending on the board revision being used.</PARA></LISTITEM><LISTITEM><PARA>Build eCos using<EMPHASIS>Build</EMPHASIS>-><EMPHASIS>Library.</EMPHASIS></PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. The GDB stubROM images have the prefix "gdb_module".</PARA></LISTITEM></ORDEREDLIST></SECT2><SECT2><TITLE>Building the GDB Stub ROMs with ecosconfig</TITLE><!-- <PARA>(See <XREF LINKEND="USING-ECOSCONFIG-ON-UNIX">)</PARA> --><ORDEREDLIST><LISTITEM><PARA>Make an empty directory to contain the build tree,and cd into it.</PARA></LISTITEM><LISTITEM><PARA>To build a GDB stub ROM image, enter the command:</PARA><PROGRAMLISTING>$ ecosconfig new aeb stubs</PROGRAMLISTING></LISTITEM><LISTITEM><PARA>If applicable, edit ecos.ecc and set the AEB board revision. (CYGHWR_HAL_ARM_AEB_REVISION)from the default "B" to "C" by uncommenting the user_valueproperty and setting it to "C".</PARA></LISTITEM><LISTITEM><PARA>Enter the commands<PROGRAMLISTING>$ ecosconfig tree$ make</PROGRAMLISTING></PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. The GDB stubROM images have the prefix "gdb_module".</PARA></LISTITEM></ORDEREDLIST></SECT2></SECT1><SECT1 id="setup-arm-cma230"><TITLE><!-- <index></index> -->ARM Cogent CMA230 Hardware Setup</TITLE><PARA>The eCos Developer's Kit package comes with an EPROMwhich provides GDB support for the Cogent evaluation board. An imageof this EPROM is also provided at loaders/arm-cma230/gdbload.binunder the root of your eCos installation. </PARA><PARA>The EPROM is installed to socket U3 on the board. Attentionshould be paid to the correct orientation of the EPROM during installation.</PARA><PARA>If you are going to burn a new EPROM using the binary image,be careful to get the byte order correct. It needs to be little-endian,which is usually the default in PC based programmer software.</PARA><PARA>If the GDB stub EPROM you burn does not work, try reversingthe byte-order, even if you think you have it the right way around.At least one DOS-based EPROM burner program is known to have thebyte-order upside down.</PARA><PARA>The GDB stub in the EPROM allows communication with GDB usingthe serial port at connector P12 (CMA101) or P3 (CMA102). The communication parametersare fixed at 38400 baud, 8 data bits, no parity bit and 1 stop bit(8-N-1). No flow control is employed. Connection to the host computershould be made using a dedicated serial cable as specified in theCogent CMA manual.</PARA><SECT2><TITLE>Building the GDB Stub FLASH ROM images</TITLE><PARA>Pre-built GDB stubs images are provided in the directory loaders/arm-cma230 relativeto the root of your eCos installation, but here are instructionson how to rebuild them if you should ever need to.</PARA><PARA>CygMon images are prefixed with the name 'cygmon' andGDB stub ROM images</PARA><PARA>are given the prefix 'gdb_module'.Images may be provided in a number of formats including ELF (.imgextension), binary (.bin extension) and SREC (.srec extension). </PARA></SECT2><SECT2><TITLE>Building the GDB Stubs with the eCos Configuration Tool</TITLE><ORDEREDLIST><LISTITEM><PARA>1. Start with a new document - selecting the File->Newmenu item if necessary to do this.</PARA></LISTITEM><LISTITEM><PARA>Choose the<EMPHASIS>Build</EMPHASIS>-><EMPHASIS>Templates</EMPHASIS>menu item, and then select the ARM CMA230 hardware.</PARA></LISTITEM><LISTITEM><PARA>While still displaying the<EMPHASIS>Build</EMPHASIS>-><EMPHASIS>Templates</EMPHASIS>dialog box, select the "stubs" package template to build a GDBstub image. Click<EMPHASIS>OK</EMPHASIS>.</PARA></LISTITEM><LISTITEM><PARA>Build eCos using<EMPHASIS>Build</EMPHASIS>-><EMPHASIS>Library</EMPHASIS></PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. The GDB stubROM images have the prefix "gdb_module".</PARA></LISTITEM></ORDEREDLIST></SECT2><SECT2><TITLE>Building the GDB Stub ROMs with ecosconfig</TITLE><!-- <PARA>(See <XREF LINKEND="USING-ECOSCONFIG-ON-UNIX">)</PARA> --><ORDEREDLIST><LISTITEM><PARA>1. Make an empty directory to contain the build tree,and cd into it.</PARA></LISTITEM><LISTITEM><PARA>To build a GDB stub ROM image, enter the command:</PARA><PROGRAMLISTING>$ ecosconfig new cma230 stubs</PROGRAMLISTING></LISTITEM><LISTITEM><PARA>Enter the commands:<PROGRAMLISTING>$ ecosconfig tree$ make</PROGRAMLISTING></PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. The GDB stubROM images have the prefix "gdb_module".</PARA></LISTITEM></ORDEREDLIST></SECT2></SECT1><SECT1 id="setup-arm-ep7211"><TITLE><!-- <index></index> --><!-- <xref> -->Cirrus Logic ARM EP7211 DevelopmentBoard Hardware Setup</TITLE><PARA>eCos comes with two Flash ROM images that provide GDB supportfor the Cirrus Logic EP7211 Development Board (also known as theEDB7211).. Note that on some board revisions, the board is silk-screenedas EDB7111-2. The first Flash ROM image provides a port of the CygMonROM monitor, which includes a command-line interface and a GDB remotestub. The second Flash ROM image provides a remote GDB stub only.</PARA><PARA>Both ROM images are provided in the directory loaders/arm-edb7211under the root of your eCos installation. CygMon images are prefixedwith the name 'edb7211_cygmon' and areprovided in a number of formats including binary (.bin extension)and SREC (.srec) extension. GDB stub ROM images are given the prefix 'edb7211_gdb_module'. </PARA><PARA>The ROM images provided for the EP7211 Development Board mustbe programmed into the FLASH. Please refer to the section titled"Loading the ROM image into On-Board flash" on how to program theROM onto the board.</PARA><PARA>Both Cygmon and GDB Stub ROMS allow communication with GDBvia the serial connector labelled 'UART 1'. Thecommunication parameters are fixed at 38400 baud, 8 data bits, noparity bit and 1 stop bit (8-N-1). No flow control is employed.Connection to the host computer should be made using a null modem cable.A gender changer may also be required. Note that the GDB Configuration tooluses the serial port identifiers 0 and 1 to identify the EB7211serial ports UART1 and UART2 respectively.</PARA><PARA>Both eCos and the ROM images assume the core clock is generatedwith a 3.6864 MHz PLL input. The CPU will be configured to run at73.728MHz.</PARA><PARA>Note: The EP7211 CPU needs a two step RESET process. Afterpressing the `URESET' pushbutton, the `WAKEUP' pushbuttonmust be pressed to complete the process.</PARA><NOTE><PARA>When an eCos program is run on an EDB7211 board fitted witheither CygMon or a GDB stub ROM, then the code in ROM loses control.This means that if you require the ability to remotely stop executionon the target, or want thread debugging capabilities, you must includeGDB stub support when configuring eCos.</PARA></NOTE><SECT2><TITLE>Building programs for programming into FLASH</TITLE><PARA>If your application is to be run directly from FLASH, youmust configure eCos appropriately for "ROM" startup. This can bedone in the <EMPHASIS>eCos Configuration Tool</EMPHASIS> by settingthe "Startup type" HAL option to "ROM". If using the ecosconfig utility,set the user_value of the CYG_HAL_STARTUPoption in ecos.ecc to "ROM".</PARA><PARA>When you have linked your application with eCos, you willthen have an ELF executable. To convert this into a format appropriatefor the Cirrus Logic FLASH download utility, or the dl_7xxxutility on Linux, you can use the utility arm-elf-objcopy, as inthe following example:</PARA><PROGRAMLISTING>$ arm-elf-objcopy -O binary helloworld.exe helloworld.bin</PROGRAMLISTING><PARA>This will produce a binary format image helloworld.bin whichcan be downloaded into FLASH.</PARA></SECT2><SECT2><TITLE>Building the GDB Stub FLASH ROM images</TITLE><PARA>Pre-built GDB stubs images are provided in the directory loaders/arm-edb7211 relativeto the root of your eCos installation, but here are instructionson how to rebuild them if you should ever need to.</PARA><PARA>CygMon images are prefixed with the name 'cygmon' andGDB stub ROM images are given the prefix 'gdb_module'.Images may be provided in a number of formats including ELF (.imgextension), binary (.bin extension) and SREC (.srec extension). </PARA></SECT2><SECT2><TITLE>Building the ROM images with the eCos Configuration Tool</TITLE><ORDEREDLIST><LISTITEM><PARA>Start with a new document - selecting the<EMPHASIS>File</EMPHASIS>-><EMPHASIS>New</EMPHASIS>menu item if necessary to do this.</PARA></LISTITEM><LISTITEM><PARA>Choose the<EMPHASIS>Build</EMPHASIS>-><EMPHASIS>Templates</EMPHASIS>menu item, and then select the "Cirrus Logic development board"hardware.</PARA></LISTITEM><LISTITEM><PARA>While still displaying the<EMPHASIS>Build</EMPHASIS>-><EMPHASIS>Templates</EMPHASIS>dialog box, select either the "stubs" package template to builda GDB stub image, or the "cygmon" template to build the CygMon ROMMonitor. Click<EMPHASIS>OK</EMPHASIS>.</PARA></LISTITEM><LISTITEM><PARA>Build eCos using<EMPHASIS>Build</EMPHASIS>-><EMPHASIS>Library</EMPHASIS></PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. GDB stubROM images have the prefix "gdb_module". CygMon imageshave the prefix "cygmon".</PARA></LISTITEM></ORDEREDLIST></SECT2><SECT2><TITLE>Building the ROM images with ecosconfig</TITLE><!-- <PARA>(See <XREF LINKEND="USING-ECOSCONFIG-ON-UNIX">)</PARA> --><ORDEREDLIST><LISTITEM><PARA>Make an empty directory to contain the build tree,and cd into it.</PARA></LISTITEM><LISTITEM><PARA>To build a GDB stub ROM image, enter the command:</PARA><PROGRAMLISTING>$ ecosconfig new edb7xxx stubs</PROGRAMLISTING><PARA>or to build a CygMon ROM monitor image, enter the command:</PARA><PROGRAMLISTING>$ ecosconfig new edb7xxx cygmon</PROGRAMLISTING></LISTITEM><LISTITEM><PARA>Enter the commands:</PARA><PROGRAMLISTING>$ ecosconfig tree$ make</PROGRAMLISTING></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. GDB stubROM images have the prefix "gdb_module". CygMon imageshave the prefix "cygmon".</PARA></LISTITEM></ORDEREDLIST></SECT2><SECT2><TITLE><!-- <xref> -->Loading the ROM Image into On-board Flash</TITLE><PARA>Program images can be written into Flash memory by means ofa bootstrap program which is built into the EDB7211. This programcommunicates with a support program on your host to download andprogram an image into the Flash memory.</PARA><PARA>Cirrus Logic provides such a program for use with Windows/DOS.eCos comes with a similar program which will run under Linux. Thebasic operation of both programs is the same.</PARA><ORDEREDLIST><LISTITEM><PARA>Connect a serial line to 'UART 1'.</PARA></LISTITEM><LISTITEM><PARA>Power off the EDB7211.</PARA></LISTITEM><LISTITEM><PARA>Install jumper 'PROGRAM ENABLE' whichenables this special mode for downloading Flash images. Note thatsome board revisions have this jumper labelled “BOOT ENABLE”.</PARA></LISTITEM><LISTITEM><PARA>Power on the EDB7211.</PARA></LISTITEM><LISTITEM><PARA>Execute the Flash writing program on your host. On Linux,this would be:</PARA><PROGRAMLISTING> # dl_edb7xxx <PATH>/gdb_module.bin</PROGRAMLISTING><PARA>where '<PATH>' is the path tothe binary format version of the ROM image you wish to load, eitheras built in the previous section or the "loaders/arm-edb7211/" subdirectoryof your eCos installation. The download tool defaults to 38400 baud anddevice /dev/ttyS1 for communication. To changethese, specify them as parameters, e.g.</PARA><PROGRAMLISTING># dl_edb7xxx <PATH>/gdb_module.bin 9600 /dev/ttyS0</PROGRAMLISTING></LISTITEM><LISTITEM><PARA>The download program will indicate that it is waitingfor the board to come alive. At this point, press 'RESET' andthen 'WAKEUP' switches in order. There should besome indication of progress, first of the code being downloaded,then of the programming process.</PARA></LISTITEM><LISTITEM><PARA>Upon completion of the programming, power off the EDB7211.</PARA></LISTITEM><LISTITEM><PARA>Remove the 'PROGRAM ENABLE/BOOT ENABLE' jumper.</PARA></LISTITEM><LISTITEM><PARA>Power on the EDB7211, press 'RESET' and 'WAKEUP'.The new ROM image should now be running on the board.</PARA></LISTITEM><LISTITEM><PARA>The GDB debugger will now be able to communicate withthe board to download and debug RAM based programs.This procedure also applies for loading ROM-startup eCos programsinto the on-board FLASH memory, given a binary format image of theprogram from arm-elf-objcopy. Loading a ROM-startup eCos programinto Flash will overwrite the GDB Stub ROM/CygMon in Flash,so you would have to reload the GDB Stub ROM/CygMon toreturn to normal RAM-startup program development.</PARA></LISTITEM></ORDEREDLIST></SECT2><SECT2><TITLE>Building the Flash Downloader on Linux</TITLE><PARA>eCos provides a Flash download program suitable for use withthe EP7211 Development Board which will run on Linux. Follow thesesteps to build this program. Note: at the time of the writing ofthese instructions, the download program is built directly withinthe eCos source repository since it isnot configuration specific.</PARA><PROGRAMLISTING> # cd <eCos install dir>/packages/hal/arm/edb7xxx/<replaceable>&Version;</replaceable>/support</PROGRAMLISTING><PROGRAMLISTING> # make</PROGRAMLISTING><PARA>(where '# ' is your shell prompt)</PARA><PARA>Note: this program was adapted from the Cirrus Logic originalDOS program and still contains some vestiges of that environment.</PARA></SECT2><SECT2><TITLE>Developing eCos Programs with the ARM Multi-ICE</TITLE><PARA>The EP7211 Development Board supports use of the ARMMulti-processor EmbeddedICE(tm), also known as theMulti-ICE. Full instructions on how to install and use theMulti-ICE in conjunction with GDB are provided in the<EMPHASIS>"GNUPro Toolkit Reference for eCosARM/Thumb"</EMPHASIS> manual. However, the followingplatform-specific details should be noted.</PARA><PARA>You will need an ARM Multi-ICE Server configurationfile for the EP7211 Development Board. Here is a suggestedconfiguration file to use:</PARA><PROGRAMLISTING>======== File "720T.cfg" ========;Total IR length = 4[TITLE]Multi-ICE configuration for EP7211[TAP 0]ARM720T[TAPINFO]YES[Timing]Low=0High=0Adaptive=OFF==================================</PROGRAMLISTING><PARA>You must ensure that the board has the appropriate solderedconnections. For the EP7211 this involves connecting TEST0 and TEST1of the EP7211 to ground. To do this you must solder a wire fromground at JP33 to TP8 and TP9.</PARA><PARA>With respect to using multiple devices simultaneously, notethat the EP7211 is not ID sensitive.</PARA><PARA>If you wish to view diagnostic output from your program thatwas downloaded via the Multi-ICE, you will note that by defaultthe output on the serial line (as viewed by a terminal such as Hypertermin Windows, or cu in Unix) is in the form of GDB packets.</PARA><PARA>To get legible output, the solution is to set the "GDB Serialport" to a different device from the "Diagnostic serial port", andyou should use the Diagnostic serial port to view the diagnosticoutput.</PARA><PARA>Warning: The multi-ice-gdb-server will fail on startup ifthe board has not been both reset and awakened before running theserver. </PARA><PARA>To resolve this, it is necessary to free up the connectionfrom within the ARM Multi-ICE server itself. However when this happens,the next time you use GDB to load the program into the board, youwill see lots of "Readback did not match original data" messagesin the output of the multi-ice-gdb-server program. This indicatesyour program did not load correctly, and you should restart themulti-ice-gdb-server program, taking care to reset the board correctlybefore reconnecting. </PARA><PARA>As a reminder, you must specify --config-dialog to themulti-ice-gdb-server program to connect to the boardcorrectly. If you do not, the multi-ice-gdb-server programwill not be able to connect.</PARA></SECT2></SECT1><SECT1 ID="setup-arm-ep7212"><TITLE><!-- <conditionaltext> -->Cirrus Logic ARM EP7212 Development BoardHardware Setup</TITLE><PARA>The Cirrus Logic EP7212 Development Board is almost identicalto the EP7211 Development Board from a hardware setup viewpoint,and is based on the same port of eCos. Therefore the earlier documentationfor the EP7211 Development Board can be considered equivalent, butwith the following changes:</PARA><ITEMIZEDLIST><LISTITEM><PARA>The first serial port is silk screened as "UART 1" onthe EP7211 Development Board, but is silk screened as "Serial Port0" on the EP7212 Development Board. Similarly "UART 2" is silk screenedas "Serial Port 1" on the EP7212 Development Board.</PARA></LISTITEM><LISTITEM><PARA>JP2 (used to control reprogramming of the FLASH) is notsilkscreened with "Boot Enable".</PARA></LISTITEM><LISTITEM><PARA>To setup the EP7212 Development Board for use with theARM Multi-ICE JTAG debugging interface unit, it is necessary toconnect TEST0 and TEST1 of the EP7212 to ground. On the DevelopmentBoard, this is accomplished by placing shorting blocks on JP47 andJP48. When the shorting blocks are fitted, the board can only beoperated through the Multi-ICE - debugging over a serial line isnot possible.</PARA></LISTITEM><LISTITEM><PARA><!-- <conditionaltext> -->Pre-built GDB stubs areprovided in the directory<FILENAME>loaders/arm-edb7212</FILENAME> relative to theroot of your eCos installation</PARA></LISTITEM><LISTITEM><PARA>When rebuilding the GDB stub ROM image, change the "CirrusLogic processor variant" option (CYGHWR_HAL_ARM_EDB7XXX_VARIANT)from the EP7211 to the EP7212. This can be selected in the<EMPHASIS>eCos Configuration Tool</EMPHASIS>, or if using ecosconfig, can be set by uncommenting the user_valueproperty of this option in ecos.ecc and setting it to "EP7212".</PARA></LISTITEM></ITEMIZEDLIST></SECT1><SECT1 ID="setup-arm-ep7312"><TITLE><!-- <conditionaltext> -->Cirrus Logic ARM EP7312 Development BoardHardware Setup</TITLE><PARA>The Cirrus Logic EP7312 Development Board is similarto the EP7212 Development Board from a hardware setup viewpoint,and is based on the same port of eCos.</PARA><PARA>When rebuilding the RedBoot ROM image or an eCos application,change the "Cirrus Logic processor variant" option(CYGHWR_HAL_ARM_EDB7XXX_VARIANT)from the EP7211 to the EP7312. This can be selected in the<EMPHASIS>eCos Configuration Tool</EMPHASIS>, or if using ecosconfig, can be set by uncommenting the user_valueproperty of this option in ecos.ecc and setting it to "EP7312".</PARA><PARA>See the RedBoot documentation for building and installing RedBoot for thistarget. Only RedBoot is supported as a boot image; ROMRAM startup isrecommended.</PARA><SECT2 ID="ep7312-90MHz-operation"><TITLE>90MHz Operation</TITLE><PARA>The EP7xxx targets offer a choice of clock speeds, from 18MHz to a maximum,normally, of 72MHz. These are described as kHz values 18432 36864 49152and 73728 within the configuration tool. If you have a release whichsupports it, you will also see 90317 as an available option here, for 90MHzoperation.</PARA><PARA>This option only applies to certain EP7312 hardware, not all EP7312 boardssupport it. Do not select 90MHz when building RedBoot or your eCosapplication unless you are absolutely sure that your board supports it.</PARA><PARA>If you do have a 90MHz board and wish to execute at 90MHz, it is in factnot necessary to build RedBoot specially, if you build your eCosapplication configured for 90MHz. RedBoot will run at 72MHz and yourapplication will run at 90MHz. If you do install a 90MHz RedBoot, then youmust build eCos for 90MHz or timing and baud rates on serial I/O will bewrong.</PARA><PARA>In other words, code (either eCos app or RedBoot) built for 90MHz will“change up a gear” when it starts up; but code built for 72MHz,because it needs to run correctly on boards without the“gearbox” does not change back down, so if you mix the two,unexpected timing can result. To run a non-eCos application without anyhardware initialization code at 90MHz, you must install a specially-builtRedBoot.</PARA></SECT2></SECT1><SECT1 id="setup-arm-ep7209"><TITLE>Cirrus Logic ARM EP7209 Development Board Hardware Setup</TITLE><PARA>Note: At time of writing, no EP7209 Development Board is available,and consequently eCos has not been verified for use with the EP7209Development Board.</PARA><PARA>The Cirrus Logic EP7209 Development Board is almost identicalto the EP7212 Board in all respects, except that it is not fittedwith DRAM, nor has it a DRAM controller.</PARA><PARA>The only valid configuration for the EDB7209 is ROM based.The STUBS and RAM startup modes are not available as no DRAM isfitted.</PARA></SECT1><SECT1 id="setup-arm-clps7111"><TITLE><!-- <index></index> -->Cirrus Logic ARM CL-PS7111 Evaluation Board Hardware Setup</TITLE><PARA>The implementation of the port of eCos to the Cirrus LogicARM CL-PS7111 Evaluation Board (also known as EB7111) is based onthe EP7211 Development Board port.</PARA><PARA>For that reason, the setup required is identical to the EP7211Development Board as described above, with the following exceptions:</PARA><ITEMIZEDLIST><LISTITEM><PARA>The Cygmon ROM monitor is not supported</PARA></LISTITEM><LISTITEM><PARA>The ARM Multi-ICE is not supported</PARA></LISTITEM><LISTITEM><PARA><!-- <conditionaltext> -->Pre-built GDB stubs are provided in thedirectory loaders/arm-eb7111 relative to the root of youreCos installation</PARA></LISTITEM><LISTITEM><PARA>If rebuilding the GDB stub ROM image, change the "CirrusLogic processor variant" option (CYGHWR_HAL_ARM_EDB7XXX_VARIANT)from the EP7211 to the CL_PS7111. This can be selectedin the<EMPHASIS>eCos Configuration Tool</EMPHASIS>, or if using ecosconfig, can be set by uncommenting the user_valueproperty of this option in ecos.ecc and setting it to "CL_PS7111"</PARA></LISTITEM></ITEMIZEDLIST><PARA>All remote serial communication is done with the serial I/Oconnector</PARA><PROGRAMLISTING>/misc% slow_cat.tcl < [path]/gdb_module.srec > /dev/ttyS0</PROGRAMLISTING><PARA>Power off the board, and change it to boot the GDB stubs inbig-endian mode by setting the switches like this:</PARA><PARA>SW1: 00000000 (all levers down)SW2: 10001010</PARA><PARA>The GDB stubs allow communication with GDB using the serialport at connector PJ7A (lower connector). The communication parametersare fixed at 38400 baud, 8 data bits, no parity bit and 1 stopbit (8-N-1). No flow control is employed. Connection to the hostcomputer should be made using a straight through serial cable.</PARA></SECT1><SECT1 id="setup-arm-ebsa285"><TITLE>StrongARM EBSA-285 Hardware Setup</TITLE><PARA>The eCos Developer’s Kit package comes with a ROMimage which provides GDB support forthe Intel® StrongARM® Evaluation Board EBSA-285.Both eCos and the Stub ROM image assume the clocks are: 3.6864MHz PLL input for generating the core clock, and 50MHz osc inputfor external clocks. An image of this ROM is also provided at <filename>loaders/arm-ebsa285/gdbload.bin</filename> underthe root of your eCos installation.</PARA><PARA>The ROM monitor image (an eCos GDBstub) provided for the EBSA-285 board must be programmed into theflash, replacing the Angel monitor on the board. Please refer tothe section titled "Loading the ROM Image into On-Board flash" on howto program the ROM onto the board.</PARA><PARA>The Stub ROM allows communication with GDB via the serialconnector on the bulkhead mounting bracket COM0. The communicationparameters are fixed at 38400 baud, 8 data bits, no parity bit and1 stop bit (8-N-1). No flow control is employed.</PARA><SECT2><TITLE>Building the GDB Stub FLASH ROM images</TITLE><PARA>Pre-built GDB stubs images are provided in the directory loaders/arm-ebsa285 relativeto the root of your eCos installation, but here are instructionson how to rebuild them if you should ever need to.</PARA></SECT2><SECT2><TITLE>Building the GDB Stubs with the eCos Configuration Tool</TITLE><ORDEREDLIST><LISTITEM><PARA>Start with a new document - selecting the<EMPHASIS>File</EMPHASIS>-><EMPHASIS>New</EMPHASIS>menu item if necessary to do this.</PARA></LISTITEM><LISTITEM><PARA>Choose the<EMPHASIS>Build</EMPHASIS>-><EMPHASIS>Templates</EMPHASIS>menu item, and then select the StrongARM EBSA285 hardware.</PARA></LISTITEM><LISTITEM><PARA>While still displaying the<EMPHASIS>Build</EMPHASIS>-><EMPHASIS>Templates</EMPHASIS>dialog box, select the "stubs" package template to build a GDBstub image. Click<EMPHASIS>OK</EMPHASIS>.</PARA></LISTITEM><LISTITEM><PARA>Build eCos using<EMPHASIS>Build</EMPHASIS>-><EMPHASIS>Library</EMPHASIS></PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. The GDB stubROM images have the prefix "gdb_module".</PARA></LISTITEM></ORDEREDLIST></SECT2><SECT2><TITLE>Building the GDB Stub ROMs with ecosconfig</TITLE><PARA>(See “Using ecosconfig on UNIX” on page 72)</PARA><ORDEREDLIST><LISTITEM><PARA>Make an empty directory to contain the build tree,and cd into it.</PARA></LISTITEM><LISTITEM><PARA>To build a GDB stub ROM image, enter the command:<PROGRAMLISTING>$ ecosconfig new ebsa285 stubs</PROGRAMLISTING></PARA></LISTITEM><LISTITEM><PARA>Enter the commands:<PROGRAMLISTING>$ ecosconfig tree$ make</PROGRAMLISTING></PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. The GDB stubROM images have the prefix "gdb_module".</PARA></LISTITEM></ORDEREDLIST></SECT2><SECT2><TITLE>Loading the ROM Image into On-board Flash</TITLE><PARA>There are several ways to install the eCos gdb stub ROM imagein the EBSA board’s flash memory. Once installed, the gdbstub ROM provides standard eCos download and debug via the EBSAboard"s serial port. The options available include theLinux based EBSA flash upgrade utility provided by Red Hat, direct writingof the flash via MultiICE (JTAG) hardware debugger, and other flash managementutilities from Intel (these only support DOS, and proprietary ARM toolsand image formats). Only the Red Hat flash upgrade tool is supportedand tested in this release.</PARA><PARA>The flash upgrade tool requires the EBSA board to be configuredas a PCI slave (rather than a master, its normal operating mode)and plugged into a Linux host computer"s PCI bus.</PARA><PARA>Configuring the board for flash loading: Follow the instructionsin the EBSA-285 Reference Manual, pages A-2 and A-3 to configurethe board as an add-in card, and enable flash blank programming.Briefly: assuming the board was in the default setting to executeas a bus master ("Host Bridge") make jumper 9 (J9), move jumper10 (J10) to external reset (PCI_RST), and move jumper 15(J15) link 4-6-5 to connect 5-6 instead of 4-6.</PARA><PARA>Configuring the board for execution of eCos programs: Followthe instructions in the EBSA-285 Reference Manual, pages A-2 andA-3 to configure the board as a "Host Bridge" with "Central Function".Briefly: unset J9, move J10 to on-board reset (BRD_RST),and set J15 to make 4-6 instead of 5-6 (see page A-8 also). Plugthe card into its own PCI bus, not the Linux PC used for the flash-programmingprocess.</PARA><PARA>Building the Linux software: the Linux software sources arein directory</PARA><PROGRAMLISTING> <BASE_DIR>/packages/hal/arm/ebsa285/v1_3/support/linux/safl_util</PROGRAMLISTING><PARA>in the eCos source repository. There are two parts to thesystem: a loadable kernel module and the flash utility. The loadablekernel module is safl.o and the utility is sa_flash. Tobuild:</PARA><PARA> cd to this directory, or a copy of it.</PARA><PARA> make</PARA><PARA>This builds safl.o and sa_flash. The kernel modulemust be installed, and a device file created for it. Both of theseoperations require root permissions. Create the device file by: </PARA><PROGRAMLISTING> % mknod /dev/safl c 10 178</PROGRAMLISTING><PARA>Programming the flash: switch off the EBSA-285, and removethe EBSA-285 board from its PCI bus. Take appropriate anti-staticprecautions. Configure it for flash loading as above, halt yourLinux system and turn it off. Install the EBSA-285 board in thePCI bus of the Linux system and boot it up. (Single user is good enough,assuming your image and safl_util build dir are on a localdisc partition.) Change directory to the safl_util directory,then, to load the kernel module and flash an image onto the evalboard (as root): </PARA><PROGRAMLISTING> % insmod safl.o% sa_flash <image_file></PROGRAMLISTING><PARA>Halt and turn off the Linux machine and remove the EBSA-285card. Take appropriate anti-static precautions. Configure it forexecution of eCos programs as above, and plug it into its own PCIbus. Restart the Linux machine however you wish.</PARA><PARA>This information is replicated in the README file within thesafl_util directory and its parents, and in the EBSA-285Reference Manual from Intel, appendix A "Configuration Guide".If in doubt, please refer to those documents also.</PARA><PARA>This procedure also applies for loading ROM-startup eCos programsinto the on-board flash memory, given a binary format image of theprogram from arm-elf-objcopy. Loading a ROM-startup eCos programinto flash will overwrite the StubROM in flash, so you would haveto reload the StubROM to return to normal RAM-startup program development.</PARA></SECT2><SECT2><TITLE>Running your eCos Program Using GDB and the StubROM</TITLE><NOTE><PARA>You must first load the StubROM image into the flash memoryon the EBSA-285 board before doing this. See “Loadingthe ROM Image into On-board Flash”, page 93 for details.</PARA></NOTE><PARA>Connect to the StubROM in the board and run your eCos program <PROGRAM> as</PARA><PARA>follows:</PARA><PROGRAMLISTING> $ arm-elf-gdb -nw <PROGRAM>(gdb) set remotebaud 38400(gdb) target remote <DEVICE></PROGRAMLISTING><PARA>Where <DEVICE> is /dev/ttyS0or COM1: or similar, depending on your environment and how you connectedyour serial line to the host computer. Expect some output here,for example:</PARA><PROGRAMLISTING> Remote debugging using /dev/ttyS00x410026a4 in ?? ()</PROGRAMLISTING><PARA>then, to load the program</PARA><PROGRAMLISTING> (gdb) load</PROGRAMLISTING><PARA>which will report locations and sizes of sections as theyload, then begin execution using</PARA><PROGRAMLISTING> (gdb) continue</PROGRAMLISTING><PARA>If you have no eCos program yet, but you want to connect tothe board just to verify serial communications, tell gdb "set endianlittle" before anything else, so that it understands the board (GDBnormally infers this from information within the eCos program).</PARA><NOTE><PARA>When an eCos program is run on the EBSA-285 board, the GDBstub in ROM loses control. This means that if you require the abilityto stop execution on the target remotely, or want thread debuggingcapabilities, you must include GDB stub support when configuring<PRODUCTNAME>eCos</PRODUCTNAME>.</PARA></NOTE></SECT2></SECT1><SECT1 id="setup-arm-ipaq"><TITLE><!-- <conditionaltext> --> <!-- NOTE: could not find it --><!-- <index></index> -->Compaq iPAQ PocketPC Hardware Setup</TITLE><PARA>For setting up the iPAQ to run with RedBoot, see the the <EMPHASIS>RedBootUser's Guide</EMPHASIS>. Connections may be made usingthe Compact Flash Ethernet interface. A serial cable may be connecteddirectly, or via the cradle. Serial communication uses the parameters38400,8,N,1. The LCD/Touchscreen may also be used as aninterface to RedBoot and eCos applications.</PARA></SECT1><SECT1 id="setup-sh-edk7708"><TITLE>SH3/EDK7708 Hardware Setup</TITLE><PARA>The eCos Developer’s Kit package comes with a ROMwhich provides GDB support for the Hitachi EDK7708 board (a big-endianand a little-endian version). Images of these ROMs are also providedat <filename>loaders/sh-edk7708/gdbload.bin</filename> and<filename>loaders/sh-edk7708le/gdbload.bin</filename> underthe root of your eCos installation.</PARA><PARA>The ROM is installed to socket U6 on the board. When usingthe big-endian ROM, jumper 9 must be set to 2-3. When using thelittle-endian ROM, jumper 9 must be set to 1-2. Attention shouldbe paid to the correct orientation of the ROM during installation.Only replace the board"s existing ROM using a proper PLCC extractiontool, as the socket would otherwise risk being damaged. </PARA><PARA>If you are going to program a new ROM or FLASH using the binaryimage, you may have to experiment to get the right byte-order inthe device. Depending on the programming software you use, it mightbe necessary to enable byte-swapping. If the GDB stub ROM/FLASHyou program does not work, try reversing the byte-order.</PARA><PARA>The GDB stub in the EPROM allows communication with GDB usingthe serial port at connector J1. The communication parameters arefixed at 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 the dedicated serial cable included in the EDK package. </PARA><SECT2><TITLE>Installing the Stubs into FLASH</TITLE><SECT3><TITLE>Preparing the Binaries</TITLE><PARA>These two binary preparation steps are not strictly necessaryas the eCos distribution ships with pre-compiled binaries in thedirectory loaders/sh-edk7708 and loaders/sh-edk7708lerelative to the installation root.</PARA><SECT4><TITLE>Building the ROM images 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 SH EDK7708 hardware.</PARA></LISTITEM><LISTITEM><PARA>While still displaying the<EMPHASIS>Build->Templates</EMPHASIS>dialog box, select the “stubs” package templateto build a GDB stub. Click<EMPHASIS>OK</EMPHASIS>.</PARA></LISTITEM><LISTITEM><PARA>If building a little-endian image, disable the “Usebig-endian mode” option in the SH EDK7708 HAL (CYGHWR_HAL_SH_BIGENDIAN).</PARA></LISTITEM><LISTITEM><PARA>Build eCos using<EMPHASIS>Build->Library</EMPHASIS>. </PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. GDB stubROM images have the prefix “gdb_module”.</PARA></LISTITEM></ORDEREDLIST></SECT4><SECT4><TITLE>Building the ROM images with ecosconfig</TITLE><ORDEREDLIST><LISTITEM><PARA>Make an empty directory to contain the build tree,and cd into it.</PARA></LISTITEM><LISTITEM><PARA>To build a GDB stub ROM image, enter the command:<PROGRAMLISTING>$ ecosconfig new edk7708 stubs</PROGRAMLISTING></PARA></LISTITEM><LISTITEM><PARA>If building a little-endian image, uncomment the uservalue in ecos.ecc for CYGHWR_HAL_SH_BIGENDIANand change it to 0. </PARA></LISTITEM><LISTITEM><PARA>Enter the commands:<PROGRAMLISTING>$ ecosconfig tree$ make </PROGRAMLISTING></PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. GDB stubROM images have the prefix “gdb_module”.</PARA></LISTITEM></ORDEREDLIST></SECT4></SECT3><SECT3><TITLE> Installing the Stubs into ROM or FLASH</TITLE><ORDEREDLIST><LISTITEM><PARA>Program the binary image file gdb_module.bininto ROM or FLASH referring to the instructions of your ROM programmer.</PARA></LISTITEM><LISTITEM><PARA>Plug the ROM/FLASH into socket U6. If the imageis little-endian set jumper 9 to 1-2. If the image is big-endianset jumper 9 to 2-3.</PARA></LISTITEM></ORDEREDLIST></SECT3></SECT2></SECT1><SECT1 id="setup-sh-cq7708"><TITLE>SH3/CQ7708 Hardware Setup</TITLE><SECT2><TITLE>Preparing the board</TITLE><PARA>Make sure the DIP switches on the board are set as follows:</PARA><PROGRAMLISTING>SW1-1 ONSW1-2 OFFSW1-3 ONSW1-4 OFF</PROGRAMLISTING><PROGRAMLISTING>SW2-1 ONSW2-2 ONSW2-3 OFFSW2-4 OFF</PROGRAMLISTING><PARA>If you are using a straight through serial cable which hasflow control lines, you will also need to cut JP12 (5-6) as theflow control lines can cause NMIs.</PARA></SECT2><SECT2><TITLE>eCos GDB Stubs</TITLE><PARA>The eCos installation CD contains a copy of the eCos GDB stubsin binary format which must be programmed into an EPROM or FLASHand installed on the board.</PARA><SECT3><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 directoryloaders/sh3-cq7708 relative to the installation root.</PARA></SECT3><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 SH3 cq7708 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><PARA> Build eCos stubs using<EMPHASIS>Build->Library</EMPHASIS>.</PARA></LISTITEM><LISTITEM><PARA> When the build completes, the image files can be foundin the<FILENAME>bin/</FILENAME>subdirectory of the install tree. GDB stub images have the prefix<FILENAME>gdb_module</FILENAME>.</PARA></LISTITEM></ORDEREDLIST></SECT3><SECT3><TITLE> Building the GDB stub image with ecosconfig</TITLE><ORDEREDLIST><LISTITEM><PARA>Make an empty directory to contain the build tree,and cd into it.</PARA></LISTITEM><LISTITEM><PARA> To build a GDB stub ROM image, enter the command:<PROGRAMLISTING>$ ecosconfig new cq7708 stubs </PROGRAMLISTING></PARA></LISTITEM><LISTITEM><PARA> Enter the commands:<PROGRAMLISTING>$ ecosconfig tree$ make</PROGRAMLISTING></PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the<FILENAME>bin/</FILENAME>subdirectory of the install tree. GDB stub images have the prefix<FILENAME>gdb_module</FILENAME>. </PARA></LISTITEM></ORDEREDLIST></SECT3></SECT2><SECT2><TITLE>Programming the stubs in EPROM/FLASH</TITLE><PARA>The board can use different sizes of ROMs. Use this tableto adjust the board’s jumpers to the ROM sizes you areusing.</PARA><PROGRAMLISTING>size(kbit) JP7 JP9 JP10 JP11256 2-3 2-3 open open512 1-2 2-3 open open1000 1-2 open open 2-32000 1-2 1-2 open 2-34000 1-2 1-2 short 2-38000 1-2 1-2 short 1-2</PROGRAMLISTING><PARA>There are two ways to program the stubs. We advise you touse method 1, since it is simpler. Method 2 is unsupported and requiresa bit of fiddling.</PARA><PARA><EMPHASIS>Method 1: </EMPHASIS> </PARA><PARA>Program the binary stub image into two EPROMs, E and O. EPROME should contain the even bytes, and O the odd bytes (your EPROMprogrammer should have the ability to split the image).</PARA><PARA>EPROM E should be installed in socket IC8, and EPROM O shouldbe installed in socket IC4.</PARA><PARA>Set JP6 to 16 bit mode (1-2 soldered, 2-3 cut) Set SW1-4to ON and SW2-1 to OFF.</PARA><PARA></PARA><PARA><EMPHASIS>Method2: </EMPHASIS> </PARA><PARA>Assuming that the stub binary is smaller than 32 KB, you caninstall it in a single EPROM.</PARA><PARA>Compile the <FILENAME>mkcqrom.c</FILENAME> programfound in the <FILENAME>misc</FILENAME> directory.</PARA><PARA>Use it to convert the binary image to the required format.See the <FILENAME>mkcqrom.c</FILENAME> source for adescription of what is done, and why it is necessary. </PARA><PROGRAMLISTING> % mkcqrom gdb_module.bin gdb_mangled.bin</PROGRAMLISTING><PARA>Program the <FILENAME>gdb_mangled.bin</FILENAME> fileinto an EPROM and install it in socket IC4</PARA><PARA>Set JP6 to 8 bit mode (cut 1-2, solder 2-3)</PARA><PARA>The GDB stubs allow communication with GDB using the serialport at connector CN7. The communication parameters are fixed at38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). Noflow control is employed. Connection to the host computer shouldbe made using a straight through serial cable.</PARA></SECT2></SECT1><SECT1 id="setup-sh-hs7729pci"><TITLE>SH3/HS7729PCI Hardware Setup</TITLE><PARA>Please see the RedBoot manual for instructions on how to preparethe board for use with eCos.</PARA></SECT1><SECT1 id="setup-sh-se77x9"><TITLE>SH3/SE77x9 Hardware Setup</TITLE><PARA>Please see the RedBoot manual for instructions on how to preparethe board for use with eCos.</PARA></SECT1><SECT1 id="setup-sh-cq7750"><TITLE>SH4/CQ7750 Hardware Setup</TITLE><SECT2><TITLE>Preparing the board</TITLE><PARA>Make sure the DIP switches on the board are set as follows:</PARA><PROGRAMLISTING>SW1-1 ONSW1-2 OFFSW1-3 ONSW1-4 OFF</PROGRAMLISTING><PROGRAMLISTING>SW2-1 ONSW2-2 ONSW2-3 OFFSW2-4 OFF</PROGRAMLISTING><PARA>If you are using a straight through serial cable which hasflow control lines, you will also need to cut JP12 (5-6) as theflow control lines can cause NMIs.</PARA></SECT2><SECT2><TITLE>eCos GDB Stubs</TITLE><PARA>The eCos installation CD contains a copy of the eCos GDB stubsin binary format which must be programmed into an EPROM or FLASHand installed on the board.</PARA><SECT3><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 directoryloaders/sh3-cq7708 relative to the installation root.</PARA></SECT3><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 SH3 cq7708 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><PARA> Build eCos stubs using<EMPHASIS>Build->Library</EMPHASIS>.</PARA></LISTITEM><LISTITEM><PARA> When the build completes, the image files can be foundin the<FILENAME>bin/</FILENAME>subdirectory of the install tree. GDB stub images have the prefix<FILENAME>gdb_module</FILENAME>.</PARA></LISTITEM></ORDEREDLIST></SECT3><SECT3><TITLE> Building the GDB stub image with ecosconfig</TITLE><ORDEREDLIST><LISTITEM><PARA>Make an empty directory to contain the build tree,and cd into it.</PARA></LISTITEM><LISTITEM><PARA> To build a GDB stub ROM image, enter the command:<PROGRAMLISTING>$ ecosconfig new cq7708 stubs </PROGRAMLISTING></PARA></LISTITEM><LISTITEM><PARA> Enter the commands:<PROGRAMLISTING>$ ecosconfig tree$ make</PROGRAMLISTING></PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the<filename>bin/</filename>subdirectory of the install tree. GDB stub images have the prefix<filename>gdb_module</filename>. </PARA></LISTITEM></ORDEREDLIST></SECT3></SECT2><SECT2><TITLE>Programming the stubs in EPROM/FLASH</TITLE><PARA>The board can use different sizes of ROMs. Use this tableto adjust the board’s jumpers to the ROM sizes you areusing.</PARA><PROGRAMLISTING>size(kbit) JP7 JP9 JP10 JP11256 2-3 2-3 open open512 1-2 2-3 open open1000 1-2 open open 2-32000 1-2 1-2 open 2-34000 1-2 1-2 short 2-38000 1-2 1-2 short 1-2</PROGRAMLISTING><PARA>There are two ways to program the stubs. We advise you touse method 1, since it is simpler. Method 2 is unsupported and requiresa bit of fiddling.</PARA><PARA><EMPHASIS>Method 1: </EMPHASIS> </PARA><PARA>Program the binary stub image into two EPROMs, E and O. EPROME should contain the even bytes, and O the odd bytes (your EPROMprogrammer should have the ability to split the image).</PARA><PARA>EPROM E should be installed in socket IC8, and EPROM O shouldbe installed in socket IC4.</PARA><PARA>Set JP6 to 16 bit mode (1-2 soldered, 2-3 cut) Set SW1-4to ON and SW2-1 to OFF.</PARA><PARA></PARA><PARA><EMPHASIS>Method2: </EMPHASIS> </PARA><PARA>Assuming that the stub binary is smaller than 32 KB, you caninstall it in a single EPROM.</PARA><PARA>Compile the <filename>mkcqrom.c</filename> programfound in the <FILENAME>misc</FILENAME> directory.</PARA><PARA>Use it to convert the binary image to the required format.See the <FILENAME>mkcqrom.c</FILENAME> source for adescription of what is done, and why it is necessary. </PARA><PROGRAMLISTING> % mkcqrom gdb_module.bin gdb_mangled.bin</PROGRAMLISTING><PARA>Program the <FILENAME>gdb_mangled.bin</FILENAME> fileinto an EPROM and install it in socket IC4</PARA><PARA>Set JP6 to 8 bit mode (cut 1-2, solder 2-3)</PARA><PARA>The GDB stubs allow communication with GDB using the serialport at connector CN7. The communication parameters are fixed at38400 baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). Noflow control is employed. Connection to the host computer shouldbe made using a straight through serial cable.</PARA></SECT2></SECT1><SECT1 id="setup-sh-se7751"><TITLE>SH4/SE7751 Hardware Setup</TITLE><PARA>Please see the RedBoot manual for instructions on how to preparethe board for use with eCos.</PARA></SECT1><SECT1 id="setup-v850-cebsa1"><TITLE>NEC CEB-V850/SA1 Hardware Setup</TITLE><PARA>The CEB-V850 board is fitted with a socketed EPROM. The internalFlash of the V850 supplied with the CEB-V850 boards defaults tovectoring into this EPROM. A GDB stub image should be programmedinto an EPROM fitted to this board, and a pre-built image is providedat <FILENAME>loaders/v850-ceb_v850/v850sa1/gdb_module.bin </FILENAME>underthe root of your eCos installation.</PARA><PARA>The EPROM is installed to the socket labelled U7 on the board.Attention should be paid to the correct orientation of the EPROMduring installation. </PARA><PARA>When programming an EPROM using the binary image, be carefulto get the byte order correct. It needs to be little-endian. Ifthe EPROM burner software has a hex-editor, check that the firstfew bytes of the image look similar to: </PARA><PROGRAMLISTING>00000000: 0018 8007 5e02 0000 0000 0000 0000 0000</PROGRAMLISTING><PARA>If the byte order is wrong you will see 1800 instead of 0018etc. Use the EPROM burner software to make a byte-swap before youburn to image to the EPROM. </PARA><PARA>If the GDB stub EPROM you burn does not work, try reversingthe byte-order, even if you think you have it the right way around.At least one DOS-based EPROM burner program is known to have thebyte-order upside down.</PARA><PARA>The GDB stub in the EPROM allows communication with GDB usingthe serial port. The communication parameters are fixed at 38400baud, 8 data bits, no parity bit and 1 stop bit (8-N-1). No flowcontrol is employed. Connection to the host computer should be madeusing a dedicated serial cable as specified in the CEB-V850/SA1manual.</PARA><SECT2><TITLE>Installing the Stubs into ROM</TITLE><SECT3><TITLE>Preparing the Binaries</TITLE><PARA>These two binary preparation steps are not strictly necessaryas the eCos distribution ships with pre-compiled binaries in thedirectory loaders/v850-ceb_v850 relative to theinstallation root.</PARA><SECT4><TITLE>Building the ROM images 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 NEC CEB-V850/SA1 hardware.</PARA></LISTITEM><LISTITEM><PARA>While still displaying the<EMPHASIS>Build->Templates</EMPHASIS>dialog box, select the “stubs” package templateto build a GDB stub. Click<EMPHASIS>OK</EMPHASIS>.</PARA></LISTITEM><LISTITEM><PARA>Build eCos using<EMPHASIS>Build->Library</EMPHASIS>. </PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. GDB stubROM images have the prefix “gdb_module”.</PARA></LISTITEM></ORDEREDLIST></SECT4><SECT4><TITLE>Building the ROM images with ecosconfig</TITLE><ORDEREDLIST><LISTITEM><PARA>Make an empty directory to contain the build tree,and cd into it. </PARA></LISTITEM><LISTITEM><PARA>To build a GDB stub ROM image, enter the command:<PROGRAMLISTING>$ ecosconfig new ceb-v850 stubs </PROGRAMLISTING></PARA></LISTITEM><LISTITEM><PARA>Enter the commands:<PROGRAMLISTING>$ ecosconfig tree$ make</PROGRAMLISTING></PARA></LISTITEM><LISTITEM><PARA>When the build completes, the image files can be foundin the bin/ subdirectory of the install tree. GDB stubROM images have the prefix “gdb_module”.</PARA></LISTITEM></ORDEREDLIST></SECT4></SECT3><SECT3><TITLE> Installing the Stubs into ROM or FLASH</TITLE><ORDEREDLIST><LISTITEM><PARA> Program the binary image file gdb_module.bininto ROM or FLASH referring to the instructions of your ROMprogrammer. </PARA></LISTITEM><LISTITEM><PARA> Plug the ROM/FLASH into the socket as describedat the beginning of this section.</PARA></LISTITEM></ORDEREDLIST></SECT3></SECT2><SECT2><TITLE>Debugging with the NEC V850 I.C.E.</TITLE><PARA>eCos applications may be debugged using the NEC V850 In CircuitEmulator (I.C.E.) A PC running Microsoft Windows is required inorder to run the NEC ICE software and drivers. In addition Red Hathave developed a “libremote” server applicationnamed v850ice.exe which is used on the PC connected to the I.C.E.in order to allow connections from GDB.</PARA><PARA>The I.C.E. must be physically connected to a Windows NT systemthrough NEC"s PCI or PC Card interface. A driver, DLLs,and application are provided by NEC to control the I.C.E.</PARA><PARA>v850ice is a Cygwin based server that runs on the NT systemand provides an interface between the gdb client and the I.C.E.software. v850-elf-gdb may be run on the Windows NT system or ona remote system. v850-elf-gdb communicates with the libremote serverusing the gdb remote protocol over a TCP/IP socket. v850icecommunicates with the I.C.E. by calling functions in the NECMSG.DLL providedby NEC.</PARA><SECT3><TITLE>INITIAL SETUP</TITLE><ORDEREDLIST><LISTITEM><PARA>Configure the hardware including the I.C.E., SA1 orSB1 Option Module, and target board. Install the interface cardin the Windows NT system. Reference NEC"s documentationfor interface installation, jumper settings, etc.</PARA></LISTITEM><LISTITEM><PARA>Install the Windows NT device driver provided by NEC.</PARA></LISTITEM><LISTITEM><PARA>Copy the NEC DLLs, MDI application, and other supportfiles to a directory on the Windows NT system. The standard locationis C:\NecTools32. This directory will be referred to asthe "libremote server directory" in this document. v850ice.exe mustalso be copied to this directory after being built. The requiredfiles are: cpu.cfg, Nec.cfg, MDI.EXE, NECMSG.DLL, EX85032.DLL,V850E.DLL, IE850.MON, IE850E.MON, and D3037A.800.</PARA></LISTITEM><LISTITEM><PARA>Make certain the file cpu.cfg contains the line:</PARA><PROGRAMLISTING>CpuOption=SA1</PROGRAMLISTING><PARA>if using a V850/SA1 module, or:</PARA><PROGRAMLISTING>CpuOption=SB1</PROGRAMLISTING><PARA>if using a V850/SB1 module.</PARA></LISTITEM><LISTITEM><PARA>Set the environment variable IEPATH to point to the libremoteserver</PARA><PARA>directory.</PARA></LISTITEM></ORDEREDLIST></SECT3><SECT3><TITLE>BUILD PROCEDURES</TITLE><PARA>A pre-built v850ice.exe executable is supplied in the loaders/v850-ceb_v850 directoryrelative to the root of the eCos installation. However the following processwill allow the rebuilding of this executable if required:</PARA><PARA>For this example assume the v850ice libremote tree has beencopied to a directory named "server". The directory structure willbe similar to the following diagram:</PARA><PARA><PROGRAMLISTING> server|devo/ \config libremote/ \lib v850ice</PROGRAMLISTING></PARA><PARA>Build the v850ice source as follows. Be sure to use the nativeCygwin compiler tools that were supplied alongside eCos.</PARA><PARA>cd servermkdir buildcd build../devo/configure --target=v850-elf --host=i686-pc-cygwinmake</PARA><PARA>The resultant libremote server image (v850ice.exe) can befound in build/libremote/v850ice. Copy v850ice.exeto the lib remote server directory.</PARA></SECT3><SECT3><TITLE>V850ICE.EXE EXECUTION</TITLE><PARA>The v850ice command line syntax is:</PARA><PARA>v850ice [-d] [-t addr] [port number]</PARA><PARA>The optional -d option enables debug output. The -t optionis associated with thread debugging - see the "eCos thread debugging"section below for details. By default v850ice listens on port 2345for an attach request from a gdb client. A different port numbermay be specified on the command line.</PARA><PARA>To run the libremote server:</PARA><ORDEREDLIST><LISTITEM><PARA>Power on the I.C.E. and target board.</PARA></LISTITEM><LISTITEM><PARA>Open a Cygwin window.</PARA></LISTITEM><LISTITEM><PARA>Run v850ice.</PARA></LISTITEM><LISTITEM><PARA>You will see the MDI interface window appear. In thiswindow you should see the "Connected to In-Circuit Emulator" message.In the Cygwin window, the libremote server will indicate it isready to accept a gdb client connection with the message "v850ice:listening on port 2345."</PARA></LISTITEM></ORDEREDLIST></SECT3><SECT3><TITLE>V850-ELF-GDB EXECUTION</TITLE><PARA>Run the v850-elf-gdb client to debug the V850 target. Itis necessary to issue certain configuration commands to the I.C.E.software. These commands may be issued directly in the MDI windowor they may be issued from the gdb client through the "monitor"command.</PARA><PARA>On the Cosmo CEB-V850 board, on-chip Flash is mapped at address0x0, the on-board EPROM at 0x100000 and the on-board RAM at 0xfc0000.Since a stand alone V850 will start executing from address 0x0 onreset, it is normal to load either an application or a bootstraploader for Flash at this address. eCos programs may be built toboot from Flash or the on-board EPROM. If building for the on-boardEPROM, it would be expected that the Flash will contain the defaultCEB-V850 flash contents. An ELF format version of the default contentsmay be found in the eCos distribution with the name v850flash.img.</PARA><PARA>In stand alone operation, normally the code in this flash imagewould have been programmed into the V850 on the Cosmo board, andthis would cause it to vector into the on-board EPROM to run theapplication located there. In the case of eCos, this applicationmay be a GDB stub ROM application, allowing the further downloadto RAM over serial of actual applications to debug.</PARA><PARA>As an example, we shall demonstrate how to use the I.C.E.to download the v850flash.img and GDB stub EPROM image using I.C.E.emulator memory only, and not requiring any actual programming ofdevices.</PARA><PARA>v850-elf-gdb -nw(gdb) file v850flash.img(gdb) target remote localhost:2345(gdb) monitor reset(gdb) monitor cpu r=256 a=16(gdb) monitor map r=0x100000-L 0x80000(gdb) monitor map u=0xfc0000-L 0x40000(gdb) monitor pinmask k(gdb) monitor step(gdb) monitor step(gdb) monitor step(gdb) monitor step(gdb) load(gdb) detach(gdb) file gdb_module.img(gdb) target remote localhost:2345(gdb) load(gdb) continue</PARA><PARA>NOTE: The four "monitor step" commands are only required thefirst time the board is connected to the I.C.E., otherwise the programwill fail.</PARA><PARA>This is because of a limitation of the I.C.E. hardware thatmeans that the first time it is used, the "map" commands are notacted on and the addresses "0x100000" and "0xfc0000" are not mapped.This can be observed using the command "td e-20" in the MDI application"sconsole to display the trace buffer, which will show that the contentsof address 0x100000 are not valid. Subsequent runs do not requirethe "monitor step" commands.</PARA><PARA>It is unusual to load two executable images to a target throughgdb. From the example above notice that this is accomplished byattaching to the libremote server, loading the flash image, detaching,reattaching, and loading the ROM/RAM image. It is morenormal to build an executable image that can be executed directly.In eCos this is achieved by selecting either the ROM or ROMRAM startuptype, and optionally enable building for the internal FLASH. TheI.C.E. emulator memory can emulate both the internal FLASH and theEPROM, so real hardware programming is not required.</PARA><PARA>Upon running this example you will notice that the libremoteserver does not exit upon detecting a detach request, but simplybegins listening for the next attach request. To cause v850iceto terminate, issue the "monitor quit" or "monitor exit" commandfrom the gdb client. v850ice will then terminate with the nextdetach request. (You can also enter control-c in the Cygwin/DOSwindow where v850ice is running.)</PARA></SECT3><SECT3><TITLE>MDI INTERFACE VS. GDB INTERFACE</TITLE><PARA>If a filename is referenced in an MDI command, whether thecommand is entered in the MDI window or issued from the gdb clientwith the monitor command, the file must reside on the Windows NTlibremote server system. When specifying a filename when enteringa command in the MDI window it is obvious that a server local fileis being referenced. When issuing an MDI command from the gdb client, theuser must remember that the command line is simply passed to theI.C.E. software on the server system. The command is executed bythe I.C.E. software as though it were entered locally.</PARA><PARA>Executable images may be loaded into the V850 target by enteringthe "load" command in the MDI window or with the gdb "load" command.If the MDI load command is used, the executable image must be locatedon the server system and must be in S Record format. If the gdbload command is used, the executable image must be located on theclient system and must be in ELF format.</PARA><PARA>Be aware that the gdb client is not aware of debugger commandsissued from the MDI window. It is possible to cause the gdb clientand the I.C.E. software to get out of sync by issuing commands fromboth interfaces during the same debugging session.</PARA></SECT3><SECT3><TITLE>eCos THREAD DEBUGGING</TITLE><PARA>eCos and the V850 I.C.E. libremote server have been writtento work together to allow debugging of eCos threads. This is anoptional feature, disabled by default because of the overheads tryingto detect a threaded program involves.</PARA><PARA>Obviously thread debugging is not possible for programs with"RAM" startup type, as they are expected to operate underneath aseparate ROM monitor (such as a GDB stub ROM), that itself wouldprovide its own thread debugging capabilities over the serial line.Thread debugging is relevant only for programs built for Flash, ROM,or ROMRAM startup.</PARA><PARA>To configure the libremote server to support thread debugging,use the command:</PARA><PARA><PROGRAMLISTING>(gdb) monitor syscallinfo ADDRESS</PROGRAMLISTING></PARA><PARA>at the GDB console prompt, where ADDRESS is the address ofthe syscall information structure included in the applications.In eCos this has been designed to be located at a consistent addressfor each CPU model (V850/SA1 or V850/SB1). Itmay be determined from an eCos executable using the following commandat a cygwin bash prompt:</PARA><PARA><PROGRAMLISTING>v850-elf-nm EXECUTABLE | grep hal_v85x_ice_syscall_info</PROGRAMLISTING></PARA><PARA>At the current time, this address is 0xfc0400 for a Cosmoboard fitted with a V850/SA1, or 0xfc0540 for a Cosmo boardfitted with a V850/SB1.</PARA><PARA>So for example, the GDB command for the SB1 would be:</PARA><PARA><PROGRAMLISTING>(gdb) monitor syscallinfo 0xfc0540</PROGRAMLISTING></PARA><PARA>Given that the syscallinfo address is fixed over all eCosexecutables for a given target, it is possible to define it on thelibremote command line as well using the "-t" option, for example:</PARA><PARA><PROGRAMLISTING>bash$ v850ice -t 0xfc0400v850ice: listening on port 2345</PROGRAMLISTING></PARA></SECT3></SECT2></SECT1><SECT1 id="setup-v850-cebsb1"><TITLE>NEC CEB-V850/SB1 Hardware Setup</TITLE><PARA>The instructions for setting up the CEB-V850/SB1are virtually identical to those of the CEB-V850/SA1 above.The only significant differences are that pre-built loaders are availableat loaders/v850-ceb_v850/v850sb1 withinthe eCos installation. Binaries supporting boards with both 16MHzand 8MHz clock speeds are supplied. Also when building applications,or rebuilding the stubs for a V850/SB1 target, then theV850 CPU variant must be changed in the CEB-V850 HAL to the SB1.</PARA></SECT1><SECT1 id="setup-i386-pc"><TITLE>i386 PC Hardware Setup</TITLE><para>eCos application on the PC can be run in three ways: via RedBoot,loaded directly from a floppy disk, or loaded by the GRUB bootloader.</para><sect2><title>RedBoot Support</title><PARA>For information about setting up the PC to run with RedBoot,consult the RedBoot User"s Guide. If using serial debugging,the serial line runs at 38400 baud 8-N-1 and should be connectedto the debug host using a null modem cable. If ethernet debuggingis required, an i82559 compatible network interface card, such asan Intel EtherExpress Pro 10/100, should be installedon the target PC and connected to the development PC running GDB.When RedBoot is configured appropriately to have an IP address set,then GDB will be able to debug directly over TCP/IP to thetarget PC.</PARA></sect2><sect2><title>Floppy Disk Support</title><para>If an application is built with a startup type of FLOPPY, then it isconfigured to be a self-booting image that must be written onto aformatted floppy disk. This will erase any existing file system ordata that is already on the disk, so proceedwith caution.</para><para>To write an application to floppy disk, it must first be converted toa pure binary format. This is done with the following command:</para><screen width=72>$ <userinput>i386-elf-objcopy -O binary app.elf app.bin</userinput></screen><para>Here <filename>app.elf</filename> is the final linked applicationexecutable, in ELF format (it may not have a <filename>.elf</filename>extension). The file <filename>app.bin</filename> is the resultingpure binary file. This must be written to the floppy disk with thefollowing command:<screen width=72>$ <userinput>dd conv=sync if=app.bin of=/dev/fd0</userinput></screen></para><para>For NT Cygwin users, this can be done by first ensuring that the rawfloppy device is mounted as <filename>/dev/fd0</filename>. To check if thisis the case, type the command <command>mount</command> at the Cygwin bashprompt. If the floppy drive is already mounted, it will be listed as somethingsimilar to the following line:</para><screen> \\.\a: /dev/fd0 user binmode</screen><para>If this line is not listed, then mount the floppy drive using the command:</para><screen>$ <userinput>mount -f -b //./a: /dev/fd0</userinput></screen><para>To actually install the boot image on the floppy, use the command:</para><screen>$ <userinput>dd conv=sync if=app.bin of=/dev/fd0</userinput></screen><para>Insert this floppy in the A: drive of the PC to be used as a targetand ensure that the BIOS is configured to boot from A: by default. On reset,the PC will boot from the floppy and the eCos application will loaditself and execute immediately.</para><note><title>NOTE</title><para>Unreliable floppy media may cause the write to silently fail. Thiscan be determined if the RedBoot image does not correctlyboot. In such cases, the floppy should be (unconditionally) reformattedusing the <command>fdformat</command> command on Linux, or<command>format a: /u</command> on DOS/Windows. If this fails, try adifferent disk.</para></note></sect2><sect2><title>GRUB Bootloader Support</title><para>If an application is built with the GRUB startup type, it isconfigured to be loaded by the GRUB bootloader.</para><para>GRUB is an open source boot loader that supports many differentoperating systems. It is available from<ulinkurl="http://www.gnu.org/software/grub">http://www.gnu.org/software/grub</ulink>.The latest version of GRUB should be downloaded from there and installed.In Red Hat Linux version 7.2 and later it is the default bootloaderfor Linux and therefore is already installed.</para><para>To install GRUB on a floppy disk from Linux you need to execute thefollowing commands:</para><screen>$ <userinput>mformat a:</userinput>$ <userinput>mount /mnt/floppy</userinput>$ <userinput>grub-install --root-directory=/mnt/floppy '(fd0)'</userinput>Probing devices to guess BIOS drives. This may take a long time.Installation finished. No error reported.This is the contents of the device map /mnt/floppy/boot/grub/device.map.Check if this is correct or not. If any of the lines is incorrect,fix it and re-run the script `grub-install'.(fd0) /dev/fd0$ <userinput>cp $ECOS_REPOSITORY/packages/hal/i386/pc/current/misc/menu.lst /mnt/floppy/boot/grub</userinput>$ <userinput>umount /mnt/floppy</userinput></screen><para>The file <filename>menu.lst</filename> is an example GRUB menuconfiguration file. It contains menu items to load some of thestandard eCos tests from floppy or from partition zero of the firsthard disk. You should, of course, customize this file to load your ownapplication. Alternatively you can use the command-line interface ofGRUB to input commands yourself.</para><para>Applications can be installed, or updated simply by copying them tothe floppy disk at the location expected by the<filename>menu.lst</filename> file. For booting from floppy disks itis recommended that the executable be stripped of all debug and symboltable information before copying. This reduces the size of the fileand can make booting faster.</para><para>To install GRUB on a hard disk, refer to the GRUB documentation. Bewarned, however, that if you get this wrong it may compromise anyexisting bootloader that exists on the hard disk and may make anyother operating systems unbootable. Practice on floppy disks orsacrificial hard disks first. On machines running Red Hat Linuxversion 7.2 and later, you can just add your own menu items to the<filename>/boot/grub/menu.lst</filename> file that already exists.</para></sect2><sect2><title>Debugging FLOPPY and GRUB Applications</title><para>When RedBoot loads an application it also provides debugging servicesin the form of GDB remote protocol stubs. When an application isloaded stand-alone from a floppy disk, or by GRUB, these services arenot present. To allow these application to be debugged, it is possibleto include GDB stubs into the application.</para><para>To do this, set the "Support for GDB stubs"(<literal>CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS</literal>) configurationoption. Following this any application built will allow GDB to connectto the debug serial port (by default serial device 0, also known asCOM1) whenever the application takes an exception, or if a Control-Cis typed to the debug port. Ethernet debugging is not supported.</para><para>The option "Enable initial breakpoint"(<literal>CYGDBG_HAL_DEBUG_GDB_INITIAL_BREAK</literal>) causes the HALto take a breakpoint immediately before calling cyg_start(). Thisgives the developer a chance to set any breakpoints or inspect thesystem state before it proceeds. The configuration sets this option bydefault if GDB stubs are included, and this is not a RedBoot build. Tomake the application execute immediately either disable this option,or disable <literal>CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS</literal>.</para></sect2></SECT1><SECT1 id="setup-synth-i386linux"><TITLE><!-- <conditionaltext> --><!-- <index></index> -->i386/Linux Synthetic Target Setup</TITLE><PARA>When building for the synthetic Linux target, the resultingbinaries are native Linux applications with the HAL providing suitablebindings between the eCos kernel and the Linux kernel.</PARA><NOTE><PARA>Please be aware that the current implementation of the Linuxsynthetic target does not allow thread-aware debugging.</PARA></NOTE><PARA>These Linux applications cannot be run on a Windows system.However, it is possible to write a similar HAL emulation for theWindows kernel if such a testing target is desired.</PARA><SECT2><TITLE>Tools</TITLE><PARA>For the synthetic target, eCos relies on features not availablein native compilers earlier than gcc-2.95.1. It also requires version2.9.5 or later of the GNU linker. If you have gcc-2.95.1 or laterand ld version 2.9.5 or later, then you do not need to build newtools. eCos does not support earlier versions. You can check the compilerversion using <COMMAND>gcc -v</COMMAND>and the linker version using <COMMAND>ld-v</COMMAND>.</PARA><PARA>If you have native tools that are sufficiently recent foruse with eCos, you should be aware that by default eCos assumesthat the tools <COMMAND>i686-pc-linux-gnu-gcc</COMMAND>, <COMMAND>i686-pc-linux-gnu-ar</COMMAND>,<COMMAND>i686-pc-linux-gnu-ld</COMMAND>, and <COMMAND>i686-pc-linux-gnu-objcopy</COMMAND> areon your system and are the correct versions for use with eCos. Butinstead, you can tell eCos to use your native tools by editing theconfiguration value "Global command prefix" (CYGBLD_GLOBAL_COMMAND_PREFIX)in your eCos configuration. If left empty (i.e. set to the emptystring) eCos will use your native tools when building.</PARA><PARA>If you have any difficulties, it is almost certainly easiestoverall to rebuild the tools as described on: <ULINK URL="http://sources.redhat.com/ecos/getstart.html">http://sources.redhat.com/ecos/getstart.html</ULINK></PARA></SECT2></SECT1></appendix>
Go to most recent revision | Compare with Previous | Blame | View Log
