integrando eclipse com processador i.mx6 para desenvolver ...€¦ · • android development tools...

69
TM Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, t he Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

Upload: others

Post on 27-Sep-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, t

he Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore and Symphony

are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack,

ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a Package, Processor Expert, QorIQ

Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks

of Freescale Semiconductor, Inc. All other product or service names are the property

of their respective owners. © 2011 Freescale Semiconductor, Inc.

Page 2: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

2 TM

• Eclipse is a multi-language software development

environment comprising a base workspace and an

extensible plug-in system for customizing the environment. It is

written mostly in Java. It can be used to develop applications in

Java and, by means of various plug-ins, other programming

languages. (from wikipedia)

Page 3: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

3 TM

• A free, open source and fully customizable software platform and operating system for mobile devices

• Based on the Linux kernel

• Offers a full software stack: an operating system, middleware, and key applications

• Also contains a rich set of APIs that allows third-party developers to develop great applications in managed Java

• The first Android based phone was released in October of 2008

• Key Features:

− Connectivity

− Web browser

− Media - Supports many audio/video/still media formats.

− Hardware and graphics

− Multi-touch

− Android Market place (now Google Play)

− Development Environment

Page 4: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

4 TM

Page 5: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

5 TM

Page 6: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, t

he Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore and Symphony

are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack,

ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a Package, Processor Expert, QorIQ

Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks

of Freescale Semiconductor, Inc. All other product or service names are the property

of their respective owners. © 2011 Freescale Semiconductor, Inc.

Page 7: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

7 TM

• The Android SDK contains:

− Class Library

− Developer Tools

android – AVDs and SDK components management tools

dx – Dalvik Cross-Assembler

aapt – Android Asset Packaging Tool

adb – Android Debug Bridge

ddms – Dalvik Debug Monitor Service

monkey – UI random tester

traceview – App‟s execution log viewer

hierarchyviewer – View Hierarchy viewer

− Emulator (AVD) and System Images

− Documentation and Sample Code

• Needs JDK 1.5 or 1.6

Page 8: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

8 TM

• Android Development Tools (ADT) is a plugin for the Eclipse IDE

that is designed to give you a powerful, integrated environment in

which to build Android applications

• ADT extends the capabilities of Eclipse

− Set up new Android projects

− Create an application UI

− Add components based on the Android Framework API

− Debug your applications using the Android SDK tools

− Export signed (or unsigned) APKs in order to distribute your

application.

• http://developer.android.com/sdk/eclipse-adt.html#installing

Page 9: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

9 TM

• The procedure for iMX6 is very similar.

• The diference is how to install and compile the BSP.

− This is due to the iMX6 Android BSP being provided by

Freescale, and not by Adeneo.

• Although the Android for iMX6 is JB 4.1, the development

and debug features described are pretty similar.

• You can get iMX6 Android BSP here:

• http://www.freescale.com/webapp/sps/site/prod_summary.j

sp?code=IMX6_SW&tid=vanIMX6TOOLS

Page 10: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

10 TM

• For building Embedded Linux (regular rootfs, not Android),

Freescale will be moving the future BSPs to Yocto.

• Yocto can already generate Eclipse projects on every

project build you do.

• When available, you will be able to download the Yocto

BSP here:

• http://www.freescale.com/webapp/sps/site/prod_summary.j

sp?code=IMX6_SW&tid=vanIMX6TOOLS

• You can check the video on this post for more details:

• https://community.freescale.com/message/316807#316807

Page 11: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, t

he Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore and Symphony

are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack,

ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a Package, Processor Expert, QorIQ

Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks

of Freescale Semiconductor, Inc. All other product or service names are the property

of their respective owners. © 2011 Freescale Semiconductor, Inc.

Page 12: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

12 TM

• Install the Linux Host on your PC, Android recommends

Ubuntu 10.04 64-bits, download it at

http://releases.ubuntu.com/lucid/.

• Then update to the newest packets (not dist).

Page 13: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

13 TM

• Install Java, Eclipse (Juno), Android SDK (r20), NDK (r8b)

and ADT (20.0.0): (versions used for this training)

• Just as recommendation, you can install these tools on the

following folders:

• /home/$USER/Software/IDEs/eclipse

• /home/$USER/Software/SDKs/android-sdk-linux

• /home/$USER/Software/SDKs/android-ndk-linux.

Page 14: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

14 TM

• If you are running a 64-bit distribution on your development

machine, you need to install the ia32-libs package using:

− apt-get::apt-get install ia32-libs

• Next, install Java:

− apt-get install sun-java6-jdk

This takes a while…

Page 15: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

15 TM

• Download eclipse from: http://www.eclipse.org/downloads/

• Save the archive into your home directory

/home/$USER/Software/IDEs.

• Open a console or terminal, and type:

− cd ~; tar xvzf eclipse*.tar.gz;

• To start up Eclipse, type:

− cd ~/eclipse

− ./eclipse

Page 16: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

16 TM

• To install SDK, follow instructions on

developer.android.com/sdk/installing/index.html , in our

case, Android 2.3.3 Gingerbread is being used as platform.

• Download it from:

http://developer.android.com/sdk/index.html#ExistingIDE

• Unpack the .tgz file you've downloaded. By default, the

SDK files are unpacked into a directory named android-

sdk-linux_x86. Move it to an appropriate location on your

machine, such as a "Development" directory in your home

directory.

Page 17: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

17 TM

• Install the ADT plugin as described in:

http://developer.android.com/sdk/installing/installing-adt.html

− Start Eclipse, then select Help > Install New Software.

− Click Add, in the top-right corner.

− In the Add Repository dialog that appears, enter "ADT Plugin" for

the Name and the following URL for the Location:

https://dl-ssl.google.com/android/eclipse/

• Once Eclipse restarts, you must specify the location of your

Android SDK directory:

− In the "Welcome to Android Development" window that appears,

select Use existing SDKs.

− Browse and select the location of the Android SDK directory you

recently downloaded and unpacked.

− Click Next.

Page 18: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

18 TM

• Inside Eclipse, on install new software, include the following update sites:

− From http://download.eclipse.org/tools/cdt/releases/indigo install the CDT Eclipse plugin.

− From https://dl-ssl.google.com/android/eclipse/ install Android SDK + NDK Plugins.

• Then set the path to SDK and NDK:

− Eclipse -> Window -> Preferences -> Android -> set path to SDK

− Eclipse -> Window -> Preferences -> Android -> NDK -> set path to the NDK

• Then right click on an Android project and select Android Tools -> Add native support.

Page 19: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

19 TM

• Get the sources and

documentation from Adeneo's

website

• The Android sources for the other

i.MX products can be downloaded

on Freescale's website

• You need the sources if you want

to make changes to the system

(typically not if you are writing

applications)

Page 20: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

20 TM

• Go to http://source.android.com/source/initializing.html

• $ sudo apt-get install git-core gnupg flex bison gperf build-

essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev

ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev

lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos

python-markdown libxml2-utils xsltpro

Page 21: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

21 TM

• If host is Linux

− Create udev rule under /etc/udev/rules.d/ named imx-

android.rules, with read permission to all users

SUBSYSTEM=="usb", SYSFS{idVendor}=="15a2", MODE="0666"

− Add vendor id to ~/.android/adb_usb.ini

Create file with: # android-sdk-linux_86/tools/android update adb

• If using VMWare, make sure you have connected the

device to VMWare

Page 22: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

22 TM

• Unpack the release archive:

− $ tar xjvf i.MX53-QSB-Android-Release4.2.tar.bz2

• Download the Android sources:

− $ cd i.MX53-QSB-Android-Release4.2/scripts

− $ ./download_android.sh

• Add i.MX53 platform support:

− $ ./patch_android.sh

• Add support for the Quick Start Board:

− $ ./apply_qsb_patch.sh

• By default, the Gingerbread build-system now requires a 64-bit machine. The sources can be patched to build Android on 32-bit machines. Only run this command if this is the case for you:

− $ ./fix_android_32bit.sh

Page 23: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

23 TM

• $ ./build_android.sh --board=[board name] --build-

choice=[build type] [ --lunch-type=[lunch type] --cpus-

android=[number of CPUs to build android] --cpus-

kernel=[number of CPUs to build kernel + U-Boot] ]

• For example, to build the whole system (bootloader +

kernel + Android):

− $ ./build_android.sh --board=imx53_qsb --build-choice=all --

lunch-type=eng

Page 24: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

24 TM

• Insert the SD Card into your PC's card reader

• Open a terminal and issue the following command:

− > dmesg

− This will display the kernel messages of your host and tell you what entry in /dev corresponds to your SD Card reader, e.g.

− [15762.076079] tifm_core: MMC/SD card detected in socket 0:1

− [15762.305755] mmc1: new SDHC card at address e624

− [15762.305984] mmcblk0: mmc1:e624 SU04G 3.69 GiB

− [15762.306198] mmcblk0: p1

− => The device is /dev/mmcblk0 in this case

− Alternatively, you can use

> cat /proc/partitions

Before and after you insert the SD Card. This way, you can see what has changed.

• CAUTION: make sure you are using the right device node! Any mistake could cause you to erase your hard drive! Ask your instructor if you have any doubt.

Page 25: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

25 TM

• Flashing scripts have been prepared by Adeneo

• Use the following commands:

− > cd <android_bsp_dir>/scripts

− > ./flash_prebuilt_android.sh [NAME OF YOUR SD CARD

DEVICE (e.g. /dev/mmcblk0)]

− You will be prompted for the superuser password and the SD

Card will be prepared (takes a few minutes).

• Have a look at the script if you are curious!

Page 26: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

26 TM

• You can remove the SD Card once the script is done flashing it

• Insert the SD Card in the micro SD slot (the smallest one)

• Turn on your board (do not forget to use the power button – you should see the LEDs turn blue and green)

• You should successively see:

− The Linux penguin logo

− The calibration screen (only done once, so make sure you are doing it right – one light touch per cross is enough)

− The Android logo

− A prompt saying “Complete action using” => select the value at the top

• Note: If the screen remains black after a few minutes, just restart the board

Page 27: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

27 TM

• Click on the launcher (2nd button in the icon bar on the right of the screen)

• Choose Settings | Display

− Set the brightness to the maximum

− Disable Auto-rotate screen

− Set the Screen timeout to 30 minutes

• Go back to the Home screen using the two user buttons on the board (between the Ethernet and SD Card connectors)

• Play around!

Page 28: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, t

he Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore and Symphony

are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack,

ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a Package, Processor Expert, QorIQ

Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks

of Freescale Semiconductor, Inc. All other product or service names are the property

of their respective owners. © 2011 Freescale Semiconductor, Inc.

Page 29: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

29 TM

• To get started, open Eclipse:

− # cd ~/Software/IDEs/eclipse

− # ./eclipse &

• On Eclipse IDE, create a new Android Project by clicking:

− File > New > Project... Android >

• Configure the project as the information on the next slide.

Page 30: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

30 TM

Android Application Project:

• New Android Application

− ApplicationName: LedControl

− Project Name: LedControl

− Package Name: com.freescale.android.ledcontrol

− Build SDK: Android 2.3.3 (API 10)

− Minimum Required SDK: API 8: Android 2.2 (Froyo)

• Configure Launcher Icon - Next

• Create Activity - Next

• New Blank Activity

− Activity Name: LedControlActivity

− Layout Name: activity_led_control

− Title: LedControlActivity

− Click Finish

Page 31: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

31 TM

Edit layout file of application just created (LedControl - res - layout - activity_led_control.xml):

• Add two buttons

• Name them LedOn and LedOff, by right-clicking them, then selecting “edit text”, then New String, then:

− String: LedOn

− New R.string: led_on

• for LedOn button and:

− String: LedOff

− New R.string: led_off

• for LedOff

• Set “On click” property to setLedOn for LedOn button and setLedOff for LedOff button, by left clicking on each button, going to the Outline view, then properties, and finding the “On Click” event on the end of the list

Page 32: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

32 TM

• Edit the main activity class (LedControl - src - com.freescale.android.ledcontrol - LedControlActivity.java) and add the following lines at the beginning:

import android.view.View;

import android.widget.Toast;

• Inside LedControlActivity class body, add the following code at the end:

/* Click handler for the On button */

public void setLedOn(View view) {

displayLedStatus(1);

}

/* Click handler for the Off button */

public void setLedOff(View view) {

displayLedStatus(0);

}

private void displayLedStatus(int status) {

String text = "Error while setting Led status!";

if(status != -1)

text = "Led is " + (status == 1 ? "On" : "Off");

Toast.makeText(getApplicationContext(), text, Toast.LENGTH_SHORT).show();

}

Page 33: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

33 TM

• Connect a micro USB cable to the i.MX board micro

conector and to the host PC, and run the Debugger from

Eclipse IDE, by clicking the Debug button and selecting

Debug as Android Application.

• You can add breakpoints to the source code to interact

with the debugging tool. It‟s specially interesting to set a

breakpoint at the following line of the activity source code,

as it‟s called every time one of the buttons is clicked:

Toast.makeText(getApplicationContext(), text, Toast.LENGTH_SHORT).show();

Page 34: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

34 TM

• Pay special attention to logcat tab. It‟s a helpful tool to debug software too.

− Connect an USB-Serial cable to your host machine USB port and to the serial port of the i.MX board. Open a new terminal inside the virtual machine and connect to the serial adapter using screen:

# sudo screen /dev/ttyUSB0 115200n8

• Add more perspectives to the project like DDMS and Hierarchy View to get familiar with them. You can collect data from the running processes with the first and analyze the complete view hierarchy with the second.

Page 35: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, t

he Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore and Symphony

are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack,

ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a Package, Processor Expert, QorIQ

Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks

of Freescale Semiconductor, Inc. All other product or service names are the property

of their respective owners. © 2011 Freescale Semiconductor, Inc.

Page 36: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

36 TM

• In order to enable IO control for the LED at kernel level, prior to compiling the new image, you need to apply a patch to the kernel source tree.

# cd ~/iMX53_training/Android/labs/lab02

# cat add_leds_gpio.patch

Check what the patch does: it enables the GPIO control on the linux kernel def config files and on the initialization file for the QSB board; it creates a platform-device structure to control one user LED on the board; and then it initializes the structure during execution of the init function.

• Now, to apply the patch, run commands below:

# cd ~/iMX53_training/Android/i.MX53-QSB-Android-Gingerbread-Release4.3/src/kernel_imx

# patch -p1 < ~/iMX53_training/Android/labs/lab02/add_leds_gpio.patch

Page 37: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

37 TM

• Having the kernel patched, you are ready to build a new image.

However, as Adeneo‟s BSP checks for the presence of .config file inside the kernel source code tree to determine whether the kernel needs to be compiled or not, you need to remove this file to ensure BSP will run kernel compile task again:

# rm .config

• Next step is to compile the kernel, and only the kernel to save time:

# cd ~/iMX53_training/Android/i.MX53-QSB-Android-Gingerbread-Release4.3/scripts

# ./build_android.sh --board=imx53_qsb --build-choice=kernel --lunch-type=eng --cpus-kernel=4

Page 38: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

38 TM

• You need to burn the new kernel image to the SD card, so first connect the SD card to the reader and be sure it is connected to the Virtual Machine, then run the commands:

# cd ~/iMX53_training/Android/i.MX53-QSB-Android-Gingerbread-Release4.3/out

# sudo dd if=uImage of=/dev/sdb bs=1M seek=1; sync

• After burning the new kernel image, you can reconnect the SD card to the i.MX board to test kernel level LED control.

− At the terminal connected to the serial cable running screen, type the following commands:

# cd /sys/class/leds/mx53::user

# echo 0 > brightness

# echo 1 > brightness

Page 39: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

39 TM

• Add Android Native Support to LedControl project by right

clicking the project root folder on the Package Explorer tab

and setting a library name as follows:

Library Name: libled_control_jni.so (note that the “lib” prefix

and the “.so” suffix are already set by default)

• Note that you have been automatically switched to C/C++

perspective. Change back to Java perspective to create a

new Java class with the following information:

Package: com.freescale.android.ledcontrol

Name: LedControlLib

Page 40: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

40 TM

• And add the following two methods to it:

public static native int setLedOn();

public static native int setLedOff();

• Add also the following static block to the end of the class body:

static {

System.loadLibrary("led_control_jni");

}

• Edit LedControlActivity.java and replace:

displayLedStatus(1);

by:

displayLedStatus(LedControlLib.setLedOn());

and:

displayLedStatus(0);

by:

displayLedStatus(LedControlLib.setLedOff());

Page 41: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

41 TM

• To add native code, note that Eclipse already created the first two files for you (jni/Android.mk and jni/led_control_jni.cpp) when you selected to Add Native Support to the project.

• To make it easier to create the prototypes of the native functions in led_control_jni.cpp, it is possible to generate a native header file from the Java Library class using a tool called javah, that extracts meaningful data from a Java class to a C/C++ header file.

− In a terminal, type the following commands to create the native header file:

# cd ~/Software/Workspace/LedControl

# javah -jni -classpath bin/classes -d jni com.freescale.android.ledcontrol.LedControlLib

• Back to Eclipse IDE, go back to C/C++ perspective and refresh the whole project so that the jni directory gets updated

Page 42: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

42 TM

#include "led_control_jni.h"

#include <string.h>

#include <stdio.h>

#include <android/log.h>

#define DEBUG_TAG "LedControl"

static jint setLedStatus(jint status) {

const char *fname = "/sys/class/leds/mx53::user/brightness";

FILE* file = fopen(fname, "r+");

if(file) {

__android_log_print(ANDROID_LOG_DEBUG,DEBUG_TAG,

"Writing %d to file %s", status, fname);

fprintf(file, (status ? "1" : "0"));

fflush(file);

fclose(file);

return (jint) status;

}

else {

__android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG,

"Failed to open file %s for writing %s", fname, status);

return (jint) -1;

}

}

JNIEXPORT jint JNICALL

Java_com_freescale_android_ledcontrol_LedControlLib_setLedOn

(JNIEnv *env, jclass clazz) {

return setLedStatus((jint) 1);

}

JNIEXPORT jint JNICALL

Java_com_freescale_android_ledcontrol_LedControlLib_setLedOff

(JNIEnv *env, jclass clazz) {

return setLedStatus((jint) 0);

}

Page 43: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

43 TM

• Note that a native API (android/log.h) is being used to generate log messages. With this API in use, you need to tell the linker where to find its implementation. To pass this information to the C/C++ linker, edit jni/Android.mk file and add the following line in bold:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := libled_control_jni

LOCAL_SRC_FILES := led_control_jni.cpp

LOCAL_LDLIBS := -llog

include $(BUILD_SHARED_LIBRARY)

Page 44: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

44 TM

• Now you are ready to rebuild and rerun the application.

• While the application is running, type the following on

terminal:

# chmod 0777 /sys/class/leds/mx53::user/brightness

• After altering this device node permission, you will be able

to see your full application in action, changing LED status

by clicking each UI button.

Page 45: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, t

he Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore and Symphony

are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack,

ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a Package, Processor Expert, QorIQ

Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks

of Freescale Semiconductor, Inc. All other product or service names are the property

of their respective owners. © 2011 Freescale Semiconductor, Inc.

Page 46: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

46 TM

• We won‟t go through this process on the presentation, but

the how-to will be available on the website.

• The guide will include all the steps we have done until

here, plus the guide to add the application to your custom

BSP.

Page 47: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, t

he Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore and Symphony

are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack,

ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a Package, Processor Expert, QorIQ

Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks

of Freescale Semiconductor, Inc. All other product or service names are the property

of their respective owners. © 2011 Freescale Semiconductor, Inc.

Page 48: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

48 TM

• Google IO presentations

• http://en.androidwiki.com/

• http://www.kandroid.org/

• http://www.opersys.com/training/android-development

• http://www.opersys.com/training/embedded-android

• … many other websites (use Google!)

Page 49: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

49 TM

Page 50: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

50 TM

community.freescale.com/community/imx• Open community of developers

• Get help

• Get access to online trainings and events

Page 51: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, t

he Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore and Symphony

are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack,

ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a Package, Processor Expert, QorIQ

Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks

of Freescale Semiconductor, Inc. All other product or service names are the property

of their respective owners. © 2011 Freescale Semiconductor, Inc.

Page 52: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

TM

Page 53: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

TM

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, t

he Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore and Symphony

are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack,

ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a Package, Processor Expert, QorIQ

Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks

of Freescale Semiconductor, Inc. All other product or service names are the property

of their respective owners. © 2011 Freescale Semiconductor, Inc.

Page 54: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

54 TM

• The Android Debug Bridge (ADB) is a communication channel between the Android tools, and an Android Device (also works with the emulator)

• Connect to your device through:

− USB

− Ethernet (for devices with an ethernet connection)

• Using ADB, you can connect to the device for:

− Debugging

− Transferring files

− Installing applications

− Executing commands via a shell

− Configuring the device

Page 55: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

55 TM

• adb push

• adb pull

• adb logcat

• adb sync

• adb install

• adb shell

• adb devices

Page 56: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

56 TM

• The logcat command can be entered at the shell prompt, or can be accessed from DDMS

• Very powerful debug tool, similar to dmesg in Linux

• Usage:

− adb logcat <option> <filter>

− Or at the shell prompt:

logcat <option> <filter>

• Filters are formatted tags and event priority pairs.

• The format for each filter is:

− <Tag Name>:<Lowest Event Priority to Print>

Page 57: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

57 TM

• The severity types(from lowest priority or most verbose to

highest priority or least verbose) follow:

• <filter>

− 1. Verbose (V)

− 2. Debug (D)

− 3. Info (I)

− 4. Warning (W)

− 5. Error (E)

− 6. Fatal (F)

− 7. Silent (S)

Page 58: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

58 TM

• The following shell command displays all AppLog-tagged logging information and suppresses all other tags:

− # adb logcat -v time AppLog:V *:S

• You can clear the emulator log using the -c flag:

− # adb -e logcat -c

• You can redirect log output to a file on the device using the -f flag. For example, to direct all informational logging messages (and those of higher priority) from the emulator to the file mylog.txt in the sdcard directory, you can use the following ADB shell command:

− # adb logcat -f /sdcard/mylog.txt *:I

Page 59: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

59 TM

• Like all debugging connections, it can be difficult to establish ADB communications. Here are some tips to help you get connected.

• Verify your Android device is configured properly.

− Menu -> settings -> Applications -> development ->

Check USB Debugging

Check Stay awake

• When you connect the device to the host, YOU MUST ACCEPT THE CONNECTION ON THE DEVICE!

• If the device is locked, you must unlock it.

Page 60: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

60 TM

Page 61: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

61 TM

• Android DDMS (Dalvik Debug Monitor Server)

• DDMS is represented as an Eclipse Perspective

• The DDMS perspective is a debugger, that you can use to:

− View all the running processes

− Step through your code

Page 62: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

62 TM

Page 63: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

63 TM

Page 64: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

64 TM

Page 65: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

65 TM

• http://j.mp/androidassetstudio

Page 66: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

66 TM

• Logging - Use LogCat to view (either using 'adb logcat' or Ecplise):

import android.util.Log;

...

Log.d(DTAG, “onConfigurationChanged() called”);

• Log output:

D/PhoneApp( 229): updateProximitySensorMode: state = IDLE

D/PhoneApp( 229): updateProximitySensorMode: lock already released.

W/dalvikvm( 824): threadid=1: thread exiting with uncaught exception (group=0x2aac87c8)

E/AndroidRuntime( 824): FATAL EXCEPTION: main

• Toast messages - show up device UI:

import android.widget.Toast;

...

Toast.makeText(this, “onConfigurationChanged()”, Toast.LENGTH_SHORT).show();

Page 67: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

67 TM

• How to use U-boot to switch displays

− setenv boot_args_base „setenv bootargs console=ttymxc0,115200

${lcd} ${vga} di0_primary gpu_memory=128M ldb=di0‟

− If running Android, set the following in Android prompt to turn

dual display

#setprop rw.SECOND_DISPLAY_CONNECTED 1

Page 68: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

Freescale, the Freescale logo, AltiVec, C-5, CodeTEST, CodeWarrior, ColdFire, C-Ware, the Energy Efficient Solutions logo, mobileGT, PowerQUICC, QorIQ, StarCore

and Symphony are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. BeeKit, BeeStack, ColdFire+, CoreNet, Flexis, Kinetis, MXC, Platform in a

Package, Processor Expert, QorIQ Qonverge, Qorivva, QUICC Engine, SMARTMOS, TurboLink, VortiQa and Xtrinsic are trademarks of Freescale Semiconductor, Inc.

All other product or service names are the property of their respective owners. © 2011 Freescale Semiconductor, Inc.

68 TM

• If you want to connect to the internet with Android…

− # setenv bootargs_android '${vga} ip=dhcp„

− # saveenv

− # setprop net.dns1 DNSIPADDRESS

• What if you have a proxy server…

− sqlite3

/data/data/com.android.providers.settings/databases/settings.d

b "INSERT INTO secure VALUES (99, 'http_proxy', 'wwwgate0-

az.freescale.net:1080');"

Page 69: Integrando Eclipse com processador i.MX6 para desenvolver ...€¦ · • Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to give you a powerful,

TM