Robin-Mesh Wiki
Robin-Mesh Wiki > How-to > Install Firmware > Flashing La Fonera over Serial Port

Flashing La Fonera over Serial Port
Flashing La Fonera over Serial PortEdit

Page last modified 07:23, 23 Jan 2011 by ispyisail

    This how-to is based on an article from here

    Flashing La Fonera 2100 (MR3201a) over Serial Port

    Here are instructions for flashing your FON/Accton MR3201a firmware entirely through the serial connector. Most instructions on the web assume that you have telnet over Ethernet access to Redboot.

    This how-to has been complied because of the need to recover routers with dead ethernet ports

    While serial console may be slower than uploading via Ethernet, you’ll save time because you won’t need to set up TFTP server, manually configure TCP/IP, rearrange cords, change cords back, reconfigure DHCP, etc.

    It is possible to transfer the files using XMODEM or YMODEM if you use a terminal emulator like HyperTerminal. ZMODEM would be even faster and more accurate, but redboot does not support ZMODEM. When I used HyperTerminal, I am pretty sure I used hardware handshaking, but k0k0, administrator of FreeWLAN’s forums recommends setting this to NO handshaking. This may be necessary if you can receive text from the serial port, but cannot get it to respond to keystrokes.

    This how-to uses the free hyperterminal that comes with windows XP. Windows vista and above do not come with hyperterminal so other option include

    http://realterm.sourceforge.net/

    http://ttssh2.sourceforge.jp/

    http://www.celestialsoftware.net/

    or

    If you want (or just because you get used to it) you can still use old XP Hyper terminal. Just extract two files hypertrm.dll and hypertrm.exe. You can put them anywhere on the disk, no installation required. Of course, for that you need to have XP to extract files from.

    Firmware

    The two firmware files, openwrt-atheros-root.squashfs and openwrt-atheros-vmlinux.lzma were aquired from this archive

    To start with, you need to have a working serial voltage adapter, details found here

    Start hyperterminal

    set1.png

    set2.png

    Interrupte bootup

    Once you have your serial adaptor connected, boot your router and interrupted the bootup with CTL-C, and executed 

    set3.png

    Enter Commands

    Then enter the following commands in Redboot:

    Set serial speed
    RedBoot> baudrate -b 115200
    Baud rate will be changed to 115200 - update your settings 
    

    Much faster connection, but we need to close and restart HyperTerminal using the new speed

    Format
    RedBoot> fis init -f 

    This deletes all of the onboard firmware!

    About to initialize [format] FLASH image system - continue (y/n)? y
    *** Initialize FLASH Image System
    ... Erase from 0xa8030000-0xa87e0000: ..........................................
    ................................................................................
    .
    ... Erase from 0xa87e0000-0xa87f0000: .
    ... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
    
    Set router to receive image
    RedBoot> load -r -m ymodem -b %{FREEMEMLO} openwrt-atheros-vmlinux.lzma
    send file from hyperterminal

    send file.png

    send file2.png

    typical response from RedBoot:

    CCCCCRaw file loaded 0x8003ec00-0x800eebff, assumed entry at 0x8003ec00
    xyzModem - CRC mode, 2(SOH)/704(STX)/0(CAN) packets, 7 retries

     YMODEM and XMODEM may sit idle for a while before they start transferring. Be patient. 

    RedBoot> fis create -e 0x80041000 -r 0x80041000 vmlinux.bin.l7

    typical response from RedBoot: (THIS CAN TAKE A LONG TIME!)

    ... Erase from 0xa8030000-0xa80e0000: ...........
    ... Program from 0x8003ec00-0x800eec00 at 0xa8030000: ...........
    ... Erase from 0xa87e0000-0xa87f0000: .
    ... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .

     Set router to receive image

    RedBoot> load -r -m ymodem -b %{FREEMEMLO} openwrt-atheros-root.squashfs   
    

    Send file from hyperterminal as per above

    typical response from RedBoot:

    CCCRaw file loaded 0x8003ec00-0x8023ebff, assumed entry at 0x8003ec00
    xyzModem - CRC mode, 2(SOH)/2048(STX)/0(CAN) packets, 5 retries

    Read the free memory

    RedBoot> fis free 
    

    This will lead to the following output (for example):

    0xA8120000 .. 0xA87D0000 

    Addition And Subtraction of Hex Numbers Calculator

    http://www.csgnetwork.com/hexaddsubcalc.html

    Note: Subtract the first value from the second value e.g. 0xA87D0000 - 0xA8120000


    Now with a little math in hexadecimal: 0xA87D0000 - 0xA8120000 = 006b0000
    Write the filesystem in flash, changing 0xCHANGEME with the value obtained above (in our case 006b0000):
    RedBoot> fis create -l 0x"CHANGEME" rootfs
    that will lead to the following output:

    RedBoot> fis create -l 0x700000 rootfs
    ... Erase from 0xa80e0000-0xa87e0000: ..........................................
    ......................................................................
    ... Program from 0x8003ec00-0x8023ec00 at 0xa80e0000: ..........................
    ......
    ... Erase from 0xa87e0000-0xa87f0000: .
    ... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .

     reset router

    RedBoot> reset
    

     

    EDIT: The following page of RedBoot Command Line Options helped me a lot in making this tutorial: AdvancedRelay

    Please leave any comments about this how-to here

    Powered by MindTouch Core