Updating uImage

Please note that astfin2 trunk rev 1200+ supports uIMage update through the web based GUI. User will also have options to reset to factory default or to keep asterisk and network config files.

I will use br4-appliance as an example;

Checkout the applicable branch from Astfin’s svn

svn co https://astfin.svn.sourceforge.net/svnroot/ \
astfin/software/astfin/trunk/ astfin

cd astfin

Select your hardware and related options
make menuconfig

Select BR4 as your target
make
make image

Copy your new uImage from your image_ folder to your tftp folder, usually tftpboot
cp image_br4 /tftpboot/uImage-br4

Now, boot your BR4 and hit any key during the countdown sequence to get to the uboot prompt BR4>

At this point, we will modify few values
setenv ipaddr 104.25.13.88
where 104.25.13.88 is an IP address which you wish to assign to this box

setenv gatewayip 104.25.13.1
where 104.25.13.1 is an IP address of a default gateway of your network

setenv serverip 104.25.13.5
where 104.25.13.5 is an IP address of your tftpserver

Now we need to download the image from the tftpserver
BR4> tftp 2000000 uImage-br4

You should see it being download, please record the image size (bold)
BR4>tftp 2000000 uImage-br4
id: 0x90000a46
MAC: 00:16:d3:2a:c5:b7
device TFTP from server 104.225.213.5;
our IP address is 104.225.213.84
Filename 'uImage-br4'. Load address: 0x2000000
Loading: ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# #################################################
done Bytes transferred = 4576223 (45d3df hex)

BR4>

Now, we need to erase your NAND flash in preparation for a new image.
To do that we will execute the following commands from your u-boot prompt
BR4>nand erase clean
BR4x>nand erase

At this point we are ready to copy our image from memory location 0×2000000 into the beginning of your NAND.
BR4>nand write 0x2000000 0x0 0x460000

where 0×2000000 is the starting memory address where we saved our uImage 0×0 is the offset ( 0×0 means beginning of the flash) 0×460000 is the sizef of uImage.

In the next step, we need to modify the last portion of the u-boot environment and specify the size of the new image for “spiboot” variable
BR4>setenv spiboot 'nand read.jffs2 0x2000000 0x0 0x460000; run addnet; bootm 0x2000000'

So, basically we are saying: read from NAND (file system jffs2) at offset 0 (beginning) the first 0×460000 bytes and save it to memory address 0×2000000; then execute addnet micro then boot from the memory location 0×2000000 (so form where you just saved your kernel and file system image)

Now, very important, you need to save your environment.
BR4>save

Well, you are done, so reboot and watch it fly ;)

BR4>reset
Please note that you can also use our GUI to update firmware on your boxes.

Enjoy Mark

Post a Comment

You must be logged in to post a comment.