sh4_202_md.sgml
来自「eCos操作系统源码」· SGML 代码 · 共 761 行 · 第 1/3 页
SGML
761 行
<!-- DOCTYPE part PUBLIC "-//OASIS//DTD DocBook V3.1//EN" --><!-- {{{ Banner --><!-- =============================================================== --><!-- --><!-- sh4_202_md.sgml --><!-- --><!-- MicroDev platform HAL documentation. --><!-- --><!-- =============================================================== --><!-- ####COPYRIGHTBEGIN#### --><!-- --><!-- =============================================================== --><!-- Copyright (C) 2003 Nick Garnett . --><!-- 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#### --><!-- --><!-- Author(s): nickg --><!-- Contact(s): nickg --><!-- Date: 2003/09/08 --><!-- Version: 0.01 --><!-- --><!-- ####DESCRIPTIONEND#### --><!-- =============================================================== --><!-- }}} --><part id="hal-sh4-microdev-part"><title>SuperH SH4-202 MicroDev Board Support</title><!-- {{{ Overview --><refentry id="sh4-microdev"> <refmeta> <refentrytitle>Overview</refentrytitle> </refmeta> <refnamediv> <refname>eCos Support for the SuperH SH4-202 MicroDev Board</refname> <refpurpose>Overview</refpurpose> </refnamediv> <refsect1 id="sh4-microdev-description"><title>Description</title> <para>The SuperH SH4-202 MicroDev board (henceforth just "MicroDev") hasan SH4-202 processor, 64MB of external SDRAM, 32MB of external flashmemory, an SMSC LAN91C111 ethernet controller and connectors plusrequired support chips for all the on-chip peripherals. </para> <para>For typical eCos development, a RedBoot image is programmed into theflash memory, and the board will boot this image from reset. RedBootprovides gdb stub functionality so it is then possible to download anddebug stand-alone and eCos applications via the gdb debugger. This canhappen over either a serial line or over ethernet. </para> </refsect1> <refsect1 id="sh4-microdev-hardware"><title>Supported Hardware</title> <para>The flash memory consists of 128 blocks of 256k bytes each.In a typical setup, the first flash block is used for the ROM RedBoot imageand the second is used to store a version of RedBoot that can run out ofRAM. The topmost two blocks are used to manage the flash and hold RedBoot fconfigvalues. The remaining 124 blocks between 0xA0080000 and 0xA1F7FFFF can beused by application code. </para> <para>The board is fitted with a PLCC socket suitable for an EEPROM (or PROM) such asthe 1Mbit ST M29WO10B. This is enabled by toggling two DIP switches, after whichthe EEPROM is mapped into the same address as the flash memory. Therefore,the flash is not accessible if booting from the EEPROM. </para> <para>There is a serial driver <varname>CYGPKG_DEVS_SERIAL_SH_SCIF</varname>which supports the on-chip serial device. This devicecan be used by RedBoot for communication with the host. If this deviceis needed by the application, either directly or via the serialdriver, then it cannot also be used for RedBoot communication. Anothercommunication channel such as ethernet should be used instead. Theserial driver package is loaded automatically when configuring for theMicroDev target. </para> <para>There is an ethernet driver <varname>CYGPKG_DEVS_ETH_SH_MICRODEV</varname>for the on-chip ethernet device. This driver is also loadedautomatically when configuring for the MicroDev target. </para> <para>eCos manages the on-chip interrupt controller. Timer 0 is used toimplement the eCos system clock, and timer 1 is used to implement amicrosecond delay function. Timer 2 is unused andleft for the application. Other on-chip devices (FEMI, EMI, INTC, TMU,CAC, UBC) are initialized only as far as is necessary for eCos torun. Other devices (eg RTC, DMAC, etc) are not touched. </para> </refsect1> <refsect1 id="sh4-microdev-tools"><title>Tools</title> <para>The MicroDev port is intended to work with GNU tools configured for ansh-elf target. The original port was done using sh-elf-gcc version3.2.1, sh-elf-gdb version 5.3, and binutils version 2.13.1. </para><!-- DOES THIS APPLY? <para>By default, eCos is built using the compiler flag<option>-fomit-frame-pointer</option>. Omitting the frame pointereliminates some work on every function call and makes another registeravailable, so the code should be smaller and faster. However, without aframe pointer, sh-elf-gdb is not always able to identify stackframes, so it may be unable to provide accurate backtrace information.Removing this compiler flag from the configuration option<varname>CYGBLD_GLOBAL_CFLAGS</varname> avoids such debug problems. </para>--> </refsect1></refentry><!-- }}} --><!-- {{{ Hardware setup --><refentry id="sh4-microdev-setup"> <refmeta> <refentrytitle>Setup</refentrytitle> </refmeta> <refnamediv> <refname>Setup</refname> <refpurpose>Preparing the MicroDev board for eCos Development</refpurpose> </refnamediv> <refsect1 id="sh4-microdev-setup-overview"><title>Overview</title> <para>In a typical development environment, the MicroDev board boots fromflash into the RedBoot ROM monitor. eCos applications are configuredfor RAM startup and then downloaded and run on the board via thedebugger sh-elf-gdb. Preparing the board therefore usually involvesprogramming a suitable RedBoot image into flash memory. AlternativelyRedBoot may be programmed into a PLCC EEPROM and inserted into socket U21,although in that case, the flash memory is not accessible. </para> <para>The following RedBoot configurations are supported: </para> <informaltable frame="all"> <tgroup cols="4" colsep="1" rowsep="1" align="left"> <thead> <row> <entry>Configuration</entry> <entry>Description</entry> <entry>Use</entry> <entry>File</entry> </row> </thead> <tbody> <row> <entry>ROM</entry> <entry>RedBoot running from the board's flash</entry> <entry>redboot_ROM.ecm</entry> <entry>redboot_ROM.bin</entry> </row> <row> <entry>EEPROM</entry> <entry>RedBoot running from the board's socketed EEPROM</entry> <entry>redboot_EEPROM.ecm</entry> <entry>redboot_EEPROM.bin</entry> </row> <row> <entry>RAM</entry> <entry>Used for upgrading ROM version</entry> <entry>redboot_RAM.ecm</entry> <entry>redboot_RAM.bin</entry> </row> </tbody> </tgroup> </informaltable> <para>For serial communications, all versions run with 8 bits, no parity, and1 stop bit at 38400 baud. This baud rate can be changed via theconfiguration option<varname>CYGNUM_HAL_SH_SH4_SCIF_BAUD_RATE</varname> and rebuildingRedBoot. RedBoot also supports ethernet communication and flashmanagement. </para> </refsect1> <refsect1 id="sh4-microdev-setup-first"><title>Initial Installation</title> <refsect2 id="sh4-microdev-flash"><title>Flash Installation</title> <para>This process assumes that the board is connected to a SuperH MicroProbe. The Micro Probe should be set up as described in Appendix A ofthe "SH4 Development Tools User Guide". You should also have access tothe SuperH development tools since it is necessary to use the versionof GDB that comes with those tools to access the Micro Probe,<command>sh-elf-gdb</command> will not work. </para> <para>Programming the RedBoot ROM monitor into flash memory requires anapplication that can manage flash blocks. RedBoot itself has thiscapability. Rather than have a separate application that is used onlyfor flash management during the initial installation, a specialRAM-resident version of RedBoot is loaded into memory and run. Thisversion can then be used to load the normal flash-resident version ofRedBoot and program it into the flash. </para> <para>The first step is to connect an RS232 null modem cable between the MicroDevserial port and the host PC. Next start a terminal emulation application such asHyperTerminal or minicom on the host PC and set the serialcommunication parameters to 38400 baud, 8 data bits, no parity, 1 stopbit (8N1) and no flow control (handshaking). </para> <para>Now run the <command>sh4gdb</command> command, giving it the name ofthe RAM redboot ELF file, connect to the Micro Probe, load theexecutable and run it. The entire session should look like this: </para> <screen>$ <userinput>sh4gdb redboot_RAM.elf</userinput>GNU gdb 5.2.1Copyright 2002 Free Software Foundation, Inc.GDB is free software, covered by the GNU General Public License, and you arewelcome to change it and/or distribute copies of 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=i686-pc-linux-gnu --target=sh-superh-elf"...(gdb) <userinput>sh4si superh</userinput>The target is assumed to be little endianThe target architecture is assumed to be sh40xa0000000 in ?? ()(gdb) <userinput>load</userinput>Loading section .vectors, size 0x9e0 lma 0x88010000Loading section .text, size 0x1ab20 lma 0x880109e0Loading section .rodata, size 0x3e6c lma 0x8802b500Loading section .data, size 0xf30 lma 0x8802f370Start address 0x88010000, load size 131740Transfer rate: 351306 bits/sec, 433 bytes/write.(gdb) <userinput>cont</userinput>Continuing. </screen> <para>The required <filename>redboot_RAM.elf</filename> file is normally
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?