560
edits
Changes
From IGEP - ISEE Wiki
no edit summary
<span class="mw-headline">The following steps details how to prepare a booteable MicroSD Card</span>
=='''<span class="mw-headline">Prepare a SD to boot</span>'''==
<div style="text-align: left;">{{Message/Information Message|message=The following steps has been tested using an Ubuntu 16.04}}</div>
<div style="text-align: left;">First of all it is important to detect which device is our microSD Card. In order to do that we can follow this instructions in a Linux terminal:</div>
<div style="text-align: left; padding-left: 30px;">'''1-''' Clean the ''dmesg'' information:</div>
sudo dmesg -c<div style="text-align: left; padding-left: 30px;">'''2-''' Insert the microSD Card and show the ''dmesg'' information:</div> dmesg<div style="text-align: left;">The result have to be similar to this:</div> [[File:SD1_dev.png]]
<div style="text-align: left;">We can see the name of our device in the system: '''/dev/sdX''' where X is the character assigned by our system, in this case /dev/sdsdc'''e.'''</div>
<div style="text-align: left;">Now we have to ensure that the MicroSD Card is completely clean. We can use the following command to do that:</div>
sudo dd if=/dev/zero of=/dev/sdX bs=1024 count=1024<div style="text-align: left;">Where '''X''' is the character returned previously by your system, for example, in the previous situation:</div> sudo dd if=/dev/zero of=/dev/sde sdc bs=1024 count=1024Before use anyway of partition one good practise is unmount the dev where is inserted the SD. -> <div style="text-align: left;"code>umount /dev/sdx</code> Now we are ready to create the corresponding partitions in our MicroSD Card.</div>
==How to partition the MicroSD card==
<div style="text-align: left;">There are several ways to partition a MicroSD Card. In this post we are using the GParted tool that can be installed as:</div>
sudo apt-get install gparted
<span class="mw-headline">It is important to difference between a MicroSD Card for a NXP processor and the other cases. The process of partition is similar but, in the case of NXP chips, there exists some differences. </span>
==='''<span class="mw-headline">General case processUsing Gparted:</span>'''===<span {| class="mw-headlinecontenttable sortable">[[File:SD2.png]]</span> <span class="mw|-headline">[[File:SD3.png]]</span> <span class="mw-headline">[[File:SD4.png!|776x531px]]</span> ===<span id="Preparing_the_microSD_card" class="mw-headline">Preparing the microSD card</span>'''GENERAL CASE'''===Open a terminal window and clear your dmesg using: <pre>sudo dmesg -c</pre>Now insert a new microsd card in your PC and then check your dmesg: <pre>dmesg</pre>You should see something like this: <pre>mmc0: new high speed SDHC card at address 0001mmcblk0: mmc0:0001 00000 3.79 GiBmmcblk0: unknown partition table</pre>Ensure all in your microsd card it's erased: <pre>$ sudo dd if=/dev/zero of=/dev/mmcblk0 bs=1024 count=1024[sudo] password for jdoe:</pre> sudo sfdisk /dev/sdc <<EOF<br />label: dos<br />16065,128520,0x0C,*<br />144585,,,-<br />EOF NORMAL<br />sudo sfdisk /dev/sdc <<EOF<br />label: dos<br />63,144522,0x0C,*<br />160650,,,-<br />EOF sudo mkfs.vfat -F32 /dev/sdc1 -n boot<br />sudo mkfs.ext3 /dev/sdc2 -L rootfs!| sudo dd if=./u-boot.imx of=/dev/sdc bs=512 seek=2; sync ='''NXP PROCESSORS'''==<span id="Install_GParted" class="mw-headline">Downloading GParted</span>===<span style="color: #ff0000;">In order to prepare a micro SD with your already generated u-boot you need to flash the u|-boot.imx using the command dd. (?)<br/></span> It is important to prepare your micro SD card first creating a partition that leave some free space for the u||'''1-boot.imx. It can be used GPARTED as it is shown in '''Select the image.corresponding device [[File:GPARTED.png|center|713x201px]] In this image we can see the devices plugged in our computer. And it can be installed with this command. <pre>sudo apt-get install gparted</pre><span style="color: #000000;">When the install procedure ends you can call the program from your system tools menu or directly using a terminal console.</span> <span style="color: #000000;"> </span> <div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code"></div> ==<span id="GParted_and_Creation_of_Partitions" class="mw-headline">'''Make the partition of the SD1- '''<br /></span>==Now we are going to see some steps with Select the two methods. First creating the partition and then how procedure with each processor. {| class="sortable contenttable" style="width: 890px;"corresponding device
|-
|-
| style="width: 209.783px;"|=====GPARTED=====| style="width: 659.217px;"|The next step it's create the '''msdos table partition2- ''' for it you should click in the "Device" menu and then in the "Create Partition Table" option.<div class="center"><div class="thumb tnone"><div class="thumbinner" style="text-align: left;"><div class="thumbcaption"><div class="magnify"></div></div><span style="color: #ff0000;">2 FOTOS</span></div></div></div>Check the default option it's create a msdos partition table. After that you can ||'''Apply2- '''.Create a partition table
|-
| style|<span class="widthmw-headline">[[File: 2092.783px;"png|=====SFDISK=====| style430x202px]]</span><span class="widthmw-headline">[[File: 659SD4.217px;"png| sudo sfdisk 433x298px]]</dev/ <<EOF<br>label: dos<brspan>16065,128520,0x0C,*<br>144585,,,-<br>EOF|} |<div data-hasbodyspan class="true" datamw-macro-name="codeheadline">After that we will create this boot partition first for the IGEP General processors {[[File:2.png| 418x197px]]</span><span class="contenttable sortablemw-headline" style="width>[[File: 890px;"SD4.png|431x297px]]</span>
|-
|-
| style="width: 164.233px;"|=====<span style="color: #000000;"><span class="mw-headline">GPARTED</span>[[File:2.png|432x203px]]</span>=====| style="width[[File: 704fat32_c121.767px;"png|<u>This Step it's only for OMAP35xx, DM37xx, AM335x, OMAP5432 processor based IGEP boards.</u>The Next step it's create the partitions for it you should go to the partition menu and select the "New" option then the application show a window like this:429x293px]]
* Primary Partition
* File system/ Format: FAT32* Size: 100 MegaBytesMB* Label: '''Free Space Preceding: 0 MiBBoot'''* Label: Boot
* '''Align to: cylinder'''
We will configure the partition as:
* Free Space Preceding: '''8MB'''
* Primary Partition
* File system/ Format: FAT32* '''Free Space Preceding: 8 MiB'''* Size: 100 MegaBytesMB* Label: '''Boot'''
* '''Align to: cylinder'''
|-
| style|'''<span class="width: 184.933px;mw-headline"|=====>4- </span>'''<span styleclass="color: #000000;mw-headline">SFDISKCreate a ext4 '''rootfs '''partition</span>=====| style|'''<span class="width: 685.067px;mw-headline"|<pre>$ sudo mkfs.vfat 4-F 32 /dev</ span>'''<span class="mw-n bootheadline">Create a ext4 '''rootfs '''partition</prespan> $ sudo mkfs|-||[[File:fat32_c2.ext3 /dev/ png|407x279px]]'''7-L rootfs''' Check the results are similar to the followings:|}|[[File:fat32_c2.png|407x279px]]|- After these steps we will make the root filesystem partition ||'''<span class="mw-headline">5- </span>'''<span class="mw-headline">Apply changes<br /></span> {| |'''<span class="mw-headline">5- </span>'''<span class="contenttable sortablemw-headline" style>Apply changes</span>|-||'''<span class="widthmw-headline">[[File: 890px;"fat32_c3.png|411x279px]]</span>'''||[[File:im_2.png|403x275px]]
|-
|-
| style="width: 205px;"|=====<span style="color[[File: #000000;"><span class="mw-headline">GPARTED</span></span>=====fat32_c4.png| style="width: 666px;"|The Next step it's create the root file system partition. First you should select the unallocated partition area and then you should go to the partition menu and select the "New" option then the application show a window like this:411x278px]]
|-
| style="width: 205px;"|=====SFDISK=====| style="width: 666px;"|Then you only have to use dd command in order to copy the u-boot.imx to the SD card. <u>'''Please, be sure you have write correctly the following command because in if not, it can corrupt your computer.7-'''</u>Check the results are similar to the followings: <div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code"><div class="codeHeader panelHeader pdl"></div><div class="codeHeader panelHeader pdl">||'''u7-boot.imx copy'''</div>Check the results are similar to the followings:<div id="highlighter_550267"> $ sudo dd if=//u|-boot.imx of=/dev/ bs=512 seek=2<br>$ sync</div></div>For example <div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code"><div class="codeHeader panelHeader pdl">'''u-boot||[[File:fat32_c6.imx copy'''</div>png|434x294px]]<div id="highlighter_209438"> $ sudo dd if=/home/user/Project/u-boot/u-boot||[[File:im_3.imx of=/dev/sdd bs=512 seek=2<br>$ sync</div></div>png|438x301px]]
|}
'''<span class="mw-headline">By doing that we will have ready the microSD Card in order to copy our files.</span>'''
{| class="contenttable sortable" style="width: 890px;"|-! style="width: 431.367px;"|GENERAL CASE! style="width: 436.633px;"|NXP PROCESSORS|-| style="width: 431.367px;"| sudo sfdisk /dev/ <<EOF<span br>label: dos<br>63,144522,0x0C,*<br>160650,,,-<br>EOF| style="colorwidth: #000000436.633px;"| sudo sfdisk /dev/ <<EOF<br>label: dos<span classbr>16065,128520,0x0C,*<br>144585,,,-<br>EOF|-| style="width: 431.367px;"| sudo mkfs.vfat -F32 /dev/ -n boot| style="width: 436.633px;"| sudo mkfs.vfat -F32 /dev/ -n boot|-| style="width: 431.367px;"| sudo mkfs.ext4 /dev/ -L rootfs| style="width: 436.633px;"| sudo mkfs.ext4 /dev/ -L rootfs|-| style="width: 431.367px;"|'''For example:'''| style="mwwidth: 436.633px;"|'''For example:'''|-headline| style="width: 431.367px;"| sudo sfdisk /dev/<strong>GPARTEDsdc</spanstrong><<EOF<br data-attributes="%20/span">label: dos<br data-attributes="%20/">63,144522,0x0C,*<br data-attributes="%20/">160650,,,-<br data-attributes="%20/">EOF<br><br>sudo mkfs.vfat -F32 /dev/<strong>sdc1</strong> -n boot<br data-attributes="%20/"><br data-attributes="%20/">sudo mkfs.ext4 /dev/<strong>sdc2</strong> -L rootfs<br><br>| style="width: 436.633px;"|Now we must select the boot flag for the first partition for it we use the right mouse button over the boot partition and select sudo sfdisk /dev/<strong>sdc</strong> <<EOF<br data-attributes="%20/">label: dos<br data-attributes="%20/">16065,128520,0x0C,*<br data-attributes="%20/">144585,,,-<br data-attributes="Manage Flags%20/" option>EOF<br><br>sudo mkfs.vfat -F32 /dev/<strong>sdc1</strong> -n boot<br><br>sudo mkfs.ext4 /dev/<strong>sdc2</strong> -L rootfs<br><br>|}
==U-Boot==
After build or download the MLO and u-boot you should follow the next steps:
* Copy MLO and u-boot.img to primary into the ''root folder'' of the '''boot partition''' <pre>cp [your_u-boot_directory]/u.boot.img /media/user/boot
</pre>
You can follow this post [[How to prepare a bootable MicroSD CardThe bootloader U-Boot|linkU-boot Bootloader]] if you want build the MLO and u-boot
* Copy u-boot.imx using dd before primary partition in raw mode as
<pre>sudo dd ifsudo dd if=/home/user/u-boot[your_u-imxboot_directory]/u-boot.imx of=/dev/sde [your_sd] bs=512 seek=2</pre><You can follow this post [[The bootloader U-Boot|U-boot Bootloader]] you want build the u>Where /dev/sde is your microsd card</u>-boot.imx
It is need to indicate how start the boot. For this reason it will be created a file called uenv.txt with the correct configuration.
We present two examples of help to start the system from the MicroSD Card or from an nfs server.
These two examples have an ip address assigned to them that can be modified as you want.
==Kernel==
Kernel files, '''zImage '''and''' .dtb''', can be copied into the'' root folder'' of the''' boot partition'''
==Root file System==
The root file system have to be extracted into the'' root folder'' of the '''rootfs''' '''partition'''. Where can be [http://labs.isee.biz/index.php/IGEP_Firmware_set-up downloaded here.]