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_.png]]
dmesgThe result have to be similar to this: [[File: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==
<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>'''==={| class="contenttable sortable"|-!|=====<span class'''GENERAL CASE'''=====!|===="mw-headline">Finding your device</span>='''NXP PROCESSORS'''=====|-||'''1- '''Select the corresponding device||'''1- '''Select the corresponding device|-||<span class="mw-headline">[[File:1.png|774x336px429x186px]]</span> ======||<span class="mw-headline">Create the MSDOS Partition Table [[File:1.png|413x179px]]</span>======|-||'''2- '''Create a partition table||'''2- '''Create a partition table|-||<span class="mw-headline">The next step it's create the msdos table partition for it you should click in the "Device" menu and then in the "Create Partition Table" option[[File:2. png|430x202px]]</span> <span class="mw-headline">[[File:2SD4.png|773x364px433x298px]]</span> ======||<span class="mw-headline">Erasing all data[[File:2.png|418x197px]]</span>======<span class="mw-headline">Check the default option it's create a msdos partition table[[File:SD4.png|431x297px]]</span>|-||'''<span class="mw-headline"><br />3- </span>''' After that you can '''Apply'''. <span class="mw-headline">[[File:SD4.png]]Create a FAT32 '''boot '''partition</span> ======||<span class="mw-headline">Creating the '''3- '''Create a FAT32 '''boot '''partition'''leaving 8MB before'''</span>======|-||<span class="mw-headline">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[[File:2.png|432x203px]]</span>[[File:fat32_c121.png|429x293px]]
We will configure the partition as:
* Free Space Preceding: 1MB
* Primary Partition
* File system/ Format: FAT32
* Size: 100 MegaBytesMB* Label: '''Boot'''
* '''Align to: cylinder'''
||
<span class="mw-headline">[[File:2.png|432x203px]]</span>[[File:im_1.png|425x290px]]
* Free Space Preceding: '''8MB'''
* Primary Partition
* File system/ Format: EXT4FAT32* Size: All the Rest100 MB* Label: Rootfs'''<br />Boot'''* Other spaces such as the defaults ones'''Align to: cylinder'''
|-
|-
| style="width: 209.783px;"|=====GPARTED=====| style="width[[File: 659fat32_c4.217px;"png|The next step it's create the '''msdos table partition''' 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.411x278px]]
||
[[File:IM_25.png|414x281px]]
|-
|-
| style="width|[[File: 164fat32_c6.233px;"png|434x294px]]=====<span style="color: #000000;"><span class="mw-headline">GPARTED</span></span>=====| style="width|[[File: 704im_3.767px;"png|<u>This Step it's only for OMAP35xx, DM37xx, AM335x, OMAP5432 processor based IGEP boards.</u>438x301px]]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:|}
'''<div span class="centermw-headline">By doing that we will have ready the microSD Card in order to copy our files.<div class="thumb tnone"><div class="thumbinner"><div class="thumbcaption"><div class="magnify"/span>'''
{| class="contenttable sortable" style="width: 890px;"
|-
! style="width: 870px431.367px;" colspan="2"|GENERAL CASE==='''<span id! style="Create_the_BOOT_Partition_-_IGEP_NXP-Freescale_Processor_basedwidth: 436.633px;" class="mw-headline">Create the BOOT Partition - IGEP |NXP-Freescale Processor based</span>'''===PROCESSORS
|-
| style="width: 184431.933px367px;"|===== sudo sfdisk /dev/ <<EOF<span style="colorbr>label: #000000;">dos<span class="mw-headline"br>GPARTED63,144522,0x0C,*</spanbr>160650,,,-</spanbr>=====EOF| style="width: 685436.067px633px;"|<u>This Step it's only for iMX6 processor based IGEP boards.< sudo sfdisk /dev/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: <div class="center"><div class="thumb tnone">EOF<div class="thumbinner"br>label: dos<div class="thumbcaption"br>16065,128520,0x0C,*<div class="magnify"br>144585,,,-</div></divbr></div></div></div>We will configure the partition as: * Primary Partition* Format: FAT32* '''Free Space Preceding: 8 MiB'''* Size: 100 MegaBytes* Label: Boot* '''Align to: cylinder''' It is recommended to '''apply changes''' now or you might get an error later.EOF
|-
| style="width: 184431.933px367px;"|=====<span style="color: #000000;">SFDISK< sudo mkfs.vfat -F32 /dev/span>=====-n boot| style="width: 685436.067px633px;"|<pre>$ sudo mkfs sudo mkfs.vfat -F 32 F32 /dev/ -n boot</pre> $ sudo mkfs.ext3 /dev/ -L rootfs|} After these steps we will make the root filesystem partition <span class="mw-headline"><br /></span> {| class="contenttable sortable" style="width: 890px;"
|-
|-
| style="width: 205px431.367px;"|=====<span style="color'''For example: #000000;"><span class="mw-headline">GPARTED</span></span>====='''| style="width: 666px436.633px;"|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: <div class="center"><div class="thumb tnone"><div class="thumbinner"><div class="thumbcaption"><div class="magnify"></div></div></div></div></div>We will configure the rootfs partition as: * Primary Partition* Format: EXT4* Size: All the Rest* Label: Rootfs'''<br />For example:''' At end we will click on "Add" button. <div class="center"><div class="thumb tnone"><div class="thumbinner"><div class="thumbcaption"><div class="magnify"></div></div></div></div></div>or <div class="center"><div class="thumb tnone"><div class="thumbinner"><div class="thumbcaption"><div class="magnify"></div></div></div></div></div>After all apply all changes
|-
| style="width: 205px431.367px;"|=====SFDISK=====| style="width: 666px;"|Then you only have to use dd command in order to copy the u-boot.imx to the SD card. sudo sfdisk /dev/<ustrong>'''Please, be sure you have write correctly the following command because in if not, it can corrupt your computer.'''sdc</ustrong> <div class<EOF<br data-attributes="code panel pdl conf-macro output-block%20/" >label: dos<br data-hasbodyattributes="true%20/" >63,144522,0x0C,*<br data-macro-nameattributes="code%20/">160650,,,-<div classbr data-attributes="codeHeader panelHeader pdl%20/">EOF<br><br>sudo mkfs.vfat -F32 /dev/div<strong>sdc1</strong> -n boot<div classbr data-attributes="codeHeader panelHeader pdl%20/">'''u<br data-bootattributes="%20/">sudo mkfs.imx copy'''ext4 /dev/<strong>sdc2</divstrong> -L rootfs<br><br><div id| style="highlighter_550267width: 436.633px;">| $ sudo dd if=//u-boot.imx of=sfdisk /dev/ bs=512 seek=2<brstrong>$ syncsdc</divstrong></div>For example <div classEOF<br data-attributes="code panel pdl conf-macro output-block%20/" >label: dos<br data-hasbodyattributes="true%20/" >16065,128520,0x0C,*<br data-macro-nameattributes="code%20/">144585,,,-<div classbr data-attributes="codeHeader panelHeader pdl%20/">'''u-boot.imx copy'''EOF</divbr><div id="highlighter_209438"br> $ sudo dd if=mkfs.vfat -F32 /homedev/user<strong>sdc1</Project/u-boot/ustrong> -n boot<br><br>sudo mkfs.imx of=ext4 /dev/sdd bs=512 seek=2<brstrong>$ syncsdc2</divstrong> -L rootfs<br></divbr>
|}
==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.]