560
edits
Changes
From IGEP - ISEE Wiki
no edit summary
* Now we can see an image of which are the steps to boot any module.
With a general processor all start with MLO file and U-Boot.img. Also it is the same procedure for Freescale- NXP. If you want to see how to create these files follow this [[The bootloader U-Boot|link]].
Next step is that once the processor is initialized,call the linux kernel making the execution of your operative system available.
Finally your OS runs and you can initialize the board correctly
===<span id="Texas_Instruments_Processors" class="mw-headline">General Processors</span>===
<span class="mw-headline">Inside General processors we can find Texas Instruments</span>
* The microsd card must be content at latest 2 partitions.
* The first one must be primary partition with the boot flag mark and formated using FAT(16 or 32) file system.
''The processor when boot ONLY load and execute the MLO program and ignore all the rest it's the X-loader(MLO) the program responsible to load the next programs such kernel or uboot if you use this last one approach.''
{{Message/Information Message|title=TITLE|message= <span style="color: #000000;">Freescale has a different structure</span>}}
Therefore, we are going to '''setup a microSD card with these requirements''' and '''install a custom software distribution''' into it.
===<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 0001mmcblk0: mmc0:0001 00000 3.79 GiBmmcblk0: unknown partition table</pre>Ensure all in your microsd card it's erased:]
<span class="mw-headline">In order to start developing with an IGEP PROCESSOR BOARD we can use a microSD Card to flash our system and boot from it. Most of the cases is the easiest way to boot a board.<br /></span>
dmesg
The result have to be similar to this:
[[File:dev.png]]
Now we are ready to create the corresponding partitions in our MicroSD Card.
==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">Other tools as sfdisk and mkfs are useful too.</span>
==='''<div span class="code panel pdl confmw-macro outputheadline">Using Gparted:</span>'''==={| class="contenttable sortable"|-block!|====='''GENERAL CASE'''=====!|====='''NXP PROCESSORS'''=====|-||'''1- '''Select the corresponding device||'''1- '''Select the corresponding device|-||<span class=" datamw-hasbodyheadline">[[File:1.png|429x186px]]</span>||<span class="truemw-headline" data>[[File:1.png|413x179px]]</span>|-||'''2- '''Create a partition table||'''2-macro'''Create a partition table|-||<span class="mw-nameheadline">[[File:2.png|430x202px]]</span><span class="codemw-headline">[[File:SD4.png|433x298px]]</span>||<span class="mw-headline">[[File:2.png|418x197px]]</span><span class="mw-headline">[[File:SD4.png|431x297px]]</span style>|-||'''<span class="mw-headline">3- </span>'''<span class="color: #000000;mw-headline">Using sfdisk Create a FAT32 '''boot '''partition method</span>||<span class=="mw-headline">'''3- '''Create a FAT32 '''boot '''partition '''leaving 8MB before'''</span>|-||<div idspan class="highlighter_789287mw-headline">[[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 MegaBytes* Free Space Preceding: 0 MiBMB* 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'''
|-||'''<span class="mw-headline">4- <br /span>It is recommended to '''apply changes<span class="mw-headline">Create a ext4 '''rootfs ''' now or you might get an error later.partition</span> ===||'''<span idclass="Create_the_ROOTFS_Partitionmw-headline" >4- </span>'''<span class="mw-headline">Create a ext4 '''rootfs '''partition</span>|-||[[File:fat32_c2.png|407x279px]]'''7-''' Check the ROOTFS Partitionresults are similar to the followings:||[[File:fat32_c2.png|407x279px]]|-||'''<span class="mw-headline">5- </span>'''<span class="mw-headline">Apply changes<br /></span>||'''<span class="mw-headline">5- </span>'''<span class="mw-headline">Apply changes</span>The Next step it|-||'''s create the root file system partition<span class="mw-headline">[[File:fat32_c3.png|411x279px]]</span>'''||[[File:im_2.png|403x275px]]|-First you should select the unallocated partition area and then you should go ||'''<span class="mw-headline">6- </span>'''<span class="mw-headline">Set boot flag to the boot partition menu and select the </span>||'''<span class="mw-headline">6- </span>'''<span class="Newmw-headline" option then the application show a window like this>Set boot flag to boot partition</span>|-||[[File:fat32_c4.png|411x278px]]
'''<div span class="centermw-headline"><div class="thumb tnone"><div class="thumbinner"><div class="thumbcaption"><div class="magnify"></div></div></div></div>By doing that we will have ready the microSD Card in order to copy our files.</divspan>After all apply all changes'''
==='''Using SFDISK & MKFS<br />'''===
Another method is to use the following commands in order to prepare the microSD card. These commands will perform the same operations that in the previous part.
{| 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<br>label: dos<br>63,144522,0x0C,*<br>160650,,,-<br>EOF
| style="width: 436.633px;"|
sudo sfdisk /dev/ <<EOF<br>label: dos<br>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="width: 436.633px;"|'''For example:'''
|-
| style="width: 431.367px;"|
sudo sfdisk /dev/<strong>sdc</strong> <<EOF<br data-attributes="%20/">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;"|
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="%20/">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>
|}
='''How to boot each partcopy everything into the MicroSD Card<br />'''=Now we will see where Once the MicroSD is completely prepared, it is time to put each part copy the u-boot, kernel and how root dile system tothe MicroSD Card.
==U-Boot==
'''TexasGeneral processors<br />'''
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 MLO [your_u-boot_directory]/u-.boot.img /media/user/boot cp [your_u-boot_directory]/MLO /media/user/boot
</pre>
You can follow this this post [index.php/[The bootloader U-Boot|U-Boot_Texas_Instruments_Series HowToboot Bootloader]] if if you want build the MLO and u-boot
'''iMX6Freescale processors<br />'''
* 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>Where You can follow this post [[The bootloader U-Boot|U-boot Bootloader]] you want build the u-boot.imx '''How to configure Uenv<br /dev/sde >''' It is your microsd cardneed 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.]