Difference between revisions of "IMX8/iMX8MEVK/Getting Started/Loading Pre-built Images"

From RidgeRun Developer Connection
Jump to: navigation, search
m
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>{{IMX8/Head}}</noinclude>
+
<noinclude>{{IMX8/Head|previous=iMX8MEVK/Getting Started/Software Support|next=iMX8EVK/Yocto|metakeywords=evk,imx8evk,evaluation kit,i.MX8M Quad Evaluation Kit,iMX8MEVK,configure,configuring host machine,yocto images,android images,build,Building the Android platform}}</noinclude>
  
 
__TOC__
 
__TOC__
Line 30: Line 30:
 
  bunzip2 -dk -f  $IMAGE_NAME.sdcard.bz2
 
  bunzip2 -dk -f  $IMAGE_NAME.sdcard.bz2
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
===Write the image to the SD Card===
 +
<pre>
 +
DEVICE=/dev/sdX # The device may change in your system
 +
sudo dd if=$IMAGE_NAME.sdcard of=$DEVICE bs=4M && sync
 +
</pre>
  
 
== Android Images ==
 
== Android Images ==
  
This section describes the boot process of loading the '''i.MX8MQuad EVK''' board with an Embedded Android system image and introduces how to build the software components that create your own system image.
+
This section describes the boot process of loading the '''i.MX8MQuad EVK''' board with an Embedded Android system image and introduces how to build the software components that create your own system image. For more information refer to the [https://www.nxp.com/docs/en/user-guide/Android_User's_Guide.pdf Android User Guide].
  
 
=== Image Storage ===
 
=== Image Storage ===
 
The storage devices on the development system (MMC/SD or NAND) must be programmed with the U-Boot boot loader. The boot process determines which storage device to access based on the [https://developer.ridgerun.com/wiki/index.php?title=IMX8/iMX8MEVK/Getting_Started/Selecting_Boot_Options switch settings]. When the boot loader is loaded and begins execution, the U-Boot environment space is then read to determine how to proceed with the boot process.
 
The storage devices on the development system (MMC/SD or NAND) must be programmed with the U-Boot boot loader. The boot process determines which storage device to access based on the [https://developer.ridgerun.com/wiki/index.php?title=IMX8/iMX8MEVK/Getting_Started/Selecting_Boot_Options switch settings]. When the boot loader is loaded and begins execution, the U-Boot environment space is then read to determine how to proceed with the boot process.
 
=== Image Types ===
 
The images can come from pre-built release packages or be created from source code. Regardless of how you obtain them, all Android images contain the following components:
 
*U-Boot image: ''u-boot.imx''
 
*Boot image: ''boot.img''
 
*Android system root image: ''system.img''
 
*Recovery root image: ''recovery.img''
 
 
For more information about the Android BSP refer to the [https://www.nxp.com/docs/en/user-guide/Android_User's_Guide.pdf Android User Guide].
 
  
 
=== Get NXP Android BSP Image ===
 
=== Get NXP Android BSP Image ===
  
The pre-built images from the package are categorized by boot device and put in the directory with the device name. The latest pre-built image files can be found in Android section on the [https://www.nxp.com/support/developer-resources/run-time-software/i.mx-developer-resources/evaluation-kit-for-the-i.mx-8m-applications-processor:MCIMX8M-EVK?tab=In-Depth_Tab i.MX Software and Development Tool], or on the demo images [https://www.nxp.com/webapp/Download?colCode=IMX_O8.0.0_1.0.0_ANDROID_DEMO_MX7D&appType=license&Parent_nodeId=1458252097425719553900&Parent_pageType=product&Parent_nodeId=1513109797983730444282&Parent_pageType=product&Parent_nodeId=1513109797983730444282&Parent_pageType=product downloader link].
+
The pre-built images from the package are categorized by the boot device and put in the directory with the device name. You can get the pre-built images from the latest [[IMX8/iMX8MEVK/Getting Started/Software_Support | Linux BSP]].
 
 
You can get the prebuilt images from the latest [[IMX8/iMX8MEVK/Getting Started/Software_Support | Linux BSP]].
 
 
You need to decompress the BSP and decompress the bz2 image sdcard included in it.
 
You need to decompress the BSP and decompress the bz2 image sdcard included in it.
  
 
===Loading images onto an SD Card===
 
===Loading images onto an SD Card===
 
====Partition the SD card====
 
====Partition the SD card====
Once you download the pre-built images, the following script can be used to partition an SD card:
+
The images are inside the downloaded BSP tarball called '''<package_name>'''. Let's consider the tarball content is uncompressed in a folder called '''MY_ANDROID''' by running the following command:
 
<pre>
 
<pre>
cd ${MY_ANDROID}/
+
tar -xvf <package_name>
 +
</pre>
 +
 
 +
'''IMPORTANT:''' The minimum SD card size required is '''8 GB'''.
  
sudo ./device/fsl/common/tools/fsl-sdcard-partition.sh -f imx8mq /dev/sdX
+
'''NOTE:''' Unmount all the SD card partitions before running any script inside the aforementioned folder:
 +
<pre>
 +
umount /dev/<device>
 
</pre>
 
</pre>
  
Where the '''X''' in '''/dev/sdX''' is the disk index from ''''a'''' to ''''z''''.
+
Where the '''device''' can be recognized as one of the following options by the host machine:
 +
*'''sdX'''
 +
*'''mmcblkX'''
 +
*Other
  
====SD Requirements====
+
With '''X''' the disk index from ''''a'''' to ''''z''''. We have modified the original script in order to support any name the host computer assign to the SD card device. Such modified script can be obtained from [[iMX8MEVK/Getting_Started/Loading_Pre-built_Images/Android_SD_Partitions_RidgeRun_Script | this page]].  
'''NOTE:''' The minimum SD card size required is '''8 GB'''.
 
  
Different SD card sizes require different partition scripts:
+
Once you have the pre-built images and the new version of the script, you are able to partition an SD card:
 +
<pre>
 +
cd ${MY_ANDROID}/
  
*If the SD card is '''8 GB''', use:
+
sudo ./fsl-sdcard-partition-rr.sh -f imx8mq -c <size_parameter> /dev/<device>
<pre>
 
sudo ./device/fsl/common/tools/fsl-sdcard-partition.sh -f imx8mq /dev/sdX
 
 
</pre>
 
</pre>
  
*If the SD card is '''16 GB''', use:
+
Where the '''<size_parameter>''' should be selected from the table below.
<pre>
 
sudo ./device/fsl/common/tools/fsl-sdcard-partition.sh -f imx8mq -c 14 /dev/sdX
 
</pre>
 
  
*If the SD card is '''32 GB''', use:
+
{| class="wikitable" style="margin-right: auto; margin-left: auto; border: none;"
<pre>
+
|-
sudo ./device/fsl/common/tools/fsl-sdcard-partition.sh -f imx8mq -c 28 /dev/sdX
+
! style="background: black; color: white;" | SD Card Size!! style="background: black; color: white;" | Size Parameter
</pre>
+
|-
 +
! scope="row" | 8GB
 +
| style="text-align: center" | 7
 +
|-
 +
! scope="row" | 16GB
 +
| style="text-align: center" | 14
 +
|-
 +
! scope="row" | 32GB
 +
| style="text-align: center" | 28
 +
|}
  
'''NOTE:''' Unmount all the SD card partitions before running the script:
+
Make sure you have the images required by the '''fsl-sdcard-partition.sh''' script are present inside the '''MY_ANDROID''' folder. The scripts could be the following: '''boot-loader''', '''boot image''', '''system image''', '''recovery image''', '''GPT table image''', and '''vendor image'''. This script requires to install the '''simg2img''' tool on the computer. '''simg2img''' is a tool that converts the sparse system image to raw system image on the Linux OS host computer. The '''android-toolsfsutils''' package includes the '''simg2img''' command for Ubuntu Linux OS. If you don't have '''simg2img''' in your host machine, install it as follows:
 
<pre>
 
<pre>
umount /dev/sdX
+
sudo apt install android-tools-fsutils
 
</pre>
 
</pre>
  
Copy the related '''boot-loader''', '''boot image''', '''system image''', '''recovery image''', '''GPT table image''', and '''vendor image''' in your current directory. This script requires to install the '''simg2img''' tool on the computer. '''simg2img''' is a tool that converts the sparse system image to raw system image on the Linux OS host computer. The '''android-toolsfsutils''' package includes the '''simg2img''' command for Ubuntu Linux OS.
+
<noinclude>{{IMX8/Foot|iMX8MEVK/Getting Started/Software Support|iMX8EVK/Yocto}}</noinclude>
 
 
<noinclude>{{IMX8/Foot|<Replace with "previous" page>|<Replace with "next" page>}}</noinclude>
 

Latest revision as of 12:05, 9 March 2023


NXP Partner Program Registered Vertical.jpg NXP Partner Program Horizontal.jpg
Previous: iMX8MEVK/Getting Started/Software Support Index Next: iMX8EVK/Yocto





Yocto Images

Prebuilt images are .sdcard files, disk images that can be flashed directly to any SD card. These .sdcard files are the simplest way to evaluate the board and Linux features since they easily flash all the required components to boot the iMX8M EVK.

The .sdcard file includes the 4 elements required to boot the board:

  • Bootloader
  • Linux kernel image
  • Device tree
  • Root file system

You can get the prebuilt images from the latest Linux BSP. You need to decompress the BSP and decompress the bz2 image sdcard included in it.

For BSP L4.9.88_2.0.0 run:

##
## BSP and IMAGE_NAME in the example may not match exactly your BSP version. 
## Please make sure you set them accordingly.
##

 BSP=L4.9.88_2.0.0_images_MX8MQ
 tar -xvf $BSP.tar.gz
 cd $BSP

 IMAGE_NAME=fsl-image-qt5-validation-imx-xwayland-imx8mqevk
 bunzip2 -dk -f  $IMAGE_NAME.sdcard.bz2

Write the image to the SD Card

DEVICE=/dev/sdX # The device may change in your system
sudo dd if=$IMAGE_NAME.sdcard of=$DEVICE bs=4M && sync

Android Images

This section describes the boot process of loading the i.MX8MQuad EVK board with an Embedded Android system image and introduces how to build the software components that create your own system image. For more information refer to the Android User Guide.

Image Storage

The storage devices on the development system (MMC/SD or NAND) must be programmed with the U-Boot boot loader. The boot process determines which storage device to access based on the switch settings. When the boot loader is loaded and begins execution, the U-Boot environment space is then read to determine how to proceed with the boot process.

Get NXP Android BSP Image

The pre-built images from the package are categorized by the boot device and put in the directory with the device name. You can get the pre-built images from the latest Linux BSP. You need to decompress the BSP and decompress the bz2 image sdcard included in it.

Loading images onto an SD Card

Partition the SD card

The images are inside the downloaded BSP tarball called <package_name>. Let's consider the tarball content is uncompressed in a folder called MY_ANDROID by running the following command:

tar -xvf <package_name>

IMPORTANT: The minimum SD card size required is 8 GB.

NOTE: Unmount all the SD card partitions before running any script inside the aforementioned folder:

umount /dev/<device>

Where the device can be recognized as one of the following options by the host machine:

  • sdX
  • mmcblkX
  • Other

With X the disk index from 'a' to 'z'. We have modified the original script in order to support any name the host computer assign to the SD card device. Such modified script can be obtained from this page.

Once you have the pre-built images and the new version of the script, you are able to partition an SD card:

cd ${MY_ANDROID}/

sudo ./fsl-sdcard-partition-rr.sh -f imx8mq -c <size_parameter> /dev/<device>

Where the <size_parameter> should be selected from the table below.

SD Card Size Size Parameter
8GB 7
16GB 14
32GB 28

Make sure you have the images required by the fsl-sdcard-partition.sh script are present inside the MY_ANDROID folder. The scripts could be the following: boot-loader, boot image, system image, recovery image, GPT table image, and vendor image. This script requires to install the simg2img tool on the computer. simg2img is a tool that converts the sparse system image to raw system image on the Linux OS host computer. The android-toolsfsutils package includes the simg2img command for Ubuntu Linux OS. If you don't have simg2img in your host machine, install it as follows:

sudo apt install android-tools-fsutils


Previous: iMX8MEVK/Getting Started/Software Support Index Next: iMX8EVK/Yocto