sh4-microdev-setup.html
来自「ecos3.0 beta 的官方文档,html格式」· HTML 代码 · 共 702 行 · 第 1/2 页
HTML
702 行
<!-- Copyright (C) 2009 Free Software Foundation, 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 is obtained from the copyright holder. -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Setup</TITLE
><meta name="MSSmartTagsPreventParsing" content="TRUE">
<META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="eCos Reference Manual"
HREF="ecos-ref.html"><LINK
REL="UP"
TITLE="SuperH SH4-202 MicroDev Board Support"
HREF="hal-sh4-microdev-part.html"><LINK
REL="PREVIOUS"
TITLE="Overview"
HREF="sh4-microdev.html"><LINK
REL="NEXT"
TITLE="Configuration"
HREF="sh4-microdev-config.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>eCos Reference Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="sh4-microdev.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="sh4-microdev-config.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SH4-MICRODEV-SETUP"
></A
>Setup</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN19657"
></A
><H2
>Name</H2
>Setup -- Preparing the MicroDev board for eCos Development</DIV
><DIV
CLASS="REFSECT1"
><A
NAME="SH4-MICRODEV-SETUP-OVERVIEW"
></A
><H2
>Overview</H2
><P
>In a typical development environment, the MicroDev board boots from
flash into the RedBoot ROM monitor. eCos applications are configured
for RAM startup and then downloaded and run on the board via the
debugger sh-elf-gdb. Preparing the board therefore usually involves
programming a suitable RedBoot image into flash memory. Alternatively
RedBoot may be programmed into a PLCC EEPROM and inserted into socket U21,
although in that case, the flash memory is not accessible.
</P
><P
>The following RedBoot configurations are supported:
</P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><A
NAME="AEN19664"
></A
><TABLE
BORDER="1"
FRAME="border"
RULES="all"
CLASS="CALSTABLE"
><COL><COL><COL><COL><THEAD
><TR
><TH
>Configuration</TH
><TH
>Description</TH
><TH
>Use</TH
><TH
>File</TH
></TR
></THEAD
><TBODY
><TR
><TD
>ROM</TD
><TD
>RedBoot running from the board's flash</TD
><TD
>redboot_ROM.ecm</TD
><TD
>redboot_ROM.bin</TD
></TR
><TR
><TD
>EEPROM</TD
><TD
>RedBoot running from the board's socketed EEPROM</TD
><TD
>redboot_EEPROM.ecm</TD
><TD
>redboot_EEPROM.bin</TD
></TR
><TR
><TD
>RAM</TD
><TD
>Used for upgrading ROM version</TD
><TD
>redboot_RAM.ecm</TD
><TD
>redboot_RAM.bin</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
><P
>For serial communications, all versions run with 8 bits, no parity, and
1 stop bit at 38400 baud. This baud rate can be changed via the
configuration option
<CODE
CLASS="VARNAME"
>CYGNUM_HAL_SH_SH4_SCIF_BAUD_RATE</CODE
> and rebuilding
RedBoot. RedBoot also supports ethernet communication and flash
management.
</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="SH4-MICRODEV-SETUP-FIRST"
></A
><H2
>Initial Installation</H2
><DIV
CLASS="REFSECT2"
><A
NAME="SH4-MICRODEV-FLASH"
></A
><H3
>Flash Installation</H3
><P
>This process assumes that the board is connected to a SuperH Micro
Probe. The Micro Probe should be set up as described in Appendix A of
the "SH4 Development Tools User Guide". You should also have access to
the SuperH development tools since it is necessary to use the version
of GDB that comes with those tools to access the Micro Probe,
<B
CLASS="COMMAND"
>sh-elf-gdb</B
> will not work.
</P
><P
>Programming the RedBoot ROM monitor into flash memory requires an
application that can manage flash blocks. RedBoot itself has this
capability. Rather than have a separate application that is used only
for flash management during the initial installation, a special
RAM-resident version of RedBoot is loaded into memory and run. This
version can then be used to load the normal flash-resident version of
RedBoot and program it into the flash.
</P
><P
>The first step is to connect an RS232 null modem cable between the MicroDev
serial port and the host PC. Next start a terminal emulation application such as
HyperTerminal or minicom on the host PC and set the serial
communication parameters to 38400 baud, 8 data bits, no parity, 1 stop
bit (8N1) and no flow control (handshaking).
</P
><P
>Now run the <B
CLASS="COMMAND"
>sh4gdb</B
> command, giving it the name of
the RAM redboot ELF file, connect to the Micro Probe, load the
executable and run it. The entire session should look like this:
</P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="SCREEN"
>$ <KBD
CLASS="USERINPUT"
>sh4gdb redboot_RAM.elf</KBD
>
GNU gdb 5.2.1
Copyright 2002 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 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) <KBD
CLASS="USERINPUT"
>sh4si superh</KBD
>
The target is assumed to be little endian
The target architecture is assumed to be sh4
0xa0000000 in ?? ()
(gdb) <KBD
CLASS="USERINPUT"
>load</KBD
>
Loading section .vectors, size 0x9e0 lma 0x88010000
Loading section .text, size 0x1ab20 lma 0x880109e0
Loading section .rodata, size 0x3e6c lma 0x8802b500
Loading section .data, size 0xf30 lma 0x8802f370
Start address 0x88010000, load size 131740
Transfer rate: 351306 bits/sec, 433 bytes/write.
(gdb) <KBD
CLASS="USERINPUT"
>cont</KBD
>
Continuing.
</PRE
></TD
></TR
></TABLE
><P
>The required <TT
CLASS="FILENAME"
>redboot_RAM.elf</TT
> file is normally
supplied with the eCos release in the <TT
CLASS="FILENAME"
>loaders</TT
> directory. If it needs to be
rebuilt then instructions for this are supplied <A
HREF="sh4-microdev-setup.html#SH4-MICRODEV-SETUP-REBUILD"
>below</A
>.
</P
><P
>If this sequence fails in any way then check the setup and connections
of the Micro Probe. It if is successful then you should see the
following printed out on the serial line:
</P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="SCREEN"
>+FLASH configuration checksum error or invalid key
... waiting for BOOTP information
Ethernet eth0: MAC address 00:08:ee:00:0b:37
Can't get BOOTP info for device!
RedBoot(tm) bootstrap and debug environment [RAM]
Non-certified release, version UNKNOWN - built 14:28:55, Sep 8 2003
Copyright (C) 2000, 2001, 2002, Free Software Foundation, Inc.
RAM: 0x88000000-0x8c000000, 0x8812cca0-0x8bfb1000 available
FLASH: 0xa0000000 - 0xa2000000, 128 blocks of 0x00040000 bytes each.
RedBoot>
</PRE
></TD
></TR
></TABLE
><P
>If the ethernet cable is not plugged in there may be a fairly long
wait after the "... waiting for BOOTP information" message.
At this stage the RedBoot flash management initialization has not yet
happened so the warning about the configuration checksum error is
expected. To perform this initialization use the
<B
CLASS="COMMAND"
>fis init -f</B
> command:
</P
><TABLE
BORDER="5"
BGCOLOR="#E0E0F0"
WIDTH="70%"
><TR
><TD
><PRE
CLASS="SCREEN"
>RedBoot> <KBD
CLASS="USERINPUT"
>fis init -f</KBD
>
About to initialize [format] FLASH image system - continue (y/n)? <KBD
CLASS="USERINPUT"
>y</KBD
>
*** Initialize FLASH Image System
... Unlock from 0xa1fc0000-0xa2000000: .
... Erase from 0xa1fc0000-0xa2000000: .
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?