element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Moto Mods
  • Products
  • Manufacturers
  • Moto Mods
  • More
  • Cancel
Moto Mods
Blog Moto Mods Developer Part 1 - Getting Started - Virtual Machine Setup and Linux Install
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Moto Mods to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Catwell
  • Date Created: 21 Apr 2017 11:27 PM Date Created
  • Views 2406 views
  • Likes 0 likes
  • Comments 0 comments
  • learn
  • tutorial
  • Ubuntu
  • virtualbox
  • motorola
  • embedded
  • Design
  • cabeatwell
  • ubuntu linux
  • moto mods
  • virtual machine
  • moto z
  • innovation
  • linux
Related
Recommended

Moto Mods Developer Part 1 - Getting Started - Virtual Machine Setup and Linux Install

Catwell
Catwell
21 Apr 2017

Index of the Moto Mods Developer project:

Moto Mods Developer Part 1 - Getting Started - Virtual Machine Setup and Linux Install

Moto Mods Developer Part 2 - Getting Started - SDK Setup & Android Studio Install

Moto Mods Developer Part 3 - Firmware Setup

Moto Mods Developer Part 4 - Getting Started - Make Build-Folder, add Utility and OS files

Moto Mods Developer Part 5 - Flashing Firmware with MDK Utility

Moto Mods Developer Part 6 - Blinking an LED on the Moto Mods Perfboard

Moto Mods Developer Part 7 - Modifying the C file for the perfboard LED

Moto Mods Developer Part 8 - Configure Nuttx

Moto Mods Developer Part 9 - Updating the Hardware Manifests file

Moto Mods Developer Part 10 - Cont’d Configure and Compile Nuttx

Moto Mods Developer Part 11 - Load newly created Nuttx Firmware onto Reference Board

Moto Mods Developer Part 12 - Soldering the Test Points to use the perfboard

Moto Mods Developer Part 13 - Making custom App to control the Firmware

 

 

The Moto Mods expansion for the Moto Z phones is not for the average tinkerer.

 

I set out to do the "hello world" of hardware design, blink an LED. Once you can do that, sky's the limit.

 

So, let's start from the beginning, part 1, getting set up:

 

 

To setup everything you need to develop with Moto Mods i’ve split this setup tutorial into 2 articles. The first one showing you how to setup Android studio and the Moto Mods SDK in Linux, which requires the setup of a virtual machine if using any other OS. The second article, showing you how to install all the firmware tools you will need for development. 

 

Two software tools are required for developing on Moto Mods platform: Android Studio 2.0+ and the Moto Mods SDK Library. Your application can be made on any Android Studio platform. Firmware development at this point requires Linux. To develop the firmware using windows, we will setup a Virtual Machine (VM) using VirtualBox and version 16.04 of Ubuntu. 

 

A little background about what we're about to do. In order to develop with Moto Mods, we need to install and configure:

  • Android Studio - To develop android applications to control the Moto Mods MDK functionality
  • Moto Mods SDK - To access hardware through API calls in your application
  • Flashing and Debugging tools for Firmware - OpenOCD, GDB, USB and FTDI libraries
  • Firmware runs Nuttx OS (RTOS) on the MuC - We need to build and Compile Nuttx in Ubuntu
  • Nuttx to be configured with the standard Linux menuconfig utility
  • Compile the MuC bootloader, muc-loader is a bootloader for Nuttx on STM32L4 devices
  • Flash the MuC with either the MDK Utility Android App on the Moto Z Droid or via SWD using OpenOCD



These tools are all provided from the github repository: https://github.com/MotorolaMobilityLLC

 

The Mod Mods MDK comes with a backplate pictured below that attaches to the back of the Moto Z Droid via magnets and pogo pins. This Adapter, they call a reference Moto Mod, pictured on the right, that attaches directly to the phone and has a slot and connector for prototyping with anyone of the personality cards. The Perforated Board is then plugged into the connector on the reference Moto Mod, then the cover over that, pictured on the left. The Reference Board is where we will load the firmware. Built in is an Cortex-M4 based STML476, it provides onboard control of the GPIO and various standard interfaces.

 

From Moto Mods Developer Website:

“The example Personality Cards require custom firmware on the Reference Moto Mod to run. Each Personality Card includes an onboard EEPROM queried by the MuC (STML476) bootloader on attach. If needed, the MuC bootloader will request the Moto Z to download and install the latest firmware needed for the attached personality card.

IMPORTANT:

When using the Perforated Board, or Pi HAT Adapter Board, don’t forget to create a custom bootloader for your MuC that includes your unique VID/PID, or the prototype VID 0x42. If you don’t you’ll end up overwriting your custom firmware with the default MuC firmware each time you boot!”



MMbackgroundimage.jpghw-connector-diagram-1.png

 

Install Ubuntu on a Virtual Machine

Download VirtualBox from the link above, since we are using Windows, download from the “Windows hosts” link

 

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Once VirtualBox is installed, open VirtualBox Manager

 

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Create a name for you Virtual Machine and select Linux as the Type of OS and the Version as Ubuntu (64-bit)

 

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Hit Next, Ubuntu recommends at least 2 GB of Virtual RAM.



image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ubuntu recommends at least 25GB of HD space and a minimum of 10GB but we are going to install programs so we don’t run out of space during the setup process. Ignore that 8GB

 

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Create a Virtual HD, choose VDI (Virtual Disk Image)



image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Dynamically allocate the disk so you save space on your real drive.



image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I created a disk with 30GB of space.



image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Once you hit create, the VM is done being set up. We now have to install Linux on it, We do this the same as a fresh copy of Windows. Boot from disk, but it's a virtual disk image.



image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Go back to your browser... Since we are using 64-bit Windows, we will run 64-bit Ubuntu on our VM, download the “Ubuntu 16.04.2 LTS Desktop Image”. At this time, it will download an ISO file called “ubuntu-16.04.2-desktop-amd64.iso”

 

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Back in your VM manager settings, Click on the Small CD symbol to the right of the Optical Drive: selection and in the dropdown select “Choose Virtual Optical Disk File...”

 

image



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Open “ubuntu-16.04.2-desktop-amd64.iso”

 

 

 

 

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

It will load the ISO file into the VM IDE Storage Controller. Click Ok. This will allow us to boot from the Ubuntu disk image

.

image



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Start the VM, and the GUI screen will pop up.



image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

When the GUI pops up it will go to the Ubuntu install screen.

 

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Hit “Install Ubuntu” and Continue, we don’t install updates because we are going to install all the tools and we want make sure versions stay the same.

 

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Choose “Erase Disk and Install Ubuntu”, and hit “Install Now”

 

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This will partition the VDI drive, Install Ubuntu on the “VirtualBox Disk Image” file that has the name Moto Mods Development.vdi ,and it is about 8GB in size. Click Continue.

 

image

 

Select English

 

image



Fill out fields and choose, “Log in automatically”, click continue 

image

 

Ubuntu will Install….

 

image

 

After installation is complete, hit “Restart Now”

image

 

The VM will reboot and Ubuntu will show Desktop, Firefox and terminal are pre-installed. We will use these to install Android Studio, Moto Mods SDK, and the Firmware tools using installer code copied from the Moto Mods Developer website.

 

image

 

Launch Terminal from the search (Purple Ubuntu symbol button) 

image


You can now read Part 2 here!

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube