This is a outline on how to build the images to run the IOIO [http://codaset.com/ytai/ioio/wiki] with a nexus 1 phone.
- rooted Nexus-1 running CyanogenMod 7.1.0-RC1-N1
- IOIO board The device is a “pic24jf256DA206” board
- 5V -12V DC PSU good to 2A output. (what I’m using is overkill 5V at 8A)
Downloads to get:
- IOIO code base
git clone https://codaset.com/ytai/ioio.git
- At the time of this writing the tip was: 8f8704f updated App-IOIO0300 to get rid of excessive logging
Pin outs between PICkit3 and IOIO:
The programmer : the IOIO
pin1 : MCLR,
pin2 : 3.3
pin3 : gnd
pin4 : 36
pin5 : 35
pin6 : no-connect
- Android SDK installation
- Eclipse setup with ADT
- ADT / eclipse environment has gotchas WRT configuring builds and the need to clean the projects before a build will succeed.
- MPLAB-X installation (have to play games with JAVA_HOME as root)
- MPLAB-X beta 7.01 vrs jdk1.7.0 (hint you need to use jdk1.6.0_26 for now)
- PICkit3 use from MPLAB-X (wasn’t so bad after I figured it out)
- IOIO FW code structure and undocumented packaging tools for building boot FW and *.ioioapp files the ioio manager uses.
- IOIO SW code structure and undocumented set up for building up ADK builds
- IOIO git project has IDE config files in it that get changed by simply opening the projects. (annoying but common with IDE use)
- Not knowing MPLab, PIC, or JAVA very well.
First install the JDK, eclipse and android SDK all into $HOME:
- I install the JDK into $HOME/bin and setup JAVA_HOME and PATH environment variables in my $HOME/.profile file:
- mkdir $HOME/bin
- cd $HOME/bin
- tar -xf ../Downloads/android*.tgz
- run the android-sdk-linux_x86/tools/android command and download the android SDK versions you want. (I just go them all)
- tar -xf ../Downloads/eclips*.tar.gz
- chmod +x ../Downloads/jdk*.bin
- Then set-up your environment variables in $HOME/.profile
- mplabx beta 7.01 doesn’t install on x86_64 versions of Ubuntu.
- I’m pretty sure there isn’t a good technical reason for this. One can install on a 64bit Linux provided you set up the 32bit JDK and poin the JAVA_HOME to it. Still this is a work around.
- I’m running mplabx in its own virtual-box VM of ubuntu 11.04 32bit.
- There is one link I found on the Internet calling out an mplabx install hack using JAVA_HOME and PATH names that worked for someone. But, it didn’t work so much for me.
- The mplabx installer looks in selected paths for the JDK installation. Set up a JAVA_HOME environment variable to point to the JDK you want to be used with the installer program.
- or use the following script run as root:
- what system global configuration does it touch after installing???? It wants me to reboot to start using it? This scares me.
Building the APK’s
- Install the ADT
- configure android plugin to point to sdk
- set android build output to verbose
- set general / workspace to not “Build automatically”
- use import existing project to import ioio_lib into workspace
- use android tools > fix project properties (not sure what it does)
- set project build target to Android 3.0
- disable “Enable project specific settings” (if set under properties java compiler)
- mkdir a directory “ioio/software/IOIOLib/res”
- project / clean
- import ioiomanager project
- android tools > fixproject properties
- change android build target to android 3.0
- import existing project ioio/software/applications/helloIOIO (leaving the lib and ioiomanager projects where they are in the IDE.
- select project properties and set the build target to android 3.0
- select project clean
- build project
- Run As 1 Android Application (with phone connected to development host) to load APK
Building the FW:
- use Open Project to open the IOIO/firmware/bootloader and IOIO/firmware/app_layer_v1 projects
- for the boot loader I needed to use the SPRK0016 target
- if you are going to use the IOIOmanager built above instead of the one from the app-store, then you will want to disable the security check in the bootloader FW. (using the -DBYPASS_SECURITY compiler option.)
- for the AppLayerV1 I needed the IOIO0003 target
- both build.
building *.ioioapp files and using the IOIO Manager:
Loading the FW with pickit3 through MPLabX
- locate the *.hex files: find ioio/firmware -name *.hex
- concatenate them
for b in `find ioio/firmware -name *.hex`;do cat $b >>flash.hex; done
- edit flash.hex and clean out extra “:00000001FF” from middle of the file.
- create a new project in mplabx category “Microchip Embedded” and project “Prebuilt (Hex,Loadable Image) project navigate to flash.hex and select ok, select the device (from me its pic24fj256da206)
- finally select “make and program device to flash the IOIO
At this point you should be able to run the test apk on your Android phone and turn on the yellow LED.
There are a couple of painfully boring screen casts with audio that is way too quite walking through setting up a VBox guest with 11.04 and the above tools.