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 4 - Getting Started - Make Build-Folder, add Utility and OS files
  • 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: 11 May 2017 6:53 PM Date Created
  • Views 2006 views
  • Likes 1 like
  • Comments 5 comments
  • android
  • developer
  • moto-z
  • motorola
  • mobile
  • cabeatwell
  • moto mdk
  • motomods
  • linux
Related
Recommended

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

Catwell
Catwell
11 May 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

 

 

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

 

image

 

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

 

image

 

image

 

image

 

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



image

 

image



image




image



$ 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



image



image



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

 

image

 

image

 

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.

 

image

 

 

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

http://twitter.com/Cabe_Atwell

  • Sign in to reply

Top Comments

  • soviet_steve
    soviet_steve over 7 years ago +1
    Great tutorial, one mistake on this page which can cause some headaches export PATH=$PATH:home/<username>/MotoModsFirmware/manifesto:/home/<username>/Moto ModsFirmware/bootrom-tools should be export PATH…
  • yileku
    yileku over 7 years ago in reply to vamshireddy

    I am getting the same error.

    Y-

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • vamshireddy
    vamshireddy over 7 years ago

    I have a small issue while making after entering into nuttx it says that manifest.inc No such file or directory a fatal error it seems can you please guide me?

    tools/version.sh -v 0.1 -b 31da121-dirty .version; \

    chmod 755 .version; \

     

     

    LN: include/arch/board to configs/hdk/muc/include

    LN: include/arch/chip to arch/arm/include/stm32

    LN: arch/arm/src/chip to arch/arm/src/stm32

    LN: include/apps to ../apps/include

    make[3]: Nothing to be done for 'context'.

    make[3]: Nothing to be done for 'context'.

    make[3]: Nothing to be done for 'context'.

    make[3]: Nothing to be done for 'context'.

    make[3]: Nothing to be done for 'context'.

    make[3]: Nothing to be done for 'context'.

    make[2]: Nothing to be done for 'depend'.

    make[2]: Nothing to be done for 'depend'.

    manifesto manifests/hdk.mnfs 0x00000042 0x00000001

    make[2]: manifesto: Command not found

    Makefile:143: recipe for target 'manifests/hdk.mnfb' failed

    make[2]: *** [manifests/hdk.mnfb] Error 127

    Makefile:158: recipe for target 'greybus-utils_depend' failed

    make[1]: *** [greybus-utils_depend] Error 2

    make[1]: Nothing to be done for 'depend'.

    make[1]: 'libsched.a' is up to date.

    make[1]: 'libc.a' is up to date.

    make[1]: 'libmm.a' is up to date.

    make[1]: 'libarch.a' is up to date.

    make[1]: 'libcxx.a' is up to date.

    CC:  nsh_parse.c

    AR:   nsh_init.o nsh_parse.o nsh_console.o nsh_script.o nsh_command.o nsh_fscmds.o nsh_ddcmd.o nsh_proccmds.o nsh_mmcmds.o nsh_envcmds.o nsh_dbgcmds.o nsh_session.o nsh_builtin.o nsh_timcmds.o nsh_mntcmds.o nsh_consolemain.o nsh_test.o

    make[2]: Nothing to be done for 'all'.

    CC:  sysinfo.c

    AR:    sysinfo.o

    CC:  manifest.c

    manifest.c:76:24: fatal error: manifest.inc: No such file or directory

    #include "manifest.inc"

                            ^

    compilation terminated.

    Makefile:136: recipe for target 'manifest.o' failed

    make[2]: *** [manifest.o] Error 1

    Makefile:155: recipe for target 'greybus-utils_all' failed

    make[1]: *** [greybus-utils_all] Error 2

    LibTargets.mk:157: recipe for target '../apps/libapps.a' failed

    make: *** [../apps/libapps.a] Error 2

     

     

    This is what i am getting there

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • motomodsdev
    motomodsdev over 7 years ago in reply to sharples

    Fixed, thank you.  The original post also had a lot of unnecessary sudo's.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • sharples
    sharples over 7 years ago in reply to soviet_steve

    Benjamin,

    Thank you for providing this comment!  I was stuck here and the '/' made all the difference.

    Regards,

    -Michael

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • soviet_steve
    soviet_steve over 7 years ago

    Great tutorial, one mistake on this page which can cause some headaches

     

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

    ModsFirmware/bootrom-tools

    should be

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

    ModsFirmware/bootrom-tools

    it's just a forward slash but it makes a difference

    thanks for the help

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
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