LUGRo-Mesh Forum (espaņol/english)
April 20, 2024, 01:49:36 am
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to SMF For Free
 
  Home   Forum   Help Search Gallery Staff List Login Register  

HowTo flash the Nightwing firmware using RedBoot

Pages: [1]   Go Down
  Print  
Author Topic: HowTo flash the Nightwing firmware using RedBoot  (Read 1752 times)
0 Members and 1 Guest are viewing this topic.
JulioCP
Administrator
Full Member
*****
Posts: 113


WWW
« on: April 23, 2008, 04:03:14 pm »

HowTo flash the Nightwing firmware using RedBoot

RedBoot is a complete bootstrap environment for embedded systems. Based on the eCos  Hardware Abstraction Layer. RedBoot has many features, including the use of the command line interface (CLI).

Through the CLI we can manipulate the flash memory of our device (in our case the router), we can also upload and download the images to flash memory through a tftp server.

Redboot can be access via a serial interface or Ethernet.

To access the CLI interface, we use the serial adaptor, which we connect to the device. This access we do it through minicom or another serial console emulator.

Then we must break the normal boot process at power-on, by hitting control-c and entering in CLI interface

On the serial console, we are presented with the CLI: RedBoot>

The commands to use and a brief description of what they do, are as follows:
                        fconfig                 Allows to make changes to the default RedBoot configuration
                        fis init                  Initializes the Flash Image System (FIS)
                        fis list                  Lists the directories of the FIS.
                        fis delete              Deletes an image from the flash
                        fis load                 Loads a flash image into the RAM memory
                        fis create              Creates a flash image
                        fis free                 Shows the free space in the flash memory


In summary, the steps to reflash a device are this:
Just before the first time we flash it:
     fconfig     (if we need to change something of what come with default)
     fis init

Allways that we flash:
    fis load -r -b %{FREEMEMLO} nightwing-vmlinux.lzma
    fis create -r 0x80041000 -e 0x80041000 kernel
    fis load -r -b %{FREEMEMLO} nightwing-root.squashfs
    fis free (2° nš – 1° nš = nš to be used in the fis create of the rootfs)
    fis create -l 0x2F0000 rootfs


A description of the commands
fconfig
This command presents us an interactive secuence by wich we configure RedBoot. It's important to remember to asign the server IP address that we'll use to load the images to be used.

RedBoot> fconfig
   Run script at boot: false
   Use BOOTP for network configuration: false
   Local IP address: 192.168.1.123
   Default server IP address: 192.168.1.42
   DNS server IP address: 192.168.1.254
   GDB connection port: 9000
   Network debug at boot time: false 


fis init
This command is used to initialize the Flash Image System (FIS). It should normally only be executed once, when RedBoot is first installed on the router or when we first delete the partitions the first time we flash. Subsequent executions will cause loss of previously stored information in the FIS.

RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0xbffe0000-0xbfff0000: .
... Program from 0x80ff0000-0x81000000 at 0xbffe0000: .


fis list
This command lists the images currently available in the FIS. Certain images used by RedBoot have fixed names and have reserved slots in the FIS (these can be seen after using the fis init command). Other images can be manipulated by the user.

RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0xBFC00000 0xBFC00000 0x00030000 0x00000000
FIS directory 0xBFFE0000 0xBFFE0000 0x0000F000 0x00000000
RedBoot config 0xBFFEF000 0xBFFEF000 0x00001000 0x00000000

This images list is when no own images has been created or when they have been deleted; you can only see the ones that RedBoot has.


fis delete
This command creates an image in the FIS directory. The reserved images for RedBoot shloud not be deleted.

RedBoot> fis delete rootfs
Delete image 'rootfs' - continue (y/n)? y
... Erase from 0xbfce0000-0xbffe0000: ...........................................
... Erase from 0xbffe0000-0xbfff0000: .
... Program from 0x80ff0000-0x81000000 at 0xbffe0000: .


fis load
This command is used to transfer an image to the router, it's stored in the RAM memory.

RedBoot> load -r -b %{FREEMEMLO} nightwing-vmlinux.lzma
Using default protocol (TFTP)
Raw file loaded 0x80040c00-0x800f0bff, assumed entry at 0x80040c00


fis create
This command creates an image in the FIS directory. We use it to copy what we previously stored in the RAM memory with the fis load command.

RedBoot> fis create -r 0x80041000 kernel
... Erase from 0xbfc30000-0xbfce0000: ...........
... Program from 0x80040c00-0x800f0c00 at 0xbfc30000: ...........
... Erase from 0xbffe0000-0xbfff0000: .
... Program from 0x80ff0000-0x81000000 at 0xbffe0000: .


fis free
This command shows which areas of the flash memory are currently not in use.


RedBoot> fis free
0xBFCE0000 .. 0xBFFE0000


For more information about the use of RedBoot you can see the User's Guide: http://ecos.sourceware.org/ecos/docs-latest/redboot/redboot-guide.html
Report Spam   Logged

Share on Facebook Share on Twitter

JulioCP
Administrator
Full Member
*****
Posts: 113


WWW
« Reply #1 on: April 24, 2008, 07:42:02 pm »

One thing to take in account is that sense we use squashfs and mini_fo, in the first boot after we flash, we have to wait a couple of seconds (after the wifi0 messages) so the mini_fo starts and finishes the post flashing work. After he is done I recommend to reboot again.

You will see this messages:

jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
jffs2_build_filesystem(): unlocking the mtd device... done.
jffs2_build_filesystem(): erasing all blocks after the end marker... done.
mini_fo: using base directory: /
mini_fo: using storage directory: /jffs

When you see the last line, it means that mini_fo has finished its work and you can reboot.
Report Spam   Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum
Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy