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

📄 updating-redboot.html

📁 有关ecos2。0介绍了实时嵌入式的结构以及线程调度的实现和内存的管理等
💻 HTML
字号:
<!-- Copyright (C) 2003 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 is obtained from the copyright holder.               --><HTML><HEAD><TITLE>Updating RedBoot</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos Reference Manual"HREF="ecos-ref.html"><LINKREL="UP"TITLE="RedBoot&#8482; User's Guide"HREF="redboot.html"><LINKREL="PREVIOUS"TITLE="Rebuilding RedBoot"HREF="rebuilding-redboot.html"><LINKREL="NEXT"TITLE="Installation and Testing"HREF="installation-and-testing.html"></HEAD><BODYCLASS="CHAPTER"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">eCos Reference Manual</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="rebuilding-redboot.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="installation-and-testing.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="CHAPTER"><H1><ANAME="UPDATING-REDBOOT">Chapter 4. Updating RedBoot</H1><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="AEN4752">Introduction</H1><P>RedBootnormally resides in an EPROM or, more common these days, a flash on the board. In the former case, updating RedBoot necessitatesphysically removing the part andreprogramming a new RedBoot image into it using prommer hardware. Inthe latter case, it is often possible to update RedBoot in situ usingRedboot's flash management commands.</P><P>The process of updating RedBoot in situ is documented in thissection. For this process, it is assumed that the target is connectedto a host system and that there is a serial connection giving accessto the RedBoot CLI. For platforms with a ROMRAM mode RedBoot, skip to<AHREF="updating-redboot.html#UPDATE-PRIMARY-IMAGE">the Section called <I>Update the primary RedBoot flash image</I></A>.</P><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>Note: </B>The addresses and sizes included in the below are examplesonly, and will differ from those you will see. This is normal andshould not cause concern.</P></BLOCKQUOTE></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="DIFFERENT-VERSION-FROM-RAM">Load and start a RedBoot RAM instance</H2><P>There are a number of choices here. The basic case is where a RAMmode image has been stored in the FIS (flash Image System). To load andexecute this image, use the commands: <TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">RedBoot&#62; <TTCLASS="USERINPUT"><B>fis load RedBoot[RAM]</B></TT>RedBoot&#62; <TTCLASS="USERINPUT"><B>go</B></TT></PRE></TD></TR></TABLE>If this image is not available, or does not work,then an alternate RAM mode image must be loaded:<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">RedBoot&#62; <TTCLASS="USERINPUT"><B>load redboot_RAM.img</B></TT>Entry point: 0x060213c0, address range: 0x06020000-0x060369c8                   RedBoot&#62; <TTCLASS="USERINPUT"><B>go</B></TT></PRE></TD></TR></TABLE><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>Note: </B>This command loads the RedBoot image using the TFTPprotocol via a network connection. Other methods of loading areavailable, refer to the <BCLASS="COMMAND"><AHREF="download-command.html">load</A></B> command for moredetails. </P></BLOCKQUOTE></DIV><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>Note: </B>If you expect to be doing this more than once, it is agood idea to program the RAM mode image into the flash. You do thisusing the <BCLASS="COMMAND">fis create</B> command after havingdownloaded the RAM mode image, but before you start it.</P><P>Some platforms support locking (write protecting) certain regions ofthe flash, while others do not. If your platform does not supportlocking, simply ignore the <BCLASS="COMMAND">fis unlock</B> and<BCLASS="COMMAND">fis lock</B> steps (the commands will not berecognized by RedBoot).</P><P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">RedBoot&#62; <TTCLASS="USERINPUT"><B>fis unlock RedBoot[RAM]</B></TT>  ... Unlock from 0x00000000-0x00020000: ..RedBoot&#62; <TTCLASS="USERINPUT"><B>fis create RedBoot[RAM]</B></TT>An image named 'RedBoot[RAM]' exists - continue (y/n)? <TTCLASS="USERINPUT"><B>y</B></TT>* CAUTION * about to program 'RedBoot[RAM]'            at 0x00020000..0x000369c7 from 0x06020000 - continue (y/n)?<TTCLASS="USERINPUT"><B>y</B></TT>... Erase from 0x00020000-0x00040000: ..                                        ... Program from 0x06020000-0x060369c8 at 0x00020000: ..                        ... Erase from 0x00070000-0x00080000: .                                         ... Program from 0x0606f000-0x0607f000 at 0x00070000: .                         RedBoot&#62; <TTCLASS="USERINPUT"><B>fis lock RedBoot[RAM]</B></TT>  ... Lock from 0x00000000-0x00020000: ..</PRE></TD></TR></TABLE></P></BLOCKQUOTE></DIV></P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="UPDATE-PRIMARY-IMAGE">Update the primary RedBoot flash image</H2><P>Aninstance of RedBoot should now be running on the target from RAM. Thiscan be verified by looking for the mode identifier in the banner. Itshould be either [RAM] or [ROMRAM].</P><P>If this is the first time RedBoot is running on the board or ifthe flash contents has been damaged, initialize the FIS directory:<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">RedBoot&#62; <TTCLASS="USERINPUT"><B>fis init -f</B></TT>About to initialize [format] FLASH image system - continue (y/n)? <TTCLASS="USERINPUT"><B>y</B></TT>*** Initialize FLASH Image System... Erase from 0x00020000-0x00070000: ........ Erase from 0x00080000-0x00080000:... Erase from 0x00070000-0x00080000: .... Program from 0x0606f000-0x0607f000 at 0x00070000: .</PRE></TD></TR></TABLE></P><P>It is important to understand that the presence of a correctlyinitialized FIS directory allows RedBoot to automatically determinethe flash parameters. Additionally, executing the steps below asstated without loading other data or using other flash commands (thanpossibly <BCLASS="COMMAND">fis list</B>) allows RedBoot to automaticallydetermine the image location and size parameters. This greatly reducesthe risk of potential critical mistakes due to typographical errors. It isstill always possible to explicitly specify parameters, and indeedoverride these, but it is not advised.</P><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>Note: </B>If the new RedBoot image has grown beyond the slot inflash reserved for it, it is necessary to change the RedBootconfiguration option CYGBLD_REDBOOT_MIN_IMAGE_SIZE so the FIS iscreated 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 updatedconfiguration.</P></BLOCKQUOTE></DIV><P>Using the <BCLASS="COMMAND">load</B> command, download thenew flash based image from the host, relocating the image to RAM::<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">RedBoot&#62; <TTCLASS="USERINPUT"><B>load -r -b %{FREEMEMLO} redboot_ROM.bin</B></TT>Raw file loaded 0x06046800-0x06062fe8, assumed entry at 0x06046800</PRE></TD></TR></TABLE><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>Note: </B>This command loads the RedBoot image using the TFTPprotocol via a network connection. Other methods of loading areavailable, refer to the <AHREF="download-command.html">load</A> command formore details. </P></BLOCKQUOTE></DIV><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>Note: </B>Note that the binary version of the image is beingdownloaded. This is to ensure that the memory after the image isloaded should match the contents of the file on the host. Loading SRECor ELF versions of the image does not guarantee this since theseformats may contain holes, leaving bytes in these holes in an unknownstate after the load, and thus causing a likely cksum difference. Itis possible to use these, but then the step verifying the cksum belowmay fail.</P></BLOCKQUOTE></DIV></P><P>Once the image is loaded into RAM, it should be checksummed,thus verifying that the image on the target is indeed the imageintended to be loaded, and that no corruption of the image hashappened. This is done using the <AHREF="cksum-command.html">cksum</A>command:<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">RedBoot&#62; <TTCLASS="USERINPUT"><B>cksum</B></TT>Computing cksum for area 0x06046800-0x06062fe8                                  POSIX cksum = 2535322412 116712 (0x971df32c 0x0001c7e8)                         </PRE></TD></TR></TABLE>Compare the numbers with those for the binary version of the image onthe host. If they do not match, try downloading the image again.</P><P>Assuming the cksum matches, the next step is programming theimage into flash using the FIS commands.</P><P>Some platforms support locking (write protecting) certainregions of the flash, while others do not. If your platform does notsupport locking, simply ignore the <BCLASS="COMMAND">fis unlock</B> and<BCLASS="COMMAND">fis lock</B> steps (the commands will not be recognizedby RedBoot).</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">RedBoot&#62; <TTCLASS="USERINPUT"><B>fis unlock RedBoot</B></TT>  ... Unlock from 0x00000000-0x00020000: ..RedBoot&#62; <TTCLASS="USERINPUT"><B>fis create RedBoot</B></TT>An image named 'RedBoot' exists - continue (y/n)? <TTCLASS="USERINPUT"><B>y</B></TT>* CAUTION * about to program 'RedBoot'            at 0x00000000..0x0001c7e7 from 0x06046800 - continue (y/n)? <TTCLASS="USERINPUT"><B>y</B></TT>... Erase from 0x00000000-0x00020000: ..... Program from 0x06046800-0x06062fe8 at 0x00000000: ..... Erase from 0x00070000-0x00080000: .... Program from 0x0606f000-0x0607f000 at 0x00070000: .RedBoot&#62; <TTCLASS="USERINPUT"><B>fis lock RedBoot</B></TT>  ... Lock from 0x00000000-0x00020000: ..</PRE></TD></TR></TABLE></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN4824">Reboot; run the new RedBoot image</H2><P>Once the image has been successfully written into the flash, simplyreset the target and the new version of RedBoot should be running. </P><P>When installing RedBoot for the first time, or after updating toa newer RedBoot with different configuration keys, it is necessary toupdate the configuration directory in the flash using the<BCLASS="COMMAND">fconfig</B> command. See <AHREF="persistent-state-flash.html">the Section called <I>Persistent State Flash-based Configuration and Control</I> in Chapter 2</A>.</P></DIV></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="rebuilding-redboot.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-ref.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="installation-and-testing.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Rebuilding RedBoot</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="redboot.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Installation and Testing</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

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