1.The idea is to load the flashing files into the board memory through tftp network, then flash them to Nor.
First clear the memory (0xff)
mw.b 0x80600000 0xff 0x1000000 --The third parameter is the size (16MB)
Load files to the board memory through tftp
tftp 0x80600000 u-boot-with-spl.bin
2.Write data from memory to Nor
sf probe
sf erase 0x0 0x40000 --Clear uboot region (256K)
sf write 0x80600000 0x0 0x40000 --write uboot into Nor
We can also process it all at once, first load all the needed files into the board memory, then flash them together. This method requires us to know the relative position of each file in the memory.
mw.b 0x80600000 0xff 0x1000000
tftp 0x80600000 u-boot-with-spl.bin
tftp 0x80640000 uImage
tftp 0x80900000 rootfs.squashfs
tftp 0x80b80000 appfs.jffs2
sf probe
sf erase 0x0 0x800000
sf write 0x80600000 0x0 0x800000
For the first method,or in case there is no network, the system needs SD card to start,then flash uboot into Nor. After that, we can use tftp to continue with the process.
1.Format the SD card,then flash the uboot into the SD card. --This step needs to be done only once,no need to do it more than one time unless there is a new version of uboot. The next steps process the SD card and make it both bootable and usable (usual purpose).
umount /media/user/*c.Partition SD card as follows:
fdisk /dev/sdb
> o --create a new partition table
> n --add a new partition
--at this point, you might have a message like:
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p):
Using default response p
--default response is p, so it will create the primary partition
Partitioin number (1-4,default value is 1):
If we use default value 1
--it will choose the partition number 1
Start sector (2048-15130623,default value is 2048):
If we use 2048
Last sector, +sector or +size{K,M,G} (2048-15130623,default: 15130623):
If we use 15130623
--2048 number sector is in 1MB's position, it gives empty space to uboot.
Last step,input w,write the partition table to the SD card.
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
--Partition table is created at this point.
d.implement sync,pull the card out,insert it again,PC will recognize the partition
mkfs.vfat /dev/sdb1f.Compile u-boot. "make isvp_t10_msc0",this command will flash the generated u-boot-with-spl.bin (not u-boot-with-spl-mbr-gpt.bin) file into the SD card, also will cause a offset of 17 KB:
dd if=u-boot-with-spl.bin of=/dev/sdb bs=1024 seek=17
2.Insert the SD card,copy u-boot-with-spl.bin,uImage,rootfs_glibc.jffs2,data.jffs2 into SD card's vfat regions.
3.Use SD card to start the system on board,Enter uboot command interface by pressing "Enter" right after turning on the board.
Clear the memory (0xff)
mw.b 0x80600000 0xff 0x1000000 --The third parameter is the size(16MB).
ls SD card files
isvp# fatls mmc 0
222944 u-boot-with-spl.bin
2368879 uimage
5 file(s), 0 dir(s)
load files to the memory
fatload mmc 0 0x80600000 u-boot-with-spl.bin
Then flash the files into Nor
sf probe
sf erase 0x0 0x40000 --Clear uboot region(256K)
sf write 0x80600000 0x0 0x40000 --Write uboot into Nor.
The current method is an online flashing method (after starting the file system)
flash_erase /dev/mtdX 0 0,clear the regions that need to be updated(it is not recommended to clear the root region)dd if=[bin file path] of=/dev/mtdX,Flashing process.