Index of the Moto Mods Developer project:
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
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.
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
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”
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.