I ran into a lot issues when trying to set up my development environment. I eventually got everything working. So, I'm putting my notes here in hopes that it will be helpful to someone else. Some of the issues I faced are specific to Arch Linux, but others are just bugs in the code that I would expect to affect everyone.
This is what worked for me, YMMV
These notes assume you are following along with the directions here: https://developer.motorola.com/build/tools
Setup Environment
- Step 1 -- use android-studio from AUR: https://aur.archlinux.org/packages/android-studio/
- Step 3 -- ignore for now, but remember to come back and to do this step after importing projects into android studio
- Embedded Firmware Development -- Dependencies (note python2 and pip2)
- sudo pacman -S git gperf flex bison ncurses arm-none-eabi-gcc arm-none-eabi-newlib python2-pip
- sudo pip2 install pyelftools
- OpenOCD
- sudo pacman -S libftdi
- got an error during the "make" step. Solution was to remove a single indention from line 1154 of src/jtag/drivers/ftdi.c:
ftdi_replay_queue(i);
Build From Source
- for kconfig-mconf, need to edit libs/perser/hconf.gperf
- remove line 12:
- static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);
- remove line 12:
- to compile nuttx, must be setup to use python2 instead of 3
- see "Dealing with version problem in build scripts" in the troubleshooting section of this page: https://wiki.archlinux.org/index.php/Python
- compiling bootloader: if you run into errors, make sure you have arm-none-eabi-newlib installed
Hello World Example
- under new build target, blinky directory already exists, just rename the existing one or delete it
- menuconfig support -- these files didn't need any modification, already up to date
- when setting the manifest name in menuconfig, type "hdk-blinky", not "hdk-termapp"
- Android application -- don't forget to do step 3 from above before building.
- you can't use the mdk utility app from the android app store with firmware you compiled yourself. "MDK LED Light" will remain greyed out and. Build the utility from source and use that.
Sensor Personality Card Example
- dip switch settings don't seem to matter, at least switch A1
- when setting the manifest name in menuconfig, type "temperature-example", not "hdk-temperature"
- again, you'll need to compile the android app yourself, not use the one from the app store. If you get a "moto mods sensor card not available" error, see here: moto mods sensor card not available