⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 redboot_rebuilding.sgml

📁 eCos/RedBoot for勤研ARM AnywhereII(4510) 含全部源代码
💻 SGML
📖 第 1 页 / 共 2 页
字号:
eCos/RedBoot sources, <replaceable>VERSION</replaceable> is the
version of the package (usually "current") and
<replaceable>REDBOOT_CFG</replaceable> is the desired configuration,
e.g. redboot_RAM.
</para>
</sect2></sect1></chapter>

<chapter id="Updating-Redboot">
<title>Updating RedBoot</title>
<sect1>
<title>Introduction</title>
<para><indexterm><primary>updating
RedBoot</primary></indexterm><indexterm>
<primary>RedBoot</primary><secondary>updating</secondary></indexterm>RedBoot
normally resides in an EPROM or, more common these days, a flash 
on the board. In the former case, updating RedBoot necessitates
physically removing the part and
reprogramming a new RedBoot image into it using prommer hardware. In
the latter case, it is often possible to update RedBoot in situ using
Redboot's flash management commands.</para>

<para>The process of updating RedBoot in situ is documented in this
section. For this process, it is assumed that the target is connected
to a host system and that there is a serial connection giving access
to the RedBoot CLI. For platforms with a ROMRAM mode RedBoot, skip to
<xref linkend="update-primary-image">.</para>

<note><para>The addresses and sizes included in the below are examples
only, and will differ from those you will see. This is normal and
should not cause concern.</para></note>

<sect2 id="different-version-from-RAM">
<title>Load and start a RedBoot RAM instance</title>
<para>There are a number of choices here. The basic case is where a RAM
mode image has been stored in the FIS (flash Image System). To load and
execute this image, use the commands: <screen>
RedBoot> <userinput>fis load RedBoot[RAM]</userinput>
RedBoot> <userinput>go</userinput></screen>
If this image is not available, or does not work,
then an alternate RAM mode image must be loaded:
<screen>
RedBoot> <userinput>load redboot_RAM.img</userinput>
Entry point: 0x060213c0, address range: 0x06020000-0x060369c8                   
RedBoot> <userinput>go</userinput>
</screen>

<note><para>This command loads the RedBoot image using the TFTP
protocol via a network connection. Other methods of loading are
available, refer to the <command><link
linkend="download-command">load</link</command> command for more
details. </para></note>

<note><para>If you expect to be doing this more than once, it is a
good idea to program the RAM mode image into the flash. You do this
using the <command>fis create</command> command after having
downloaded the RAM mode image, but before you start it.</para>
<para>Some platforms support locking (write protecting) certain regions of
the flash, while others do not. If your platform does not support
locking, simply ignore the <command>fis unlock</command> and
<command>fis lock</command> steps (the commands will not be
recognized by RedBoot).</para>
<para>
<screen>
RedBoot> <userinput>fis unlock RedBoot[RAM]</userinput>
  ... Unlock from 0x00000000-0x00020000: ..
RedBoot> <userinput>fis create RedBoot[RAM]</userinput>
An image named 'RedBoot[RAM]' exists - continue (y/n)? <userinput>y</userinput>
* CAUTION * about to program 'RedBoot[RAM]'
            at 0x00020000..0x000369c7 from 0x06020000 - continue (y/n)?<userinput>y</userinput>
... Erase from 0x00020000-0x00040000: ..                                        
... Program from 0x06020000-0x060369c8 at 0x00020000: ..                        
... Erase from 0x00070000-0x00080000: .                                         
... Program from 0x0606f000-0x0607f000 at 0x00070000: .                         
RedBoot> <userinput>fis lock RedBoot[RAM]</userinput>
  ... Lock from 0x00000000-0x00020000: ..
</screen>
</para></note>
</para>
</sect2>

<sect2 id="update-primary-image">
<title>Update the primary RedBoot flash image</title> <para>An
instance of RedBoot should now be running on the target from RAM. This
can be verified by looking for the mode identifier in the banner. It
should be either [RAM] or [ROMRAM].</para>

<para>If this is the first time RedBoot is running on the board or if
the flash contents has been damaged, initialize the FIS directory:
<screen>RedBoot> <userinput>fis init -f</userinput>
About to initialize [format] FLASH image system - continue (y/n)? <userinput>y</userinput>
*** Initialize FLASH Image System
... Erase from 0x00020000-0x00070000: .....
... Erase from 0x00080000-0x00080000:
... Erase from 0x00070000-0x00080000: .
... Program from 0x0606f000-0x0607f000 at 0x00070000: .
</screen>
</para>

<para>It is important to understand that the presence of a correctly
initialized FIS directory allows RedBoot to automatically determine
the flash parameters. Additionally, executing the steps below as
stated without loading other data or using other flash commands (than
possibly <command>fis list</command>) allows RedBoot to automatically
determine the image location and size parameters. This greatly reduces
the risk of potential critical mistakes due to typographical errors. It is
still always possible to explicitly specify parameters, and indeed
override these, but it is not advised.</para>

<note><para>If the new RedBoot image has grown beyond the slot in
flash reserved for it, it is necessary to change the RedBoot
configuration option CYGBLD_REDBOOT_MIN_IMAGE_SIZE so the FIS is
created with adequate space reserved for RedBoot images. In this case,
it is necessary to re-initialize the FIS directory as described above,
using a RAM mode RedBoot compiled with the updated
configuration.</para></note>

<para>Using the <command>load</command> command, download the
new flash based image from the host, relocating the image to RAM::
<screen>RedBoot> <userinput>load -r -b %{FREEMEMLO} redboot_ROM.bin</userinput>
Raw file loaded 0x06046800-0x06062fe8, assumed entry at 0x06046800
</screen>

<note><para>This command loads the RedBoot image using the TFTP
protocol via a network connection. Other methods of loading are
available, refer to the <xref linkend="download-command"> command for
more details. </para></note>

<note><para>Note that the binary version of the image is being
downloaded. This is to ensure that the memory after the image is
loaded should match the contents of the file on the host. Loading SREC
or ELF versions of the image does not guarantee this since these
formats may contain holes, leaving bytes in these holes in an unknown
state after the load, and thus causing a likely cksum difference. It
is possible to use these, but then the step verifying the cksum below
may fail.</para></note>
</para>

<para>Once the image is loaded into RAM, it should be checksummed,
thus verifying that the image on the target is indeed the image
intended to be loaded, and that no corruption of the image has
happened. This is done using the <xref linkend="cksum-command">
command:
<screen>RedBoot> <userinput>cksum</userinput>
Computing cksum for area 0x06046800-0x06062fe8                                  
POSIX cksum = 2535322412 116712 (0x971df32c 0x0001c7e8)                         
</screen>
Compare the numbers with those for the binary version of the image on
the host. If they do not match, try downloading the image again.</para>


<para>Assuming the cksum matches, the next step is programming the
image into flash using the FIS commands.</para>

<para>Some platforms support locking (write protecting) certain
regions of the flash, while others do not. If your platform does not
support locking, simply ignore the <command>fis unlock</command> and
<command>fis lock</command> steps (the commands will not be recognized
by RedBoot).</para>

<screen>RedBoot> <userinput>fis unlock RedBoot</userinput>
  ... Unlock from 0x00000000-0x00020000: ..
RedBoot> <userinput>fis create RedBoot</userinput>
An image named 'RedBoot' exists - continue (y/n)? <userinput>y</userinput>
* CAUTION * about to program 'RedBoot'
            at 0x00000000..0x0001c7e7 from 0x06046800 - continue (y/n)? <userinput>y</userinput>
... Erase from 0x00000000-0x00020000: ..
... Program from 0x06046800-0x06062fe8 at 0x00000000: ..
... Erase from 0x00070000-0x00080000: .
... Program from 0x0606f000-0x0607f000 at 0x00070000: .
RedBoot> <userinput>fis lock RedBoot</userinput>
  ... Lock from 0x00000000-0x00020000: ..
</screen>

</sect2>
<sect2>
<title>Reboot; run the new RedBoot image</title>
<para>Once the image has been successfully written into the flash, simply
reset the target and the new version of RedBoot should be running. </para>
<para>When installing RedBoot for the first time, or after updating to
a newer RedBoot with different configuration keys, it is necessary to
update the configuration directory in the flash using the
<command>fconfig</command> command. See <xref
linkend="Persistent-State-Flash">.
</para>

</sect2></sect1></chapter>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -