Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search

Prepare a bootable NAND/eMMC

405 bytes added, 16:20, 17 September 2018
m
The purpose of this tutorial is to show how to flash a complete linux (u-boot + kernel + rootfs) into the internal storage of the system.
 
This steps has to be followed inside a board running a Linux from a external interface.
{| class="contenttable sortable"
==Flash into NAND (Tesdted with am335x based procesor)==
'''{{Message/Information Message|message=This steps has been followed using a Linux Kernel 4.9 and a IGEP SMARC MODULE AM335x}}'''
 
First, we will start with the case of using a NAND flash as internal storage.
Now we can flash the MLO in the first partition '''/dev/mtd0'''. It important to know that in this case (because it is a NAND flash and we have to record the MLO) we have to flash it four times in the first 4 blocks of this partition. In order to know the exact addresses we can check the documentation of the chip developer (in this case: [http://jira.isee.biz:8090/pages/viewpage.action?pageId=6619137 AM335x U-Boot User's Guide (Texas Documentation)] <span class="mw-headline">'''NAND Layout'''</span>) and will get the offset addresses '''[0x0 0x20000 0x40000 0x60000]''' . For each one of this addresses we have to write:
<pre>nandwrite -p -s[https://en.wikipedia.org/wiki/UBIFS address] /dev/mtd0 [https:your_MLO]<//en.wikipedia.org/wiki/UBIFS /dev/mtd0pre>
For example:
Then we will flash into the second partition '''/dev/mtd1''' the u-boot.img:
<pre>nandwrite -p /dev/mtd1 [your_u-boot.img]</pre>
For example:
mkdir /tmp/flashroot<br data-attributes="%20/">mount -t ubifs ubi0:rootfs /tmp/flashroot/<br data-attributes="%20/">cd /tmp/flashroot/<br data-attributes="%20/">tar -xf /home/root/flash_files/my_rootfs.tar -C .<br data-attributes="%20/">cd /<br data-attributes="%20/">umount /tmp/flashroot<br data-attributes="%20/">ubidetach -p /dev/mtd3
==Flash into eMMC (Tested with IGEP0046iMX6-DualLite)=='''{{Message/Information Message|message=This steps has been followed using a Linux Kernel 4.9 and a IGEP SMARC MODULE iMX6}}'''<br />Flashing into a eMMC is quite similar to flash a SD card. This tutorial is going to be focus in the i.MX chip boards. This chips specifies that the u-boot.imx file (MLO+img) has to be at the beginning without format. Knowing this we have to create the partitions in a different way, leaving 8MB before the beginning of the first partition.
<br />We begin by unmounting and clearing the partition on the eMMC (mmcblk2 in this case)
cp /tmp/mmcblk2p2/boot/zImage /tmp/mmcblk2p1<br data-attributes="%20/">cp -f /tmp/mmcblk2p2/boot/imx6*.dtb /tmp/mmcblk2p1
 
[[Category:Boot_loaders]]
[[Category:Software]]
[[Category:Software_distributions]]