1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
12 >Updating RedBoot</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="RedBoot™ User's Guide"
23 HREF="redboot.html"><LINK
25 TITLE="Rebuilding RedBoot"
26 HREF="rebuilding-redboot.html"><LINK
28 TITLE="Installation and Testing"
29 HREF="installation-and-testing.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="rebuilding-redboot.html"
71 HREF="installation-and-testing.html"
84 NAME="UPDATING-REDBOOT">Chapter 4. Updating RedBoot</H1
90 NAME="AEN4752">Introduction</H1
93 normally resides in an EPROM or, more common these days, a flash
94 on the board. In the former case, updating RedBoot necessitates
95 physically removing the part and
96 reprogramming a new RedBoot image into it using prommer hardware. In
97 the latter case, it is often possible to update RedBoot in situ using
98 Redboot's flash management commands.</P
100 >The process of updating RedBoot in situ is documented in this
101 section. For this process, it is assumed that the target is connected
102 to a host system and that there is a serial connection giving access
103 to the RedBoot CLI. For platforms with a ROMRAM mode RedBoot, skip to
105 HREF="updating-redboot.html#UPDATE-PRIMARY-IMAGE"
106 >the Section called <I
107 >Update the primary RedBoot flash image</I
117 >The addresses and sizes included in the below are examples
118 only, and will differ from those you will see. This is normal and
119 should not cause concern.</P
127 NAME="DIFFERENT-VERSION-FROM-RAM">Load and start a RedBoot RAM instance</H2
129 >There are a number of choices here. The basic case is where a RAM
130 mode image has been stored in the FIS (flash Image System). To load and
131 execute this image, use the commands: <TABLE
142 >fis load RedBoot[RAM]</B
155 If this image is not available, or does not work,
156 then an alternate RAM mode image must be loaded:
168 >load redboot_RAM.img</B
171 Entry point: 0x060213c0, address range: 0x06020000-0x060369c8
190 >This command loads the RedBoot image using the TFTP
191 protocol via a network connection. Other methods of loading are
192 available, refer to the <B
195 HREF="download-command.html"
211 >If you expect to be doing this more than once, it is a
212 good idea to program the RAM mode image into the flash. You do this
216 > command after having
217 downloaded the RAM mode image, but before you start it.</P
219 >Some platforms support locking (write protecting) certain regions of
220 the flash, while others do not. If your platform does not support
221 locking, simply ignore the <B
228 > steps (the commands will not be
229 recognized by RedBoot).</P
242 >fis unlock RedBoot[RAM]</B
245 ... Unlock from 0x00000000-0x00020000: ..
249 >fis create RedBoot[RAM]</B
252 An image named 'RedBoot[RAM]' exists - continue (y/n)? <TT
258 * CAUTION * about to program 'RedBoot[RAM]'
259 at 0x00020000..0x000369c7 from 0x06020000 - continue (y/n)?<TT
265 ... Erase from 0x00020000-0x00040000: ..
266 ... Program from 0x06020000-0x060369c8 at 0x00020000: ..
267 ... Erase from 0x00070000-0x00080000: .
268 ... Program from 0x0606f000-0x0607f000 at 0x00070000: .
272 >fis lock RedBoot[RAM]</B
275 ... Lock from 0x00000000-0x00020000: ..</PRE
289 NAME="UPDATE-PRIMARY-IMAGE">Update the primary RedBoot flash image</H2
292 instance of RedBoot should now be running on the target from RAM. This
293 can be verified by looking for the mode identifier in the banner. It
294 should be either [RAM] or [ROMRAM].</P
296 >If this is the first time RedBoot is running on the board or if
297 the flash contents has been damaged, initialize the FIS directory:
312 About to initialize [format] FLASH image system - continue (y/n)? <TT
318 *** Initialize FLASH Image System
319 ... Erase from 0x00020000-0x00070000: .....
320 ... Erase from 0x00080000-0x00080000:
321 ... Erase from 0x00070000-0x00080000: .
322 ... Program from 0x0606f000-0x0607f000 at 0x00070000: .</PRE
328 >It is important to understand that the presence of a correctly
329 initialized FIS directory allows RedBoot to automatically determine
330 the flash parameters. Additionally, executing the steps below as
331 stated without loading other data or using other flash commands (than
335 >) allows RedBoot to automatically
336 determine the image location and size parameters. This greatly reduces
337 the risk of potential critical mistakes due to typographical errors. It is
338 still always possible to explicitly specify parameters, and indeed
339 override these, but it is not advised.</P
347 >If the new RedBoot image has grown beyond the slot in
348 flash reserved for it, it is necessary to change the RedBoot
349 configuration option CYGBLD_REDBOOT_MIN_IMAGE_SIZE so the FIS is
350 created with adequate space reserved for RedBoot images. In this case,
351 it is necessary to re-initialize the FIS directory as described above,
352 using a RAM mode RedBoot compiled with the updated
360 > command, download the
361 new flash based image from the host, relocating the image to RAM::
373 >load -r -b %{FREEMEMLO} redboot_ROM.bin</B
376 Raw file loaded 0x06046800-0x06062fe8, assumed entry at 0x06046800</PRE
389 >This command loads the RedBoot image using the TFTP
390 protocol via a network connection. Other methods of loading are
391 available, refer to the <A
392 HREF="download-command.html"
407 >Note that the binary version of the image is being
408 downloaded. This is to ensure that the memory after the image is
409 loaded should match the contents of the file on the host. Loading SREC
410 or ELF versions of the image does not guarantee this since these
411 formats may contain holes, leaving bytes in these holes in an unknown
412 state after the load, and thus causing a likely cksum difference. It
413 is possible to use these, but then the step verifying the cksum below
419 >Once the image is loaded into RAM, it should be checksummed,
420 thus verifying that the image on the target is indeed the image
421 intended to be loaded, and that no corruption of the image has
422 happened. This is done using the <A
423 HREF="cksum-command.html"
441 Computing cksum for area 0x06046800-0x06062fe8
442 POSIX cksum = 2535322412 116712 (0x971df32c 0x0001c7e8) </PRE
447 Compare the numbers with those for the binary version of the image on
448 the host. If they do not match, try downloading the image again.</P
450 >Assuming the cksum matches, the next step is programming the
451 image into flash using the FIS commands.</P
453 >Some platforms support locking (write protecting) certain
454 regions of the flash, while others do not. If your platform does not
455 support locking, simply ignore the <B
462 > steps (the commands will not be recognized
475 >fis unlock RedBoot</B
478 ... Unlock from 0x00000000-0x00020000: ..
482 >fis create RedBoot</B
485 An image named 'RedBoot' exists - continue (y/n)? <TT
491 * CAUTION * about to program 'RedBoot'
492 at 0x00000000..0x0001c7e7 from 0x06046800 - continue (y/n)? <TT
498 ... Erase from 0x00000000-0x00020000: ..
499 ... Program from 0x06046800-0x06062fe8 at 0x00000000: ..
500 ... Erase from 0x00070000-0x00080000: .
501 ... Program from 0x0606f000-0x0607f000 at 0x00070000: .
508 ... Lock from 0x00000000-0x00020000: ..</PRE
518 NAME="AEN4824">Reboot; run the new RedBoot image</H2
520 >Once the image has been successfully written into the flash, simply
521 reset the target and the new version of RedBoot should be running. </P
523 >When installing RedBoot for the first time, or after updating to
524 a newer RedBoot with different configuration keys, it is necessary to
525 update the configuration directory in the flash using the
530 HREF="persistent-state-flash.html"
531 >the Section called <I
532 >Persistent State Flash-based Configuration and Control</I
543 SUMMARY="Footer navigation table"
554 HREF="rebuilding-redboot.html"
572 HREF="installation-and-testing.html"
582 >Rebuilding RedBoot</TD
596 >Installation and Testing</TD