Skip navigation
1 2 Previous Next

Moto Mods

22 posts

perfboard.png

 

Perforated Board

 

At a glance the perforated board seems like a nice expansion board. It looks like you can solder your projects directly to the board, plug it into the back of your phone, and away you go with a new custom feature you added to your phone. From the look of the board, most developers would say “oh that looks convenient to get my own custom electronics interacting with an app on my phone.” But, they’re completely wrong.

 

The board has 26 rows of 10 columns of through holes to solder to. Judging by that lengthy connector on the bottom, one would imaging they can directly connect the electronics that are soldered to the through holes and rails on the sides which would be electrically connected to the 80-pin connector. It must be that some of those 80-pins are GPIO tied to the grid of through holes or the grid of 260 holes has been multiplexed back to the 80-pin connector.

 

Motorola states on their website, “The Perforated Board is the primary vehicle for starting development of your Moto Mods™ Development Kit project. It brings the 80-pin connector to an accessible surface.“ I have found that this is simply not the case.

 

Not one of those holes is connected to anything except to the rows of 5 holes and the rails. There is no electrical connection from the through holes inside the board back to the connector. Motorola has given you a perfboard with an isolated connector on it.

 

The only thing that does connect back to the Reference Mod are test points above and below the connector’s exposed pads. So, if you want to use this board to actually interact with you custom electronics when you plug in this card, you have to solder wires from the test points to the rails and through holes. This is not the ideal way to prototype as Motorola has provided you. Was this board intended to be a card to mechanically hold your electronics to the board? Or do they actually expect people to solder leads from test points below to the through holes to get power and DIO lines to the perfboard?

 

Sure, you could have an external power supply to the rails but you still have to solder leads from test points, and having an external power supply defeats the purpose of this whole modular phone idea anyway. 

 

They easily could've at least taken out the last couple rows and replaced it with through holes that have internal board traces back to the 80-pin connector.

 

image16.jpg image2.jpg

 

To get an external LED to blink you have to solder jumper wires across the surface. The white wire is soldered to the test point “PG10” and the blue wire is soldered from the GND test point to the “-” rail. All other soldered wires were for experiment and unused for this project. The bottom right side red wires bring up the 1.8V and 3.3V test points for power. There is also a 5V test point, shown below as unsoldered “5P0”

 

Also, I chose the smallest through-hole LED I had, 3mm diameter. When soldered to the board, I could not get the back cover on over the LED. All-in-all, not a lot of considerations were put into this design.

 

However, I did in fact get it to work. I blinked an LED. It does work fairly well. It just isn't as turnkey and user-friendly as I would have wanted.

 

Have a story tip? Message me at: cabe(at)element14(dot)com

http://twitter.com/Cabe_Atwell

I have a Moto-Z and need to include the LAN9500A driver in the linux kernel since my USB device uses that chip.  Is there instructions on how to build a Android ROM for the Moto-Z that would include this driver?

 

Thx,

Y-

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

 

 

{gallery} Making custom App to control the Firmware

image57.pngI modified the MDK-Utility app for my own use by deleting unnecessary parts of the app that I didn’t need for my blinker app.

The Information panel and switcher “cards” were kept. Other cards were deleted.

image32.pngTo get started with modifying this app, I needed to clone the MDK-Utility app repository to Android Studio.

image13.jpgGraphic View layout

image41.jpgCode View Layout

image35.pngIn MainActivity, the code for Switcher, the “switch_led” id corresponds to the id of the graphical switch on the app panel.

When the switch is activated, it runs the raw personality service called blinky using the raw protocol to send the blink boolean to the reference moto mod, where the STM32 micro receives it and runs the blinky routine on its firmware.

image25.pngRaw Personality Service:

image39.png

Below is my custom Blinker App using parts of the MDK Utility and CardView layout.

image21.jpg

What it should look like!

 

 

 

The Slideshow above is also below:

 

An app can be made in any Android Studio platform including Windows, Linux or Mac. For this I used Windows.

 

The MDK-Utility app that motorola provides for loading firmware uses Android CardView for the layout look. Where each “card” is a different section with a display and/or button. As Shown below:

 

 

 

 

I modified the MDK-Utility app for my own use by deleting unnecessary parts of the app that I didn’t need for my blinker app. The Information panel and switcher “cards” were kept. Other cards were deleted.

 

To get started with modifying this app, I needed to clone the MDK-Utility app repository to Android Studio.

 

 

Graphic View layout

 

Code View Layout

 

In MainActivity, the code for Switcher, the “switch_led” id corresponds to the id of the graphical switch on the app panel. When the switch is activated, it runs the raw personality service called blinky using the raw protocol to send the blink boolean to the reference moto mod, where the STM32 micro receives it and runs the blinky routine on its firmware.

 

Raw Personality Service:

 

Below is my custom Blinker App using parts of the MDK Utility and CardView layout

 

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

 

{gallery} My Gallery Title

image16.jpg

image45.jpgThe power Test Points, located on the right have a 3.3V pad, 1.8V pad, and a 5V pad to use with GND.

This side I pulled them up in case I wanted to power anything.

image2.jpg3.3V is powering the rail and row 22.

Row 23 is connected to the 1.8V pad.

image55.jpg

 

Slideshow above is also below:

 

Soldering the Test Points to use the perfboard

 

Shown below is the Moto Mods Reference Mod with a perfboard attached. One thing misconceiving about the perfboard is the grid of through holes. At first glance, it looks as though there is a way to access these through holes like a GPIO connected to the micro, to make it easy…. It is actually nothing but a breadboard. Nothing is connected to it going back to the phone nor the personality card connector. The only thing that does connect to this, are the test points at the bottom. The breadboard of course a perfboard with 2 columns of 26 rows of 5, the 5 are holes horizontally are connected. Then 2 + and - Rails, connected. The only internal traces on the board are from the connector to the Test Points. This doesn’t make it convenient to connect your phone to it, to actually use it.

 

This seems like they want you to use your own external power supply. The reference Moto Mod has a battery so why wouldn't you want to use it to prototype? One way to utilize the perfboard is to solder tiny jacketed (So as not to touch other TPs) wires to the board to bring power/ground up to the rails and I/O to the grid of through holes. Soldering to Test Points aren’t ideal because you don’t have a lot of mechanical strength for the solder joint, also it's harder to do. Luckily I had a microscope.       

 

 

20170402_151758.jpg

 

The ground pad is located on the left and right sides of the connector. The power pads are located on the right. I brought up the GND to the - rail on the left because the GP10 pad was located on the left and is phone GPIO addressable. So I brought that pad up to row 20 with the white wire as shown. The LED was soldered positive side Row 20 to GND on the - rail.

 

20170330_175652.jpg

 

20170330_175642.jpg

 

The power Test Points, located on the right have a 3.3V pad, 1.8V pad, and a 5V pad to use with GND. This side I pulled them up in case I wanted to power anything. 3.3V is powering the rail and row 22. Row 23 is connected to the 1.8V pad.

 

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

 

 

 

With your Moto Z Droid plugged in and on file transfer mode, Navigate to the second nuttx folder, right click and ‘Copy To…’

 

 

 

Select phone name and save it in the Phone’s Downloads folder

 

 

On the phone, launch MDK Utility app.

In Developer Mode, Select files→ nuttx.tftf

 

 

Hit “PERFORM UPDATE”

If prompted, click continue.

 

The firmware name will show “MDK-RAWBLINKY” as we named in the Hardware Manifests file.

 

NOTE: For some reason the MDK Utility app from the app store doesn’t let you switch back to “SET MODE” once your custom firmware is loaded. The only way to use the “MDK LED Light” switch in the app is to be in SET MODE. The switch is always greyed out in DEVELOPER MODE.

 

The way around this: On github, in the MotorolaMobilityLLC repository, there is an mdkutility which is a different version that does not have modes in its APK. Download and install this APK. Load the “MDK-RAWBLINKY” firmware with the app store version of MDK Utility. Then switch to the repository APK. This will allow you to use the “MDK LED Light” switch with your custom firmware. Now the firmware should blink the LED soldered to the test point PG10. Turning the switch ON will start the blinking.

 

 

There you go….success. Custom blinky firmware using Moto Mods with perfboard.

 

Blink.jpg

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

 

 

{gallery:autoplay=false} MotoMods Developer Part 10

1.png

Step 1:Now that we’ve edited the Hardware Manifest file we need to go back and configure it back in menuconfig

2.png

Step 2:Scroll down on main menu

3.png

Step 2:

4.png

Step 2:

5.png

Step 3: Click on the last field, we will name this field the same name as the Hardware Manifests file “hdk-blinky.mnfs”

6.pngR

 

Step 4: Exit 3X.

7.png

Step 5: Configure the Bootloader

8.png

Step 6: Compile Nuttx

9.png

Step 6:

 

 

The above gallery is also the pictures and text below:

 

Now that we’ve edited the Hardware Manifest file we need to go back and configure it back in menuconfig

1.png

$ cd $BUILD_TOP/nuttx/nuttx

$ make menuconfig

 

Application Configuration  --->

  -*- Greybus utility  --->
    Select a predefined Manifest (Custom manifest)      
      (hdk-blinky) manifest name

 

Scroll down on main menu

 

 

 

 

Click on the last field, we will name this field the same name as the Hardware Manifests file “hdk-blinky.mnfs”

Enter “hdk-blinky”

 

 

Hit Ok and scroll right and press Save.

 

 

Exit 3X.

Configure the Bootloader

 

7.png

 

Compile Nuttx

 

 

See part 8 here.

 

Before we compile Nuttx, we need to change the hardware manifest file. The .mnfs file for Blinky is located in

./nuttx/apps/greybus-utils/manifests as created above.

 

 

Add the following lines to the end of the document:

 

 

At the top of the file we can input a string that will show on the app when the firmware is loaded. In [string-descriptor 2], I named my firmware “MDK-RAWBLINKY”

 

 

Cabe

http://twitter.com/Cabe_e14

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

 

Switch to the new target, this will configure the defconfig in the blinky folder when we launch the Nuttx config tool. At the beginning we created the blinky folder.

 

$ cd $BUILD_TOP/nuttx/nuttx/tools
$ ./configure.sh hdk/muc/blinky

 

Enter the commands

 

nuttx.JPG

 

In the Nuttx configuration we have to set up a few things to get the communication between the STM32 micro to work. First we turn on “Vendor Raw Support”. Navigate to each from the top menu and check

 

Device Drivers  ---> 
  [*] Greybus support  --->
    [*]   Vendor Raw Support

 

 

 

 

 

System Type  --->
  STM32 Peripheral Support  --->
    [*] TIM6

 

 

 

 

 

Board Selection  --->
  Select target board (Motorola HDK MuC)  --->
    [*] Blinky LED Mods Raw support

 

 

 

Back. Scroll Down

 

 

 

After checking “Blinky LED Mods Raw support”. Exit

 

Next we will copy the “hdk-powered.mnfs” Hardware Manifest file and name it to “hdk-blinky.mnfs” Then configure it.

 

nuttx2.JPG

 

Enter the commands above.

 

 

Cabe

http://twitter.com/Cabe_e14

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

 

 

Modifying the C file for the perfboard LED

 

The C file uses a receiver function that listens for data from an Android application using the Raw protocol.

This function we will leave the same.

 

{gallery} Modifying C File for PerfBoard

C Programming: Change the variable “GPIO_MODS_LED_DRV_3” at 4 places in the file to drive our GPIO pin named “GPIO_MODS_DEMO_ENABLE”

C Programming:  Change the variable “GPIO_MODS_LED_DRV_3” at 4 places in the file to drive our GPIO pin named “GPIO_MODS_DEMO_ENABLE”

C Programming:  Change the variable “GPIO_MODS_LED_DRV_3” at 4 places in the file to drive our GPIO pin named “GPIO_MODS_DEMO_ENABLE”

C Programming: :  Change the variable “GPIO_MODS_LED_DRV_3” at 4 places in the file to drive our GPIO pin named “GPIO_MODS_DEMO_ENABLE”

C Programming: : I’ve made the blink faster by changing the “BLINKY_PERIOD” from 1000 to 500. Pin variable

C Programming: :  I’ve made the blink faster by changing the “BLINKY_PERIOD” from 1000 to 500. Pin variable

C Programming: :  The original file used this pin, so we will comment it out

C Programming: : Now that we have changed the C file for our use with PG10. Hit Save, in the window.

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

 

After the tools are all setup, there is a file structure in Linux that we build the target firmware with. We will be modifying Motorola’s “Hello World” example to blink an LED. This example modifies the C file that runs the built in LED on the Reference Moto Mod when the switch in MDK utility is turned ON. Motorola give us a few configurations as an example of using Nuttx. First we need to copy and example configuration to a new folder, this is so we have a folder for our project with the “blinky” configuration.    



We will create a new target for build called “blinky”

 

$ cd $BUILD_TOP/nuttx/nuttx/configs/hdk/muc
$ mkdir blinky
$ cp base_powered/* blinky/



The folder is created

VirtualBox_Moto Mods Development_08_04_2017_16_48_42.png

 

We will configure these files later, next we have to modify the stm32_modsraw_blinky.c file to blink the right pin on the Moto Mods perfboard. We can also adjust the blink timing by modifying some #defines. The file is located in our project folder ./nuttx/nuttx/configs/hdk/muc/src



 

Before we edit the C file. We should create a backup of the original, copy the file to the same folder and it should automatically save it as “stm32_modsraw_blinky (copy).c”



 

Open the original “stm32_modsraw_blinky.c”. Inside the C file, we can see which header files are used for this file. What we want to do is modify this file so that we can activate a pin on the perfboard, turn it on and off with the timing setup. First we have to make sure the pin is setup properly. Located in the ./nuttx/nuttx/configs/hdk/muc/include folder is a header file that defines the variable pin names for the board, called mods.h

 

 

 

Already located in “stm32_modsraw_blinky.c” is a pin named “GPIO_MODS_DEMO_ENABLE” this is used as an example in the code. It is assigned to GPIO pin PG10. We will use this as the blinky pin. The unmodified C file blinks the “GPIO_MODS_LED_DRV_3” pin which is the pin that drives the built-in LED on the Reference Moto Mod as pictured below:

 

20170322_230233.jpg

 



PG10 is a general GPIO pin that is open for our use. This is according to the STM32 Micro pinout chart provided by Motorola, shown below.

 

 

BLINKY CODE::::

 

/*
* Copyright (c) 2016 Motorola Mobility, LLC.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <errno.h>
#include <debug.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>

#include <arch/board/mods.h>

#include <nuttx/arch.h>
#include <nuttx/device.h>
#include <nuttx/device_raw.h>
#include <nuttx/power/pm.h>

#include "stm32_tim.h"

#define BLINKY_ACTIVITY  10
#define BLINKY_TIM        6
#define BLINKY_TIM_FREQ  1000
#define BLINKY_PERIOD  1000

#define LED_ON            0
#define LED_OFF           1

static struct stm32_tim_dev_s *tim_dev;

static int blinky_timer_handler(int irq, FAR void *context)
{
  uint8_t new_val;

  pm_activity(BLINKY_ACTIVITY);
  STM32_TIM_ACKINT(tim_dev, 0);

  new_val = gpio_get_value(GPIO_MODS_LED_DRV_3) ^ 1;
  gpio_set_value(GPIO_MODS_LED_DRV_3, new_val);

  llvdbg("new_val=%d\n", new_val);
  return 0;
}

static void blinky_timer_start(void)
{
  gpio_set_value(GPIO_MODS_DEMO_ENABLE, 1);

  if (!tim_dev) {
      dbg("BLINKY\n");

      tim_dev = stm32_tim_init(BLINKY_TIM);

      DEBUGASSERT(tim_dev);

      STM32_TIM_SETPERIOD(tim_dev, BLINKY_PERIOD);
      STM32_TIM_SETCLOCK(tim_dev, BLINKY_TIM_FREQ);
      STM32_TIM_SETMODE(tim_dev, STM32_TIM_MODE_PULSE);
      STM32_TIM_SETISR(tim_dev, blinky_timer_handler, 0);
      STM32_TIM_ENABLEINT(tim_dev, 0);
  } else {
      dbg("ignore\n");
  }
}

static void blinky_timer_stop(void)
{
  gpio_set_value(GPIO_MODS_DEMO_ENABLE, 0);

  if (tim_dev) {
      dbg("STOP\n");

      STM32_TIM_DISABLEINT(tim_dev, 0);
      stm32_tim_deinit(tim_dev);
      tim_dev = NULL;

      gpio_set_value(GPIO_MODS_LED_DRV_3, LED_OFF);
  } else {
      dbg("ignore\n");
  }
}

static int blinky_recv(struct device *dev, uint32_t len, uint8_t data[])
{
  if (len == 0)
      return -EINVAL;

  if (data[0] == 0 || data[0] == '0')
      blinky_timer_stop();
  else
      blinky_timer_start();

  return 0;
}

static int blinky_register_callback(struct device *dev,
                                  raw_send_callback callback)
{
  /* Nothing to do */
  return 0;
}

static int blinky_unregister_callback(struct device *dev)
{
  /* Nothing to do */
  return 0;
}

static int blinky_probe(struct device *dev)
{
  gpio_direction_out(GPIO_MODS_LED_DRV_3, LED_OFF);
  gpio_direction_out(GPIO_MODS_DEMO_ENABLE, 0);
  return 0;
}

static struct device_raw_type_ops blinky_type_ops = {
  .recv = blinky_recv,
  .register_callback = blinky_register_callback,
  .unregister_callback = blinky_unregister_callback,
};

static struct device_driver_ops blinky_driver_ops = {
  .probe = blinky_probe,
  .type_ops = &blinky_type_ops,
};

struct device_driver mods_raw_blinky_driver = {
  .type = DEVICE_TYPE_RAW_HW,
  .name = "mods_raw_blinky",
  .desc = "Blinky LED Raw Interface",
  .ops = &blinky_driver_ops,
};

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

 

 

Flashing Firmware with MDK Utility

 

Flashing the firmware can be done in two ways, using the MDK Utility Android App (APK) which can be downloaded from the MotorolaMobilityLLC github repository or the Google Play Store. Or you can use OpenOCD to flash bootloader and firmware. We will use the Android app method.

 

In order to flash using the MDK Utility on the Motorola Z Droid. We need to check some parameters in our configuration. Enter:

 

$ cd ./nuttx/nuttx
$ make menuconfig

 

Once executed, a text based menu system in the terminal will pop up showing you the config menu. Navigate to the “Device Drivers” menu and make sure the parameters below are checked. Leave all other settings how they are, when finished, exit.

 

Device Drivers  --> 
    Greybus support (GREYBUS [=y])
        [*] Mods Protocol
            [*] Support APK update of firmware



 

 

 

 

Now back in the terminal, we need to compile the bootloader, enter

 

$ cd /home/username/MotoModsFirmware/muc-loader
$ ./configure hdk/developer
$ make

 

 

This will create a file called ‘defconfig’, in the ./MotoModsFirmware/muc-loader/configs/hdk/developer directory. We need to check this file for a similar parameter.

 

CONFIG_GREYBUS_MODS_SUPPORT_VENDOR_UPDATES=y

 

Open the file using the explorer or terminal and the last parameter should be ‘y’. As highlighted below:

 



Close file, and plug in phone. We will transfer the generated firmware executable file to the phone so that the MDK Utility can flash it to the MuC. This can be also done but loading it onto an SD card and plugging that into the phone.

 

The device will show in the file explorer

 

 

Make sure the phone is in File Transfer Mode (MTP)

 

 

Navigate to ./MotoModsFirmware/nuttx/nuttx, where the output files were generated. We will ‘Copy To…’ the “nuttx.tftf” file to the phone. Lets save it in the /Downloads directory

 

 

Hit Select

 

 

Now that the .tftf file is on the phone we are ready to flash using the MDK Utility

 

On the phone, open your MDK Utility app

 

 

In the Mode section, make sure you are in “Developer mode” for firmware flashing. If not, hit “SET MODE” and select, “Developer Mode”.

 

Click “SELECT FILES” and navigate to the ‘./Download’ folder we saved the .tftf file on the phone.

 

 

Select “nuttx.tftf” and hit “PERFORM UPDATE”

 

 

Click Continue

 

Now the firmware is flashed, you can see that the firmware is a Blinky program that tests the built-in LED on the Reference Moto Mod. The LED is located above the personality card slot. You can toggle the “MDK LED Light” switch to turn on or off the blink. The light should illuminate for 1 second ON and 1 second OFF. You can Eject/unmount and unplug the phone.

 



Ta-da!

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

 

 

Be sure to go over the first parts of this series before working on this one.

 

Now that we have the utilities setup for flashing and Debugging the firmware, we need to build and compile the firmware for the MuC. The Firmware runs Nuttx OS which is an RTOS with STMicro STM32L476 support.

 

Make Build Folder, Add utility and OS files

 

Make directory called “MotoModsFirmware” with ownership to store build files:

 

$ sudo mkdir /home/username/MotoModsFirmware

$ sudo chown -R username: ./MotoModsFirmware/

 

 

Download the Source code into your directory. We need to give our username ownership of the clone folders so we can access them.

 

$ cd ./MotoModsFirmware/
$ export BUILD_TOP=`pwd`
$ sudo git clone https://github.com/MotorolaMobilityLLC/nuttx

$ sudo chown -R <username>: ./nuttx/
$ sudo git clone https://github.com/MotorolaMobilityLLC/manifesto

$ sudo chown -R <username>: ./manifesto/
$ sudo git clone https://github.com/MotorolaMobilityLLC/muc-loader

$ sudo chown -R <username>: ./muc-loader/
$ sudo git clone https://github.com/MotorolaMobilityLLC/bootrom-tools

$ sudo chown -R <username>: ./bootrom-tools/
$ sudo git clone https://github.com/MotorolaMobilityLLC/mdkutility

$ sudo chown -R <username>: ./mdkutility/

 

 

 

 

Build kconfig-mconf, Nuttx uses the same configuration editor that is used to build the Linux Kernel.

 

$ cd /home/<username>/MotoModsFirmware/nuttx/misc/tools/kconfig-frontends
$ ./configure --enable-mconf --disable-nconf --disable-gconf --disable-qconf
$ make
$ sudo make install
$ sudo ldconfig



 








$ cd /home/<username>/MotoModsFirmware

$ export PATH=$PATH:home/<username>/MotoModsFirmware/manifesto:/home/<username>/Moto

ModsFirmware/bootrom-tools
$ cd ./nuttx/nuttx
$ make distclean
$ cd ./tools
$ ./configure.sh hdk/muc/base_unpowered







At this point the configs/hdk/muc/base_unpowered/defconfig will be copied to ./MotoModsFirmware/nuttx/nuttx/.config and the setenv.sh and Make.defs file from that same directory will be copied up to ./MotoModsFirmware/nuttx/nuttx.

 

$ cd ./nuttx/nuttx
$ make

 

 

 

The firmware output is located in the nuttx.bin, nuttx.hex and nuttx.tftf files in the /MotoModsFirmware/nuttx/nuttx Directory. We will use these later.

 

 

 

Have a story tip? Message me at: cabe(at)element14(dot)com

http://twitter.com/Cabe_Atwell

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

 

 

Believe me, developing on the Moto Mod platform is not for the faint of heart. Be sure to see Part 1 of the Moto Mod Developer series, click this link.

Then see Part 2 after this link.

A wrong move means bigtime headaches. Follow it exactly. Then come on back here.

 

In order to build and compile the firmware we need to setup Ubuntu for USB/FTDI Libraries, OpenOCD, and GDB. Then install each utility, respectively.

 

Setup Ubuntu for Firmware building

 

In Ubuntu terminal type,

 

$ sudo apt-get install -y git gperf flex bison libncurses5-dev gcc-arm-none-eabi python-pip
$ sudo pip install pyelftools

 

This will install Ubuntu's package management system used for building the flashing and debugging tools.

 

 

 

Install USB, FTDI libraries, and OpenOCD for USB JTAG emulation

 

This tool allows us to flash the firmware to MuC and debug it with GDB. This is using the USB C cable plugged into USB C slot #1 on the side of the Reference Moto Mod, which is used for programming/debugging.

 

$ sudo apt-get install -y libusb-1.0-0-dev libftdi-dev libtool autoconf texinfo
$ 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.

 

This will install libUSB and libftdi.

libUSB is a C library that provides generic access to USB devices

libftdi is an open source library used to talk to FTDI devices




 



 



 

 

 

 

 

 

Since OpenOCD uses the USB, we need to grant permissions to your linux username so it can use the FTDI. Enter the commands below in terminal:

 

$ id -u -n

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




 

Install GDB for low-level Debugging

 

The MDK provides utilities for using GDB, we will install with the commands below:

 

$ 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










 

 

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

 

Believe me, developing on the Moto Mod platform is not for the faint of heart. Be sure to see Part 1 of the Moto Mod Developer series, click this link. A wrong move means bigtime headaches. Follow it exactly. Then come on back here.

 

Part 2

 

Install JDK and Android Studio

 

This tutorial will show you how to Install JDK, Android Studio, and the Moto Mods SDK on Ubuntu 16.04

 

Android Studio requires the Java Development Kit (JDK) so we will install that first. In terminal, type “sudo apt-add-repository ppa:webupd8team/java”. Follow the terminal commands shown

 



 

 





Once the installer is done, type “javac -version” and “java -version” to check if the JDK was installed.

 



Now that JDK is installed, we can now install Android Studio in Ubuntu VM, open firefox and download Android Studio 



 

Save the file and extract it

 

 

Create a folder called Apps in the /home/<username> directory. Move the extracted folder in the /home/<username>/Apps, using right click->Move To...



 

In terminal, navigate to the directory and execute “./studio.sh”. Shown above. If you get a permissions error then, Navigate to Android Studio’s directory bin folder, give yourself permission for the .sh file and execute it

 

 

This is a new copy, Select the second option



 

Android Studio will launch

 

 

The Android Studio Welcome will show, click Next

 

 

Choose Standard Installation

 

 

Click Next

 

 

Hit Finish

 

 

Android Studio is now installed

 



Setup Moto Mods Project in Android Studio

 

Start a new Android Studio Project and configure your application name





Set Android API version to 6.0 (API level 23), Moto Mods only supports API level 23+ (Android 6.0+). It does not support earlier versions of Android.

 

 

It will install API23: Android 6.0 SDK

 

 

Create an empty activity

 

 

For beginning Moto Mods Development we will start with a Blinky application

 

 

Click Finish

 

 

Finally, the Android Studio Blinky application is setup, ready for development.

 

 

Install Moto Mods SDK

 

Now that Android Studio is installed and a project is created we need to add the Moto Mods SDK to the newly created project so that we can make API calls to the Reference Moto Mod

 

Download the Mod Mods SDK Library. Provided at: https://developer.motorola.com/build/tools/setup-environment

Save the ZIP file.

 

Moto Mods Developer Steps 2.jpg

 

In your downloads folder, Right click on the “ModLib-01.00.000.zip” and hit “Extract Here”

 



Once the ZIP is extracted, Right click and “Move To….”

 

Navigate to ‘/home/<username>’ and hit select

 

 

Once moved, open the “ModLib-01.00.000” folder and Move or Copy To…

 

 

Now we will put the SDK into our Android Studio Project. Move the .jar file into the /libs folder of our created project. ‘/home/<username>/AndroidStudioProjects/MotoModsDevelopment-Blinky/app/libs’

 

 

In the /res folder of /ModLib-01.00.000 there is a version.xml file that we need to move as well. Hit Move or Copy To...

 

 

Move or Copy “version.xml” to ‘/home/<username>/AndroidStudioProjects/MotoModsDevelopment-Blinky/app/src/main/res/values’

 

 

Shown below is how the “modlib-01.00.000.jar” and “version.xml” should look in the project explorer tree.

 



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The SDK is now added to the project and we can start using it to develop.

 

You can read Part 1 here!

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Once VirtualBox is installed, open VirtualBox Manager

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I created a disk with 30GB of space.



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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.



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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”

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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...”

 



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

.



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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.

 

 

Select English

 



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

 

Ubuntu will Install….

 

 

After installation is complete, hit “Restart Now”

 

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.

 

 

Launch Terminal from the search (Purple Ubuntu symbol button) 


You can now read Part 2 here!