i.MX8 - iMX8MEVK - Getting Started - Loading Pre-built Images

From RidgeRun Developer Connection
< IMX8‎ | iMX8MEVK‎ | Getting Started
Revision as of 13:54, 12 November 2018 by Jcruz (talk | contribs) (Building Android images)
Jump to: navigation, search


NXP Partner Program Registered Vertical.jpg NXP Partner Program Horizontal.jpg
  Index  





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

Android Images

This section describes how to build Android Oreo 8.1 platform for the i.MX 8 series devices.

Requirements

The minimum recommended system requirements are the following:

  • 16 GB RAM
  • 300 GB hard disk

Establishing a Build Environment (Host Machine)

The host development environment for Android is based on Ubuntu and Debian. Please install Ubuntu version 14.04/16.04 64bit LTS or Debian 8.4 64bit. Those are the recommended Operating Systems for Android.

Setting up a Linux Environment

  • Select a Branch: You can choose to download and build the latest source code (called master), in which case you will simply omit the branch specification when you initialize the repository. Otherwise, you should specify the branch you plan to use. Find more information about platform codenames, versions, API Levels and NDK Releases in this page. You can access the whole Git repositories on Android in here.

Required Packages

In addition to the packages requested on the Android website, the following packages are also needed:

sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib 
sudo apt-get install libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils 
sudo apt-get install xsltproc unzip mtd-utils u-boot-tools lzop liblzo2-2 liblzo2-dev zlib1g-dev liblz-dev uuid uuid-dev android-tools-fsutils
sudo apt-get install bc
sudo apt-get install device-tree-compiler
sudo apt-get install gdisk

Installing the Java Development Kit (JDK)

The master branch of Android comes with pre-built versions of OpenJDK below prebuilts/jdk/ so no additional installation is required.

  • For Ubuntu >= 15.04 run the following:
sudo apt-get update
sudo apt-get install openjdk-8-jdk

If your Ubuntu version is missing the package (which shouldn't happen), add the PPA repository and run the previous commands again:

sudo add-apt-repository ppa:openjdk-r/ppa

Update the default Java version by running:

sudo update-alternatives --config java
sudo update-alternatives --config javac

Unpack the Android Release Package

After you have set up a computer running Linux OS, unpack the Android release package as follows:

cd ~ (or any other directory you like)
tar xzvf imx-o8.1.0_1.3.0_8m.tar.gz

Building the Android platform for i.MX

Getting i.MX Android release source code

The image can be downloaded in the following link, this image is provided by Variscite.

Android Oreo 8.1

The i.MX Android release source code consists of 3 parts:

  • NXP i.MX public source code: maintained in the CodeAurora Forum repository.
  • AOSP Android public source code: maintained in android.googlesource.com.
  • NXP i.MX Android proprietary source code package: maintained in www.NXP.com. Get the code from the following link: i.MX Android Source Code Package

Assume you had i.MX Android proprietary source code package imx-o8.1.0_1.3.0_8m.tar.gz under ~/. directory. To generate the i.MX Android release source code build environment, execute the following commands:

mkdir ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
export PATH=${PATH}:~/bin
source ~/imx-o8.1.0_1.3.0_8m/imx_android_setup.sh
# By default, the imx_android_setup.sh script will create the source code build environment in the folder ~/android_build
# ${MY_ANDROID} will be refered as the i.MX Android source code root directory in all i.MX Andorid release documentation.
export MY_ANDROID=~/android_build

Building Android images

Commands lunch <buildName-buildType> to set up the build configuration and make to start the build process are executed. The build configuration command lunch can be issued with an argument <Build name>-<Build type> string, such as lunch evk_8mq-userdebug, or can be issued without the argument, which will present a menu of options to select. The Build Name is the Android device name found in the directory ${MY_ANDROID}/device/fsl/. The following table lists the i.MX Build Names.

Build Name Description
evk_8mq i.MX 8MQuad EVK Board

The build type is used to specify what debug options are provided in the final image. The following table lists the Build Types.

Build Type Description
user Production-ready image, no debug
userdebug Provides image with root access and debug, similar to "user"
eng Development image with debug tools

Android build steps are as follows: 1. Change to the top level build directory.

cd ${MY_ANDROID}

2. Set up the environment for building. This only configures the current terminal.

source build/envsetup.sh

3. Execute the Android lunch command. In this example, the setup is for the production image of i.MX 8MQuad EVK Board/Platform device with userdebug type.

lunch evk_8mq-userdebug

4. Execute the make command to generate the image.

make 2>&1 | tee build-log.txt

When the make command is complete, the build-log.txt file contains the execution output. Check for any errors.


[[IMX8/<Replace with "previous" page>|Previous: <Replace with "previous" page>]] Index [[IMX8/<Replace with "next" page>|Next: <Replace with "next" page>]]