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:
$ mkdir /home/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`
$ git clone https://github.com/MotorolaMobilityLLC/nuttx
$ git clone https://github.com/MotorolaMobilityLLC/manifesto
$ git clone https://github.com/MotorolaMobilityLLC/muc-loader
$ git clone https://github.com/MotorolaMobilityLLC/bootrom-tools
$ git clone https://github.com/MotorolaMobilityLLC/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
Top Comments