SlideShare a Scribd company logo
1 of 50
Download to read offline
Daniel Chiu
2017/7/3
Mobile: +886-928-282-503
daniel.chiu@sacsystem.com.tw
Build and Run Android N Source Code
for NXP’s i.MX 6Q SABRE-SD Platform
Preface
The document describes how to build Android Nougat 7.1 platform for the
i.MX6 and i.MX7 series SABRE devices. It provides instructions for
• Setting up a Linux build environment
• Downloading, patching, and building the software components that
create the Android system image
• Copying the images to a boot media
• Hardware/software configurations for programming the boot media and
running the images
Agenda
1) Setting up your computer
2) Getting Android source code (AOSP)
3) Getting kernel and U-Boot source code
4) Apply all the i.MX Android patch
5) Building Android images
6) Programming images with MFGTool
7) Booting
Agenda
1) Setting up your computer
2) Getting Android source code (AOSP)
3) Getting kernel and U-Boot source code
4) Apply all the i.MX Android patch
5) Building Android images
6) Programming images with MFGTool
7) Booting
Setting up your computer: 64-bit environment
Ubuntu 14.04 LTS, 64-bit
• 16GB RAM
• 300GB disk space
• http://ftp.ubuntu-tw.org/mirror/ubuntu-releases/14.04.5/ubuntu-14.04.5-
desktop-amd64.iso
Setting up your computer: JDK
OpenJDK8 Packages
Setting up your computer: JDK (cont.)
OpenJDK8 Installation
1) Download openjdk-8-jre-headless_8u45-b14-1_amd64.deb
2) Download openjdk-8-jre_8u45-b14-1_amd64.deb
3) Download openjdk-8-jdk_8u45-b14-1_amd64.deb
4) $ sudo apt-get update
5) $ sudo dpkg -i openjdk-8-jre-headless_8u45-b14-1_amd64.deb
6) $ sudo dpkg -i openjdk-8-jre_8u45-b14-1_amd64.deb
7) $ sudo dpkg -i openjdk-8-jdk_8u45-b14-1_amd64.deb
8) $ sudo apt-get -f install
9) $ java –version
Setting up your computer: JDK (cont.)
OpenJDK8 Installation
$ sudo dpkg -i openjdk-8-jre-headless_8u45-b14-1_amd64.deb
Setting up your computer: JDK (cont.)
OpenJDK8 Installation
$ sudo dpkg -i openjdk-8-jre_8u45-b14-1_amd64.deb
Setting up your computer: JDK (cont.)
OpenJDK8 Installation
$ sudo dpkg -i openjdk-8-jdk_8u45-b14-1_amd64.deb
Setting up your computer: Required package on
the Android website
// Installing required packages for Android(Ubuntu 14.04)
$ sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl
zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev
x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev
libxml2-utils xsltproc unzip
Setting up your computer: Additional requested
packages
$ sudo apt-get install uuid uuid-dev zlib1g-dev liblz-dev liblzo2-2 liblzo2-
dev lzop git-core curl u-boot-tools mtd-utils android-tools-fsutils
libncurses5-dev
Agenda
1) Setting up your computer
2) Getting Android source code (AOSP)
3) Getting kernel and U-Boot source code
4) Apply all the i.MX Android patch
5) Building Android images
6) Programming images with MFGTool
7) Booting
Getting Android source code
• Installing Repo tool
$ cd ~
$ mkdir bin
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
• Create working directory
$ mkdir android_7.1.1_r13 && cd android_7.1.1_r13
• Configure git with your real name and email address
$ git config --global user.name "Your Name"
$ git config --global user.email “you@example.com”
• Check out a branch
$ ~/bin/repo init -u https://android.googlesource.com/platform/manifest -b
android-7.1.1_r13
$ ~/bin/repo sync # This command loads most needed repos.
Therefore, it can take several hours to load
Getting Android source code (cont.)
Agenda
1) Setting up your computer
2) Getting Android source code (AOSP)
3) Getting kernel and U-Boot source code
4) Apply all the i.MX Android patch
5) Building Android images
6) Programming images with MFGTool
7) Booting
Getting kernel and U-Boot source code
Get N7.1.1_1.0.0 kernel source code from Freescale open source git:
$ cd ~/android_7.1.1_r13
$ git clone git://git.freescale.com/imx/linux-imx.git kernel_imx
$ cd kernel_imx
$ git checkout n7.1.1_1.0.0-ga
Getting kernel and U-Boot source code (cont.)
Clone the U-Boot git repository from the open source git:
$ cd ~/android_7.1.1_r13/bootable
$ mkdir bootloader && cd bootloader
$ git clone git://git.freescale.com/imx/uboot-imx.git uboot-imx
$ cd uboot-imx
$ git checkout n7.1.1_1.0.0-ga
Agenda
1) Setting up your computer
2) Getting Android source code (AOSP)
3) Getting kernel and U-Boot source code
4) Apply all the i.MX Android patch
5) Building Android images
6) Programming images with MFGTool
7) Booting
Patch standard features code package
Download i.MX 6 Android 7.1.1 Nougat BSP source code from the link
(need to sign in NXP web site):
http://www.nxp.com/products/software-and-tools/software-development-tools/i.mx-software-
and-tools/i.mx-6series-i.mx-7series-software-and-development-tool-resources:IMX_SW
Patch standard features code package (cont.)
Save the “android_N7.1.1_1.0.0_source.tar.gz” file in the local folder. For
example: /opt/
Patch standard features code package (cont.)
Unpacking the Android release package
$ cd /opt
(or any other directory where the android_N7.1.1_1.0.0_source.tar.gz file is placed)
$ tar xzf android_N7.1.1_1.0.0_source.tar.gz
Patch standard features code package (cont.)
Apply all the i.MX Android patches by performing the following steps:
$ cd ~/android_7.1.1_r13
$ source /opt/android_N7.1.1_1.0.0_source/code/N7.1.1_1.0.0/and_patch.sh
$ help
$ c_patch /opt/android_N7.1.1_1.0.0_source/code/N7.1.1_1.0.0/ imx_N7.1.1_1.0.0
Patch standard features code package (cont.)
Done with the patch
Agenda
1) Setting up your computer
2) Getting Android source code (AOSP)
3) Getting kernel and U-Boot source code
4) Apply all the i.MX Android patch
5) Building Android images
6) Programming images with MFGTool
7) Booting
Building Android images
Argument <Build name>-<Build type> string for the build configuration
command lunch
• The Build Name is the Android device name found in the directory
~/myandroid/device/fsl/
Building Android images (cont.)
Android build steps are as follows:
$ cd ~/android_7.1.1_r13
$ source build/envsetup.sh
$ lunch sabresd_6dq-eng
$ make BUILD_TARGET_DEVICE=emmc -j8 2>&1 | tee imx6q_android-7.1.1.1_r13_eng.log
Building Android images (cont.)
Building Android images (cont.)
Compiling with Jack – Out of memory error
$ jack-admin stop-server
$ vi ~/android_7.1.1_r13/prebuilts/sdk/tools/jack-admin
Add –Xmx option in the JACK_SERVER_COMMAND for Host memory size limitation
$ jack-admin start-server
Building Android images (cont.)
The following outputs are generated by default in
WORKING_Directory/out/target/product/sabresd_6dq:
• root/: root file system (including init, init.rc). Mounted at /.
• system/: Android system binary/libraries. Mounted at /system.
• data/: Android data area. Mounted at /data.
• recovery/: root file
• boot-imx6q.img: composite image for i.MX 6Dual/6Quad SABRE-SD, which includes the kernel
zImage, ramdisk, board's device tree binary, and boot parameters.
• ramdisk.img: ramdisk image generated from "root/". Not used directly.
• system.img: EXT4 image generated from "system/". It can be programmed to "SYSTEM" partition on
SD/eMMC card with "dd".
• recovery-imx6q.img: EXT4 image for i.MX 6Dual/6Quad SABRE-SD, which is generated from
"recovery/". Can be programmed to the "RECOVERY" partition on SD/eMMC card with "dd".
• u-boot-imx6q.imx: U-Boot image with no padding for i.MX 6Dual/6Quad SABRE-SD.
Building Android images (cont.)
An example for the SABRE Board for Smart Devices i.MX 6Dual/Quad is:
$ cd ~/WORKING_DIRECTORY
$ source build/envsetup.sh
$ lunch sabresd_6dq-user
$ make
To create Android platform over-the-air, OTA, and package, the following
make target is specified:
$ make otapackage
For more Android platform building information, see
source.android.com/source/building.html.
Agenda
1) Setting up your computer
2) Getting Android source code (AOSP)
3) Getting kernel and U-Boot source code
4) Apply all the i.MX Android patch
5) Building Android images
6) Programming images with MFGTool
7) Booting
Programming images with MFGTool
The images needed to create an Android system on MMC/SD are listed
below:
‧ U-Boot image: u-boot.imx
‧ boot image: boot.img
‧ Android system root image: system.img
‧ Recovery root image: recovery.img
Programming images with MFGTool (cont.)
Storage partitions:
Programming images with MFGTool (cont.)
Download MFGTool from the link (need to sign in NXP web site):
http://www.nxp.com/products/software-and-tools/software-development-tools/i.mx-software-
and-tools/i.mx-6series-i.mx-7series-software-and-development-tool-resources:IMX_SW
Programming images with MFGTool (cont.)
Android Quick Start Guide (AQSUG) for a detailed description of MFGTool.
Programming images with MFGTool (cont.)
Android Quick Start Guide (AQSUG) for a detailed description of MFGTool.
Programming images with MFGTool (cont.)
Android Quick Start Guide (AQSUG) for a detailed description of MFGTool.
Programming images with MFGTool (cont.)
Copy the image files to the
MFGTool-Dir/Profiles/Linux/OS/Firmware/files/android/sabresd path
$ cd android_7.1.1_r13/out/target/product/sabresd_6dq/
$ cp *imx6q.im* ~/android_N7.1.1_1.0.0_tools/mfgtools/Profiles/Linux/OS
Firmware/files/android/sabresd/
$ cp system.img ~/android_N7.1.1_1.0.0_tools/mfgtools/Profiles/Linux/OS
Firmware/files/android/sabresd/
Programming images with MFGTool (cont.)
Programming images with MFGTool (cont.)
Agenda
1) Setting up your computer
2) Getting Android source code (AOSP)
3) Getting kernel and U-Boot source code
4) Apply all the i.MX Android patch
5) Building Android images
6) Programming images with MFGTool
7) Booting
Booting
Back Up
SABRE SD Platform for i.MX6 Series
Main interfaces of i.MX6 SABRE SD board
Main interfaces of i.MX6 SABRE SD board (Cont.)
i.MX6 SABRE Platform Block Diagram
RDIMX6SABREPLAT Features
Build and Run Android N Source Ccode on NXP SABRESD platform

More Related Content

What's hot

Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time OptimizationKan-Ru Chen
 
Description of GRUB 2
Description of GRUB 2Description of GRUB 2
Description of GRUB 2iamumr
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 
BIOS and Secure Boot Attacks Uncovered
BIOS and Secure Boot Attacks UncoveredBIOS and Secure Boot Attacks Uncovered
BIOS and Secure Boot Attacks UncoveredAlex Matrosov
 
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !Pierre-jean Texier
 
ChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPadChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPadAndrewWright224
 
ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220AndrewWright224
 
Grub2 Booting Process
Grub2 Booting ProcessGrub2 Booting Process
Grub2 Booting ProcessMike Wang
 
How to Make Android's Bootable Recovery Work For You by Drew Suarez
How to Make Android's Bootable Recovery Work For You by Drew SuarezHow to Make Android's Bootable Recovery Work For You by Drew Suarez
How to Make Android's Bootable Recovery Work For You by Drew SuarezShakacon
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)RuggedBoardGroup
 
Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014
Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014
Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014Circling Cycle
 
Ubuntu初體驗:脫離邪惡微軟帝國吧!_150606
Ubuntu初體驗:脫離邪惡微軟帝國吧!_150606Ubuntu初體驗:脫離邪惡微軟帝國吧!_150606
Ubuntu初體驗:脫離邪惡微軟帝國吧!_150606Eunice Lin
 

What's hot (20)

Android Custom Kernel/ROM design
Android Custom Kernel/ROM designAndroid Custom Kernel/ROM design
Android Custom Kernel/ROM design
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
 
KonBoot-Help
KonBoot-HelpKonBoot-Help
KonBoot-Help
 
Ps3 linux
Ps3 linuxPs3 linux
Ps3 linux
 
Buildsystem.mk
Buildsystem.mkBuildsystem.mk
Buildsystem.mk
 
Description of GRUB 2
Description of GRUB 2Description of GRUB 2
Description of GRUB 2
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
BIOS and Secure Boot Attacks Uncovered
BIOS and Secure Boot Attacks UncoveredBIOS and Secure Boot Attacks Uncovered
BIOS and Secure Boot Attacks Uncovered
 
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
 
ChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPadChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPad
 
ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220
 
Hbcd
HbcdHbcd
Hbcd
 
Grub2 Booting Process
Grub2 Booting ProcessGrub2 Booting Process
Grub2 Booting Process
 
How to Make Android's Bootable Recovery Work For You by Drew Suarez
How to Make Android's Bootable Recovery Work For You by Drew SuarezHow to Make Android's Bootable Recovery Work For You by Drew Suarez
How to Make Android's Bootable Recovery Work For You by Drew Suarez
 
Grub
GrubGrub
Grub
 
101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014
Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014
Hp ux-11iv3-multiple-clones-with-dynamic-root-disks-dusan-baljevic-mar2014
 
Ubuntu初體驗:脫離邪惡微軟帝國吧!_150606
Ubuntu初體驗:脫離邪惡微軟帝國吧!_150606Ubuntu初體驗:脫離邪惡微軟帝國吧!_150606
Ubuntu初體驗:脫離邪惡微軟帝國吧!_150606
 
Emu log
Emu logEmu log
Emu log
 

Similar to Build and Run Android N Source Ccode on NXP SABRESD platform

Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Opersys inc.
 
A million ways to provision embedded linux devices
A million ways to provision embedded linux devicesA million ways to provision embedded linux devices
A million ways to provision embedded linux devicesMender.io
 
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...Cheng-Yi Yu
 
Lecture02web 140phpapp01
Lecture02web 140phpapp01Lecture02web 140phpapp01
Lecture02web 140phpapp01letuan9999
 
Android build on windows
Android build on windowsAndroid build on windows
Android build on windowsAddweup
 
Open-source Android 10 on Orange Pi: myth or reality?
Open-source Android 10 on Orange Pi: myth or reality?Open-source Android 10 on Orange Pi: myth or reality?
Open-source Android 10 on Orange Pi: myth or reality?GlobalLogic Ukraine
 
Eclipse IDE Yocto Plugin
Eclipse IDE Yocto PluginEclipse IDE Yocto Plugin
Eclipse IDE Yocto Plugincudma
 
Android things introduction - Development for IoT
Android things introduction - Development for IoTAndroid things introduction - Development for IoT
Android things introduction - Development for IoTBartosz Kosarzycki
 
KSS Session and Tech Talk-2019 on IOT.pptx
KSS Session and Tech Talk-2019 on IOT.pptxKSS Session and Tech Talk-2019 on IOT.pptx
KSS Session and Tech Talk-2019 on IOT.pptxNashet Ali
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux DevelopersOpersys inc.
 
Study on Android Emulator
Study on Android EmulatorStudy on Android Emulator
Study on Android EmulatorSamael Wang
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsLinaro
 
Learning AOSP - Building AOSP for Nexus 7
Learning AOSP - Building AOSP for Nexus 7Learning AOSP - Building AOSP for Nexus 7
Learning AOSP - Building AOSP for Nexus 7Nanik Tolaram
 
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...Paris Open Source Summit
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debuggingAshish Agrawal
 
Android on Intel Architecture: ROM Cooking Tutorial
Android on Intel Architecture: ROM Cooking TutorialAndroid on Intel Architecture: ROM Cooking Tutorial
Android on Intel Architecture: ROM Cooking TutorialRon Munitz
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011pundiramit
 

Similar to Build and Run Android N Source Ccode on NXP SABRESD platform (20)

Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 
A million ways to provision embedded linux devices
A million ways to provision embedded linux devicesA million ways to provision embedded linux devices
A million ways to provision embedded linux devices
 
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
Android Security Development - Part 2: Malicious Android App Dynamic Analyzi...
 
Lecture02web 140phpapp01
Lecture02web 140phpapp01Lecture02web 140phpapp01
Lecture02web 140phpapp01
 
Android build on windows
Android build on windowsAndroid build on windows
Android build on windows
 
Open-source Android 10 on Orange Pi: myth or reality?
Open-source Android 10 on Orange Pi: myth or reality?Open-source Android 10 on Orange Pi: myth or reality?
Open-source Android 10 on Orange Pi: myth or reality?
 
Eclipse IDE Yocto Plugin
Eclipse IDE Yocto PluginEclipse IDE Yocto Plugin
Eclipse IDE Yocto Plugin
 
Android things introduction - Development for IoT
Android things introduction - Development for IoTAndroid things introduction - Development for IoT
Android things introduction - Development for IoT
 
KSS Session and Tech Talk-2019 on IOT.pptx
KSS Session and Tech Talk-2019 on IOT.pptxKSS Session and Tech Talk-2019 on IOT.pptx
KSS Session and Tech Talk-2019 on IOT.pptx
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Study on Android Emulator
Study on Android EmulatorStudy on Android Emulator
Study on Android Emulator
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
 
Deep Learning Edge
Deep Learning Edge Deep Learning Edge
Deep Learning Edge
 
Zedroid - Android (5.0 and later) on Zedboard
Zedroid - Android (5.0 and later) on ZedboardZedroid - Android (5.0 and later) on Zedboard
Zedroid - Android (5.0 and later) on Zedboard
 
Learning AOSP - Building AOSP for Nexus 7
Learning AOSP - Building AOSP for Nexus 7Learning AOSP - Building AOSP for Nexus 7
Learning AOSP - Building AOSP for Nexus 7
 
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
 
Android on Intel Architecture: ROM Cooking Tutorial
Android on Intel Architecture: ROM Cooking TutorialAndroid on Intel Architecture: ROM Cooking Tutorial
Android on Intel Architecture: ROM Cooking Tutorial
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
 
Building
BuildingBuilding
Building
 

Recently uploaded

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 

Recently uploaded (20)

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 

Build and Run Android N Source Ccode on NXP SABRESD platform

  • 1. Daniel Chiu 2017/7/3 Mobile: +886-928-282-503 daniel.chiu@sacsystem.com.tw Build and Run Android N Source Code for NXP’s i.MX 6Q SABRE-SD Platform
  • 2. Preface The document describes how to build Android Nougat 7.1 platform for the i.MX6 and i.MX7 series SABRE devices. It provides instructions for • Setting up a Linux build environment • Downloading, patching, and building the software components that create the Android system image • Copying the images to a boot media • Hardware/software configurations for programming the boot media and running the images
  • 3. Agenda 1) Setting up your computer 2) Getting Android source code (AOSP) 3) Getting kernel and U-Boot source code 4) Apply all the i.MX Android patch 5) Building Android images 6) Programming images with MFGTool 7) Booting
  • 4. Agenda 1) Setting up your computer 2) Getting Android source code (AOSP) 3) Getting kernel and U-Boot source code 4) Apply all the i.MX Android patch 5) Building Android images 6) Programming images with MFGTool 7) Booting
  • 5. Setting up your computer: 64-bit environment Ubuntu 14.04 LTS, 64-bit • 16GB RAM • 300GB disk space • http://ftp.ubuntu-tw.org/mirror/ubuntu-releases/14.04.5/ubuntu-14.04.5- desktop-amd64.iso
  • 6. Setting up your computer: JDK OpenJDK8 Packages
  • 7. Setting up your computer: JDK (cont.) OpenJDK8 Installation 1) Download openjdk-8-jre-headless_8u45-b14-1_amd64.deb 2) Download openjdk-8-jre_8u45-b14-1_amd64.deb 3) Download openjdk-8-jdk_8u45-b14-1_amd64.deb 4) $ sudo apt-get update 5) $ sudo dpkg -i openjdk-8-jre-headless_8u45-b14-1_amd64.deb 6) $ sudo dpkg -i openjdk-8-jre_8u45-b14-1_amd64.deb 7) $ sudo dpkg -i openjdk-8-jdk_8u45-b14-1_amd64.deb 8) $ sudo apt-get -f install 9) $ java –version
  • 8. Setting up your computer: JDK (cont.) OpenJDK8 Installation $ sudo dpkg -i openjdk-8-jre-headless_8u45-b14-1_amd64.deb
  • 9. Setting up your computer: JDK (cont.) OpenJDK8 Installation $ sudo dpkg -i openjdk-8-jre_8u45-b14-1_amd64.deb
  • 10. Setting up your computer: JDK (cont.) OpenJDK8 Installation $ sudo dpkg -i openjdk-8-jdk_8u45-b14-1_amd64.deb
  • 11. Setting up your computer: Required package on the Android website // Installing required packages for Android(Ubuntu 14.04) $ sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip
  • 12. Setting up your computer: Additional requested packages $ sudo apt-get install uuid uuid-dev zlib1g-dev liblz-dev liblzo2-2 liblzo2- dev lzop git-core curl u-boot-tools mtd-utils android-tools-fsutils libncurses5-dev
  • 13. Agenda 1) Setting up your computer 2) Getting Android source code (AOSP) 3) Getting kernel and U-Boot source code 4) Apply all the i.MX Android patch 5) Building Android images 6) Programming images with MFGTool 7) Booting
  • 14. Getting Android source code • Installing Repo tool $ cd ~ $ mkdir bin $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo • Create working directory $ mkdir android_7.1.1_r13 && cd android_7.1.1_r13 • Configure git with your real name and email address $ git config --global user.name "Your Name" $ git config --global user.email “you@example.com” • Check out a branch $ ~/bin/repo init -u https://android.googlesource.com/platform/manifest -b android-7.1.1_r13 $ ~/bin/repo sync # This command loads most needed repos. Therefore, it can take several hours to load
  • 15. Getting Android source code (cont.)
  • 16. Agenda 1) Setting up your computer 2) Getting Android source code (AOSP) 3) Getting kernel and U-Boot source code 4) Apply all the i.MX Android patch 5) Building Android images 6) Programming images with MFGTool 7) Booting
  • 17. Getting kernel and U-Boot source code Get N7.1.1_1.0.0 kernel source code from Freescale open source git: $ cd ~/android_7.1.1_r13 $ git clone git://git.freescale.com/imx/linux-imx.git kernel_imx $ cd kernel_imx $ git checkout n7.1.1_1.0.0-ga
  • 18. Getting kernel and U-Boot source code (cont.) Clone the U-Boot git repository from the open source git: $ cd ~/android_7.1.1_r13/bootable $ mkdir bootloader && cd bootloader $ git clone git://git.freescale.com/imx/uboot-imx.git uboot-imx $ cd uboot-imx $ git checkout n7.1.1_1.0.0-ga
  • 19. Agenda 1) Setting up your computer 2) Getting Android source code (AOSP) 3) Getting kernel and U-Boot source code 4) Apply all the i.MX Android patch 5) Building Android images 6) Programming images with MFGTool 7) Booting
  • 20. Patch standard features code package Download i.MX 6 Android 7.1.1 Nougat BSP source code from the link (need to sign in NXP web site): http://www.nxp.com/products/software-and-tools/software-development-tools/i.mx-software- and-tools/i.mx-6series-i.mx-7series-software-and-development-tool-resources:IMX_SW
  • 21. Patch standard features code package (cont.) Save the “android_N7.1.1_1.0.0_source.tar.gz” file in the local folder. For example: /opt/
  • 22. Patch standard features code package (cont.) Unpacking the Android release package $ cd /opt (or any other directory where the android_N7.1.1_1.0.0_source.tar.gz file is placed) $ tar xzf android_N7.1.1_1.0.0_source.tar.gz
  • 23. Patch standard features code package (cont.) Apply all the i.MX Android patches by performing the following steps: $ cd ~/android_7.1.1_r13 $ source /opt/android_N7.1.1_1.0.0_source/code/N7.1.1_1.0.0/and_patch.sh $ help $ c_patch /opt/android_N7.1.1_1.0.0_source/code/N7.1.1_1.0.0/ imx_N7.1.1_1.0.0
  • 24. Patch standard features code package (cont.) Done with the patch
  • 25. Agenda 1) Setting up your computer 2) Getting Android source code (AOSP) 3) Getting kernel and U-Boot source code 4) Apply all the i.MX Android patch 5) Building Android images 6) Programming images with MFGTool 7) Booting
  • 26. Building Android images Argument <Build name>-<Build type> string for the build configuration command lunch • The Build Name is the Android device name found in the directory ~/myandroid/device/fsl/
  • 27. Building Android images (cont.) Android build steps are as follows: $ cd ~/android_7.1.1_r13 $ source build/envsetup.sh $ lunch sabresd_6dq-eng $ make BUILD_TARGET_DEVICE=emmc -j8 2>&1 | tee imx6q_android-7.1.1.1_r13_eng.log
  • 29. Building Android images (cont.) Compiling with Jack – Out of memory error $ jack-admin stop-server $ vi ~/android_7.1.1_r13/prebuilts/sdk/tools/jack-admin Add –Xmx option in the JACK_SERVER_COMMAND for Host memory size limitation $ jack-admin start-server
  • 30. Building Android images (cont.) The following outputs are generated by default in WORKING_Directory/out/target/product/sabresd_6dq: • root/: root file system (including init, init.rc). Mounted at /. • system/: Android system binary/libraries. Mounted at /system. • data/: Android data area. Mounted at /data. • recovery/: root file • boot-imx6q.img: composite image for i.MX 6Dual/6Quad SABRE-SD, which includes the kernel zImage, ramdisk, board's device tree binary, and boot parameters. • ramdisk.img: ramdisk image generated from "root/". Not used directly. • system.img: EXT4 image generated from "system/". It can be programmed to "SYSTEM" partition on SD/eMMC card with "dd". • recovery-imx6q.img: EXT4 image for i.MX 6Dual/6Quad SABRE-SD, which is generated from "recovery/". Can be programmed to the "RECOVERY" partition on SD/eMMC card with "dd". • u-boot-imx6q.imx: U-Boot image with no padding for i.MX 6Dual/6Quad SABRE-SD.
  • 31. Building Android images (cont.) An example for the SABRE Board for Smart Devices i.MX 6Dual/Quad is: $ cd ~/WORKING_DIRECTORY $ source build/envsetup.sh $ lunch sabresd_6dq-user $ make To create Android platform over-the-air, OTA, and package, the following make target is specified: $ make otapackage For more Android platform building information, see source.android.com/source/building.html.
  • 32. Agenda 1) Setting up your computer 2) Getting Android source code (AOSP) 3) Getting kernel and U-Boot source code 4) Apply all the i.MX Android patch 5) Building Android images 6) Programming images with MFGTool 7) Booting
  • 33. Programming images with MFGTool The images needed to create an Android system on MMC/SD are listed below: ‧ U-Boot image: u-boot.imx ‧ boot image: boot.img ‧ Android system root image: system.img ‧ Recovery root image: recovery.img
  • 34. Programming images with MFGTool (cont.) Storage partitions:
  • 35. Programming images with MFGTool (cont.) Download MFGTool from the link (need to sign in NXP web site): http://www.nxp.com/products/software-and-tools/software-development-tools/i.mx-software- and-tools/i.mx-6series-i.mx-7series-software-and-development-tool-resources:IMX_SW
  • 36. Programming images with MFGTool (cont.) Android Quick Start Guide (AQSUG) for a detailed description of MFGTool.
  • 37. Programming images with MFGTool (cont.) Android Quick Start Guide (AQSUG) for a detailed description of MFGTool.
  • 38. Programming images with MFGTool (cont.) Android Quick Start Guide (AQSUG) for a detailed description of MFGTool.
  • 39. Programming images with MFGTool (cont.) Copy the image files to the MFGTool-Dir/Profiles/Linux/OS/Firmware/files/android/sabresd path $ cd android_7.1.1_r13/out/target/product/sabresd_6dq/ $ cp *imx6q.im* ~/android_N7.1.1_1.0.0_tools/mfgtools/Profiles/Linux/OS Firmware/files/android/sabresd/ $ cp system.img ~/android_N7.1.1_1.0.0_tools/mfgtools/Profiles/Linux/OS Firmware/files/android/sabresd/
  • 40. Programming images with MFGTool (cont.)
  • 41. Programming images with MFGTool (cont.)
  • 42. Agenda 1) Setting up your computer 2) Getting Android source code (AOSP) 3) Getting kernel and U-Boot source code 4) Apply all the i.MX Android patch 5) Building Android images 6) Programming images with MFGTool 7) Booting
  • 45. SABRE SD Platform for i.MX6 Series
  • 46. Main interfaces of i.MX6 SABRE SD board
  • 47. Main interfaces of i.MX6 SABRE SD board (Cont.)
  • 48. i.MX6 SABRE Platform Block Diagram