Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search

Prepare a bootable MicroSD Card

5,820 bytes removed, 13:12, 11 May 2018
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>
==='''<span class="mw-headline">General case process:</span>'''===
===='''<span class="mw-headline">Finding your device</span>'''====
<span class="mw-headline">[[File:1.png|774x336px733x318px]]</span>
<span class="mw-headline">[[File:2.png|773x364px733x345px]]</span>  
===='''<span class="mw-headline">Erasing all data</span>'''====
After that you can '''Apply'''.
 <span class="mw-headline">[[File:SD4.png|717x494px]]</span>  
===='''<span class="mw-headline">Creating the boot partition</span>'''====
We will configure the partition as:
 
 
* Primary Partition
[[File:SD5.png|768x345px721x324px]]
* It is recommended to '''apply changes''' now or you might get an error later.
<span class="mw-headline">The Next step it's create the root file system partition.<br />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:</span>
 [[File:SD6.png|774x364px710x334px]]  
===='''<span class="mw-headline"><span id="result_box" class="short_text" tabindex="-1" lang="en"><span class="">Characterizing</span></span> the Rootfs</span>'''====
* Other spaces such as the defaults ones
At end we will click on "Add" button.
 
 
[[File:SD7.png|715x319px]]
At end we will click on "Add" button.
[[File:SD7.png|773x345px]]
===='''<span class="mw-headline">Applying changes</span>'''====
<span class="mw-headline">Click on apply button in the main menu after that gparted show a window like this for confirm all operations </span>
[[File:SD8.png|771x346px715x321px]]  
* <span class="mw-headline">We should click on apply button to confirm<br /></span>
 [[File:SD9.png|760x340px722x323px]]  
===='''Loading'''====
When the process finish we can see all changes applied 
 [[File:SD10.png|760x342px724x326px]]  
===='''<span class="mw-headline">Selecting boot flag</span>'''====
<span class="mw-headline">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 "Manage Flags" option</span>'''<span class="mw-headline"><br /></span>'''
 [[File:SD12.png|770x361px719x337px]]
==='''<span class="mw-headline">NXP case process:</span>'''===
 
===='''<span class="mw-headline">Finding your device</span>'''====
<span class="mw-headline">[[File:1.png|774x336px721x313px]]</span>
<span class="mw-headline">[[File:2.png|773x364px731x344px]]</span>  
===='''<span class="mw-headline">Erasing all data</span>'''====
After that you can '''Apply'''.
 <span class="mw-headline">[[File:SD4.png|724x499px]]</span>  
===='''<span class="mw-headline">Creating the boot partition</span>'''====
It is recommended to apply changes now or you might get an error later.
 '''<span class="mw-headline">[[File:SD_IMX_1.png|743x345px728x338px]]</span>''' 
<div><div><div>
===='''<span class="mw-headline">Creating the new partition</span>'''====
<span class="mw-headline">The Next step it's create the root file system partition.<br />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:</span>
</div></div></div><span class="mw-headline">The Next step it's create the root file system partition[[File:SD_IMX_2.<br />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:</span>png|708x333px]]
[[File:SD_IMX_2.png|757x356px]]
===='''<span class="mw-headline"><span id="result_box" class="short_text" tabindex="-1" lang="en"><span class="">Characterizing</span></span> the Rootfs</span>'''====
* Primary Partition
* File system/Format: EXT4
* Size: All the Rest
* Label: Rootfs'''<br />'''
* Other spaces such as the defaults ones
 
At end we will click on "Add" button.
[[File:SD_IMX_3.png|759x358px]]
===='''<span class="mw-headline">Applying changes</span>'''====<span class="mw-headline">Click on apply button in the main menu after that gparted show a window like this for confirm all operations </span>[[File:SD_IMX_3.png|706x333px]]
[[File:SD_IMX_4.png|772x361px]]
* ===='''<span class="mw-headline">Applying changes</span>'''====<span class="mw-headline">We should click Click on apply button to in the main menu after that gparted show a window like this for confirmall operations </span>
<span class="mw-headline">[[File:SD_IMX_5.png|771x363px]]</span>
===='''Loading'''====When the process finish we can see all changes applied [[File:SD_IMX_4.png|712x333px]]
[[File:SD_IMX_7.png|768x361px]]
===='''* <span class="mw-headline">Selecting boot flag</span>'''====<span class="mw-headline">Now we must select the boot flag for the first partition for it we use the right mouse We should click on apply button over the boot partition and select "Manage Flags" optionto confirm</span>
<span class="mw-headline">[[File:SD_IMX_8SD_IMX_5.png|774x362px718x338px]]</span>
===<span id="Preparing_the_microSD_card" class'''Loading'''="mw-headline">Preparing the microSD card</span>===Open a terminal window and clear your dmesg using:When the process finish we can see all changes applied 
<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[[File:SD_IMX_7.png|728x342px]]
<pre>mmc0: new high speed SDHC card at address 0001
mmcblk0: mmc0:0001 00000 3.79 GiB
mmcblk0: 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 /span class="mw-headline">label: dosSelecting boot flag<br /span>16065,128520,0x0C,*'''====<br /span class="mw-headline">144585,,,-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 "Manage Flags" option<br /span>EOF
NORMAL<br />sudo sfdisk /dev/sdc <<EOF<br />label: dos<br />63,144522,0x0C,*<br />160650,,,-<br />EOF
sudo mkfs[[File:SD_IMX_8.vfat -F32 /dev/sdc1 -n boot<br />sudo mkfs.ext3 /dev/sdc2 -L rootfspng|727x340px]]
sudo dd if=./u-boot.imx of=/dev/sdc bs=512 seek=2; sync
==='''SFDISK'''===
<span style="color: #000000;">&nbsp;</span>==='''IMX6'''====
sudo sfdisk /dev/<your_device> <<EOF<br/>label: dos<div class="code panel pdl confbr/>16065,128520,0x0C,*<br/>144585,,,-macro output-block" data-hasbody="true" data-macro-name="code"<br/>EOF<br><br><strong>Example</strong><br/><br/>sudo sfdisk /dev/sdc <<EOF<br/div>==label: dos<span id="GParted_and_Creation_of_Partitions" class="mw-headline"br/>'''Make the partition of the SD'''16065,128520,0x0C,*<br />144585,,,-<br/span>==Now we are going to see some steps with the two methods.EOF
First creating the partition and then how procedure with each processor.
{| class="sortable contenttable" style="width: 890px;"
|-
! style="width: 869px;" colspan="2"|
==='''Defining Partitions'''===
|-
| style="width: 209.783px;"|
=====GPARTED=====
| style="width: 659.217px;"|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.
After that you can '''ApplyExplanation'''.
|-| style="width: 209.783px;"|=====SFDISK=====| style="width: 659.217px;"| sudo sfdisk mkfs.vfat -F32 /dev/ <your_device> -n boot<EOFbr data-attributes="%20/"><brdata-attributes="%20/"><strong>label: dosExample<br/strong>16065,128520,0x0C,*<brdata-attributes="%20/">144585,,,-<brdata-attributes="%20/">EOF|}sudo mkfs.vfat -F32 /dev/sdc1 -n boot
[[File:SFDISK_IMX2.png]]
<div data-hasbody="true" data-macro-name="code">
After that we will create this boot partition first for the IGEP General processors
{| class="contenttable sortable" style="width: 890px;"|-! style="width: 869px;" colspan="2"|===<span id="Create_the_BOOT_Partition_-_IGEP_Texas_Instruments_Processor_based" class="mw-headline">'''Create the BOOT Partition -Explanation''' '''General IGEP Processor based'''</span>===|-| style="width: 164.233px;"|=====<span style="color: #000000;"><span class="mw-headline">GPARTED</span></span>=====| style="width: 704.767px;"|<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:
sudo mkfs.ext4 /dev/<div classyour_device> -L rootfs<br data-attributes="center%20/"><div classbr data-attributes="thumb tnone%20/"><div class="thumbinner"strong>Example</strong><div classbr data-attributes="thumbcaption%20/"><div classbr data-attributes="magnify%20/">sudo mkfs.ext4 /dev/sdc2 -L rootfs[[File:SFDISK_IMX3.png]]
</div>==== ====</div></div></div>We will configure the partition as:* Primary Partition* Format: FAT32* Size: 100 MegaBytes* '''Free Space Preceding: 0 MiB'''* Label: Boot* '''Align to: cylinderHere the result'''
It is recommended to '''apply changes''' now or you might get an error later[[File:SFDISK_NORMAL4.png]]
</div>
|-
| style="width: 164.233px;"|
=====<span style="color: #000000;">SFDISK</span>=====
| style="width: 704.767px;"|Bla bla bla
|}</div>
Specifically for the IGEP NXP-Freescale
{| class="contenttable sortable" style="width: 890px;"|-! style="width: 870px;" colspan="2"|==='''<span id="Create_the_BOOT_Partition_-_IGEP_NXP-Freescale_Processor_based" class="mw-headline">Create the BOOT Partition - IGEP NXP-Freescale Processor based</span>NORMAL'''===|-| style="width: 184.933px;"|=====<span style="color: #000000;"><span class="mw-headline">GPARTED</span></span>=====| style="width: 685.067px;"|<u>This Step it's only for iMX6 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:'Explanation'''
sudo sfdisk /dev/<your_device> <<EOF<br/>label: dos<br/>63,144522,0x0C,*<br/>160650,,,-<br/>EOF<br/><div classbr data-attributes="center%20/"><div class="thumb tnone"strong>Example<div class="thumbinner"/strong><div class="thumbcaption"br/><div classbr data-attributes="magnify%20/">sudo sfdisk /dev/sdc <</div>EOF<br/div>label: dos<br/div>63,144522,0x0C,*<br/div>160650,,,-<br/div>We will configure the partition as:EOF
* Primary Partition* Format[[File: 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. |-| style="width: 184SFDISK_NORMAL1.933px;"|=====<span style="color: #000000;">SFDISK</span>=====| style="width: 685.067px;"|<pre>$ sudo mkfs.vfat -F 32 /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: 871px;" colspan="2"|==='''<span id="Create_the_ROOTFS_Partition" class="mw-headline">Create the ROOTFS Partition</span>'''===|-| style="width: 205px;"|=====<span style="color: #000000;"><span class="mw-headline">GPARTED</span></span>=====| 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: <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:png]]
* Primary Partition
* Format: EXT4
* Size: All the Rest
* Label: Rootfs'''<br />'''
At end we will click on "Add" button.'''Explanation'''
sudo mkfs.vfat -F32 /dev/<div class="center"your_device>-n boot<div classbr data-attributes="thumb tnone%20/"><div classbr data-attributes="thumbinner%20/"><div class="thumbcaption"><div class="magnify"strong>Example</divstrong><br/div><br data-attributes="%20/div"><sudo mkfs.vfat -F32 /div><dev/div>sdc1 -n bootor[[File:SFDISK_IMX2.png]]
<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: 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.'''Explanation'''
sudo mkfs.ext4 /dev/<your_device> -L rootfs<br><ubr><strong>Example</strong><br><br data-attributes="%20/">sudo mkfs.ext4 /dev/sdc2 -L rootfs'''Please, be sure you have write correctly the following command because in if not, it can corrupt your computer<br />[[File:SFDISK_NORMAL3.png]]<br />'''</u>
<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">'''u-boot.imx copy'''</div>
<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.imx copy'''</div>
<div id="highlighter_209438">
$ sudo dd if=/home/user/Project/u-boot/u-boot.imx of=/dev/sdd bs=512 seek=2<br>$ sync</div>
</div>
|}
Finally we will make this.'''The result'''
'''[[File:SFDISK_NORMAL5.png|638x70px]]'''
===='''<span id="Select_.22Boot_flag.22_for_the_boot_partition" class="mw-headline">Select "Boot flag" for the boot partition<br /span>'''====<span class="mw-headline"> <br /span=====<span style="color: #000000ff0000;"><span classsudo dd if="mw./u-headline">GPARTED<boot.imx of=/span><dev/span>sdc bs=512 seek====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 "Manage Flags" option <div class="center"><div class="thumb tnone"><div class="thumbinner"><div class="thumbcaption"><div class="magnify">2; sync ?????</divspan><br /div></div></div></div>Now we have the microsd prepared for copy the boot files'''
560
edits