[[bc10]]~
[[bc10-router]] ~

#contents

* bc10-router/arago-project(danny)/NAND boot [#d90c50be]
>
This article explains how to boot arago-console-image from NAND of bc10.  The details of how to create arago-console-image is listed at [[bc10-router/arago-project(danny)/Ubuntu12.04LTS]].~
~
There are roughly three steps to crate and to configure the image for NAND boot.~
~
The different steps for creating and configuring processes require different development environments. These development environments are already used and Their details are discussed at [[bc10-router/arago-projct(danny)/Ubunt12.04LTS]].
- Ubuntu 12.04 LTS
- bc10 arago-console image
- bc10 u-boot

** Ubuntu 12.04 LTS part [#b5b15667]
>
The processes shown below are done on Ubuntu 12.04LTS.~
~
The ubi file should be configured and recreated for booting from NAND. The creating process of the ubi file is described at at [[bc10-router/arago-project(danny)/Ubuntu12.04LTS]].~
~
The reason why recreating the ubi file is that the original ubi file, which has been build at at [bc10-router/arago-project(danny)/Ubuntu12.04LTS]], does not have certain data and cannot allow bc10 to boot from NAND.~
~
To recreating the uni file, mtd-utils is added.~
 $ sudo apt-get install mtd-utils
The ubi file of arago-console-image is renamed to rootfs.ubi.~
 $ cd /home/beat/tisdk/build/arago-tmp-external-linaro-toolchain/deploy/images
 $ cp arago-console-image-beagleboard-20140131034334.rootfs.ubi rootfs.ubi
To recreate the ubi file, ubinize.cfg is modified as shown below. Then, the new ubi file is recreated. The recreated ubi file is copied to Ext4 area ( its directory is /media/EXT3) of a SD card, which is already formatted for working with bc10.~
 $ diff -upN __ubinize.cfg_orig ubinize.cfg
 --- __ubinize.cfg_orig  2014-02-06 14:52:27.473188696 +0900
 +++ ubinize.cfg 2014-02-06 14:52:48.297189782 +0900
 @@ -3,5 +3,5 @@ mode=ubi
  image=/home/beat/tisdk/build/arago-tmp-external-linaro-toolchain/deploy/images/arago-console-image-beagleboard-20140131034334.rootfs.ubifs
  vol_id=0
  vol_type=dynamic
 -vol_name=beagleboard-rootfs
 +vol_name=rootfs
  vol_flags=autoresize
 
 $ sudo ubinize -v -o rootfs.ubi -m 2048 -p 128KiB -s 512 ubinize.cfg
 $ sudo cp rootfs.ubi /media/EXT3/.

** bc10 arago-console-image part [#n02194e8]
>
Boot bc10 with the SD card, which rootfs.ubi has already been copied to. Check the size of NAND partition, then copy uImage and rootfs.ubi into NAND.~
 Checking NAND Partition
 # cat /proc/mtd
 dev:    size   erasesize  name
 mtd0: 00080000 00020000 "X-Loader"
 mtd1: 001e0000 00020000 "U-Boot"
 mtd2: 00020000 00020000 "U-Boot Env"
 mtd3: 00400000 00020000 "Kernel"
 mtd4: 1f980000 00020000 "File System"
 
 Copying uImage
 # cd /boot/
 root@beagleboard:/boot# ls
 uImage        uImage-3.3.7
 root@beagleboard:/boot# flash_erase /dev/mtd3 0 0
 Erasing 128 Kibyte @ 3e0000 -- 100 % complete
 # nandwrite -p /dev/mtd3 uImage
 Writing data to block 0 at offset 0x0
 Writing data to block 1 at offset 0x20000
 ...<snip>
 Writing data to block 26 at offset 0x340000
 
 Copying rootfs.ubi
 # ubiformat -y /dev/mtd4 -f rootfs.ubi
 ubiformat: mtd4 (nand), size 530055168 bytes (505.5 MiB), 4044 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
 libscan: scanning eraseblock 4043 -- 100 % complete
 ubiformat: 4039 eraseblocks are supposedly empty
 ubiformat: 5 bad eraseblocks found, numbers: 89, 107, 731, 881, 2852
 ubiformat: flashing eraseblock 321 -- 100 % complete
 ubiformat: formatting eraseblock 4043 -- 100 % complete
 After this process is completed, bc10 is rebooted and the prompts of u-boot are started.~

** bc10 u-boot part [#ecd306bf]
>
To use the prompts of u-boot, write down MLO and uboot.img on NAND.~
<Code>
This is the end of writing down NAND Boot to bc10.~
~
Turn off bc10 and to remove the SD card, then, restart bc10.~
Make sure that bc10 can be booted without the SD card, which does contain NAND Boot.~
~
Caution: If the file is copied to NAND correctly, the error massage appears when it is booted.~
<Code>
When the error message shows up, restart bc10. Or, turn off the power of bc10 once, then turn on and start bc10 again.~

*** Failure of writing down to NAND and How to turn back to SD boot [#w432e5b3]
If you fail to write down to NAND or if you wish to turn back to boot from a SD Card, please remove the data, which has been stored in the NAND. Please use the u-boot prompt below.
<Code>
To check whether the data in NAND is successfully removed or not, first turn off the power of bc10 and bc10, then, restart bc10. If the data is erased from NAND, the following message appears.~
<Code>
* bc10 NAND Boot Log [#h06e9e11]
>
These is a part of log, which is created when bc10 is booted form NAND Boot.~
<Code>

* Revision History [#q253018b]
> 
- 2014/02/06 This article is initially published



Front page   New List of pages Search Recent changes   RSS of recent changes