Changes

Prepare a bootable MicroSD Card

10,236 bytes added, 10:40, 9 May 2018
Created page with "==Introduction== images ==<span id="Prerequisites" class="mw-headline">Prerequisites</span>== * PC with Linux (We use for this how to Ubuntu 16.04 LTS) * MicroSD Card (4 Gb..."
==Introduction==
images



==<span id="Prerequisites" class="mw-headline">Prerequisites</span>==
* PC with Linux (We use for this how to Ubuntu 16.04 LTS)
* MicroSD Card (4 Gbytes - class 4) or bigger ...
* Tools such, fdisk, mkfs.ext3, mkfs.vfat, gparted ...
* Cross Toolchain included in Ubuntu 16.04 LTS gcc version 4.9.3 (Ubuntu/Linaro 4.9.3-13ubuntu2).

==<span id="ToolChain" class="mw-headline">ToolChain</span>==
* Read: [index.php/Ubuntu_16.04_LTS_Toolchain Ubuntu 16.04 LTS Toolchain]

==<span id="Preparing_the_microSD_card" class="mw-headline">Preparing the microSD card</span>==
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 0001
mmcblk0: mmc0:0001 00000 3.79 GiB
mmcblk0: unknown partition table
</pre>
Ensure all in your microsd card it's erased:

$ sudo dd if=/dev/zero of=/dev/mmcblk0 bs=1024 count=1024
[sudo] password for jdoe:
==<span class="mw-headline">Prepare a SD to boot</span>==

===<span id="Install_GParted" class="mw-headline">Install GParted</span>===
We will use the gparted program for create the partitions, if you don't have this program installed then you must install it with this command:

<pre>sudo apt-get install gparted</pre>
<span style="color: #ff0000;">Another method is using fdisk and creating directly two partitions:</span>

<div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code">
===<span style="color: #ff0000;">Use sfdisk partition method</span>===
<div class="codeContent panelContent pdl"><div id="highlighter_789287" class="syntaxhighlighter sh-eclipse nogutter bash">
{| class=" contenttable" border="0" cellspacing="0" cellpadding="0"
|-
| class="code"|<div class="container" title="Hint: double-click to select code"><div class="line number1 index0 alt2"><span style="color: #ff0000;"><code class="bash functions">sudo</code> <code class="bash plain">sfdisk </code><code class="bash plain">/dev/</code><code class="bash plain"><your_sd> <<EOF</code></span>


<div class="line number2 index1 alt1"><span style="color: #ff0000;"><code class="bash plain">label: dos</code></span></div>
<div class="line number3 index2 alt2"><span style="color: #ff0000;"><code class="bash plain">16065,128520,0x0C,*</code></span></div>
<div class="line number4 index3 alt1"><span style="color: #ff0000;"><code class="bash plain">144585,,,-</code></span></div>
<div class="line number5 index4 alt2"><span style="color: #ff0000;"><code class="bash plain">EOF</code></span></div>
</div>
</div>
|}</div>
</div>
</div>
<div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code"><div class="codeHeader panelHeader pdl">'''Define partitions'''</div>
<div class="codeContent panelContent pdl"><div id="highlighter_144340" class="syntaxhighlighter sh-eclipse nogutter bash">
{| class=" contenttable" border="0" cellspacing="0" cellpadding="0"
|-
| class="code"|<div class="container" title="Hint: double-click to select code"><div class="line number1 index0 alt2"><code class="bash plain">$ </code><code class="bash functions">sudo</code> <code class="bash plain">mkfs.vfat -F 32 </code><code class="bash plain">/dev/</code><code class="bash plain"><your_sd_partition1> -n boot</code>


<div class="line number2 index1 alt1"><code class="bash plain">$ </code><code class="bash functions">sudo</code> <code class="bash plain">mkfs.ext3 </code><code class="bash plain">/dev/</code><code class="bash plain"><your_sd_partition2> -L rootfs</code></div>
</div>
</div>
|}</div>
</div>
</div>
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.'''</u>



<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 class="codeContent panelContent pdl"><div id="highlighter_550267" class="syntaxhighlighter sh-eclipse nogutter bash">
{| class=" contenttable" border="0" cellspacing="0" cellpadding="0"
|-
| class="code"|<div class="container" title="Hint: double-click to select code"><div class="line number1 index0 alt2"><code class="bash plain">$ </code><code class="bash functions">sudo</code> <code class="bash functions">dd</code> <code class="bash keyword">if</code><code class="bash plain">=/<your_u-boot_directory></code><code class="bash plain">/u-boot</code><code class="bash plain">.imx of=</code><code class="bash plain">/dev/</code><code class="bash plain"><your_sd> bs=512 seek=2</code>


<div class="line number2 index1 alt1"><code class="bash plain">$ </code><code class="bash functions">sync</code></div>
</div>
</div>
|}</div>
</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 class="codeContent panelContent pdl"><div id="highlighter_209438" class="syntaxhighlighter sh-eclipse nogutter bash">
{| class=" contenttable" border="0" cellspacing="0" cellpadding="0"
|-
| class="code"|<div class="container" title="Hint: double-click to select code"><div class="line number1 index0 alt2"><code class="bash plain">$ </code><code class="bash functions">sudo</code> <code class="bash functions">dd</code> <code class="bash keyword">if</code><code class="bash plain">=</code><code class="bash plain">/home/user/Project/u-boot/u-boot</code><code class="bash plain">.imx of=</code><code class="bash plain">/dev/sdd</code> <code class="bash plain">bs=512 seek=2</code>


<div class="line number2 index1 alt1"><code class="bash plain">$ </code><code class="bash functions">sync</code></div>
</div>
</div>
|}</div>
</div>
</div>


==<span id="GParted_and_Creation_of_Partitions" class="mw-headline">GParted and Creation of Partitions</span>==
When the install procedure ends you can call the program from your system tools menu or directly using a terminal console.

<div class="center"><div class="thumb tnone"><div class="thumbinner">[[]]<div class="thumbcaption"><div class="magnify"></div>
</div>
</div>
</div>
</div>
===<span id="Create_the_MSDOS.C2.A0Partition_Table" class="mw-headline">Create the MSDOS Partition Table</span>===
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">[[]]<div class="thumbcaption"><div class="magnify"></div>
</div>
</div>
</div>
</div>
Check the default option it's create a msdos partition table.

After that you can '''Apply'''.


===<span id="Create_the_BOOT_Partition_-_IGEP_Texas_Instruments_Processor_based" class="mw-headline">Create the BOOT Partition - IGEP Texas Instruments Processor based</span>===
<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:

<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 partition as:

* Primary Partition
* Format: FAT32
* Size: 100 MegaBytes
* Free Space Preceding: 0 MiB
* Label: Boot
* '''Align to: cylinder'''

It is recommended to '''apply changes''' now or you might get an error later.

===<span id="Create_the_BOOT_Partition_-_IGEP_NXP-Freescale_Processor_based" class="mw-headline">Create the BOOT Partition - IGEP NXP-Freescale Processor based</span>===
<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:

<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 partition as:

* Primary Partition
* Format: FAT32
* Free Space Preceding: 8 MiB
* Size: 100 MegaBytes
* Label: Boot
* '''Align to: cylinder'''

<br />It is recommended to '''apply changes''' now or you might get an error later.

===<span id="Create_the_ROOTFS_Partition" class="mw-headline">Create the ROOTFS Partition</span>===
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 />'''

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

===<span id="Select_.22Boot_flag.22_for_the_boot_partition" class="mw-headline">Select "Boot flag" for the boot partition</span>===
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"></div>
</div>
</div>
</div>
</div>
Now we have the microsd prepared for copy the boot files


==How to boot each part==
Now we will see where to put each part and how to.

==U-Boot==
How to record the U-Boot

==Root file System==
How to record the Root file System

==Kernel & Modules==
How to record the Kernel & Modules
560
edits