0% found this document useful (0 votes)
270 views4 pages

Setup Environment - Motorola Developer Portal

Uploaded by

whiterg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
270 views4 pages

Setup Environment - Motorola Developer Portal

Uploaded by

whiterg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Setup Environment | Motorola Developer Portal https://developer.motorola.

com/documentation/setup-environment

Documentation Overview (/documentation) / Setup Environment

Overview

Software

Firmware
Setup Environment
Developer Tools

Developer Tools
Overview (/documentation Preparing For Application Development
/developer-tools-overview)
Follow these instructions to add Moto Mod specific support to your applications:
Setup Environment
(/documentation/setup-
environment)
Build from Source
(/documentation/build-
source)
Step 1) Download and Install Android Studio
Starting a New Project To develop a Moto Z application that interacts with Moto Mods, you must be
(/documentation/starting- familiar with Android Studio 2.0 and it must be installed on your development
new-project)
environment. If you don’t already have it, download Android Studio 2.0 here
Flashing Firmware
(/documentation/flashing-
(https://developer.android.com/studio/index.html). Unlike firmware development
firmware) which requires Linux currently, APK development may be done on the platform of
Debug and Log your choice.
(/documentation/debug-and-
log) Note: You’ll also need to make sure that Android Studio has the Android SDK API
23 or later installed.
MDK

Examples

Downloads Step 2) Download the Moto Mods SDK Library


(/documentation/all-
downloads) Next, you’ll need to download the Moto Mods SDK Library.

All Downloads (all-downloads)

Step 3) Place the Moto Mods SDK Library For Use In Your
App
Once ModLib-01.00.000.zip is downloaded and unzipped, place the modlib-
01.00.000.jar file in your Android Studio project libs/ folder, and the
the version.xml in your res/values folder. By including this library in your
Android application project, you will be able to include Moto Mod specific
functionality in your app.

Run these commands from a terminal to copy modlib.jar and version.xml files to
the appropriate location:

1 sur 4 25/05/2020 à 11:51


Setup Environment | Motorola Developer Portal https://developer.motorola.com/documentation/setup-environment

cp modlib-01.00.000.jar $APP_TOP/app/libs
cp res/version.xml $APP_TOP/app/src/main/res/values

Embedded Firmware Development


Currently, developing firmware for Moto Mods requires a Linux environment.
This may be run either native or within a virtual machine (VM). When running in a
VM, Virtual Box has been tested on Win7 and MacOS environments. Commands
below are for Ubuntu (14.04 (http://releases.ubuntu.com/14.04/) or 16.04
(http://releases.ubuntu.com/16.04/)).

If using a VM, configure with at least 2GB of RAM and 10GB of hard disk space
for optimal performance.

Build Dependencies
All of the tools needed to build Moto Mods firmware are provided in the Ubuntu
package management system. To download these to your system use the
following commands from a terminal:

$ sudo apt-get install -y git gperf flex bison libncurses5-dev gcc-arm-non


e-eabi python-pip
$ sudo pip install pyelftools

Debugging and Flashing Tools


The Reference MotoMod provides an FTDI4232 to emulate JTAG for the HSB and
SWD for the MuC. This gives access to debug and install software (flash) using
just a USB C port cable. Support for this connection requires slightly modified
version of OpenOCD. You will need to build this from source. Again packages for
building these are available in the Ubuntu package management system.

OpenOCD

OpenOCD is used for flashing and debugging. You will need to download and
build the OpenOCD code as follows:

2 sur 4 25/05/2020 à 11:51


Setup Environment | Motorola Developer Portal https://developer.motorola.com/documentation/setup-environment

$ sudo apt-get install -y libusb-1.0-0-dev libftdi-dev libtool autoconf te


xinfo
$ git clone https://github.com/MotorolaMobilityLLC/openocd
$ cd openocd
$ git submodule init
$ git submodule update
$ ./bootstrap
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
$ cd -

Note: If you are using Ubuntu 16.10 or later, you will need to install gcc-5 (sudo
apt install gcc-5) and add "CC=gcc-5" to the above ./configure statement. This
is only required for OpenOCD.

OpenOCD talks to the chip through USB, so you need grant your account access
to the FTDI.

$ id -u -n

Replace <user name> below with the results of the previous command.

$ sudo -s
# echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", MODE="0666", OWNER="<u
ser name>"' >> /etc/udev/rules.d/20-ftdi.rules
# udevadm control --reload
# exit

The new permissions will take effect the next time you plug in your USB cable.

GDB

GDB is required for low-level debugging. The MDK provides some utility functions
that make working with the debugger easier. If you wish to use these utilities you
have to download and build the debugger with Python scripting enabled as
follows:

$ sudo apt-get install -y libexpat1-dev zlib1g-dev guile-2.0-dev python2.7


-dev
$ wget http://ftp.gnu.org/gnu/gdb/gdb-7.11.tar.gz
$ tar -zxf gdb-7.11.tar.gz
$ cd gdb-7.11
$ ./configure --prefix=/usr/local --program-prefix=arm-none-eabi- --target
=arm-none-eabi --with-python --with-guile
$ make
$ sudo make install

3 sur 4 25/05/2020 à 11:51


Setup Environment | Motorola Developer Portal https://developer.motorola.com/documentation/setup-environment

Further information
Additional information about each tool referenced can be found at the originators
site:

Android Studio (https://developer.android.com/studio/index.html)


OpenOCD (http://openocd.org/)
GDB (https://sourceware.org/gdb/)
libUSB (http://libusb.info/)
libftdi (https://www.intra2net.com/en/developer/libftdi/)
FTDI4232 (http://www.ftdichip.com/Products/ICs/FT4232H.htm)

Ask the community


Looking for help? Go to FAQ (/faq) or
(/community)

FAQ (/faq) Ask MDK Help (mailto:mdk-


(https://www.moto.com/) [email protected])
Privacy Policy
(https://www.motorola.com
©2017 MOTOROLA /us/legal/privacy-policy)
ALL RIGHTS RESERVED.

4 sur 4 25/05/2020 à 11:51

You might also like