Productivity Sync Just another WordPress weblog

April 29, 2012

Building old versions of AOSP on ubuntu 12.04

Filed under: Uncategorized — admin @ 12:21 pm

this is a slightly more detailed/complete and a terse version of the following blog post that was forwarded to the android-builders mailing list.

Starting from the 12.04 command line do the following things (mostly in order)

  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get install dchroot debootstrap
sudo tee -a /etc/schroot/schroot.conf <<EOF
 description=Ubuntu 10.04 LTS (Lucid Lynx)
 users=<<your user name here>>
 groups=<<your user name here>>
sudo debootstrap --variant=buildd --arch amd64 lucid /var/chroot/lucid
sudo tee -a /var/chroot/lucid/etc/debian_chroot <<EOF
  • sudo cp /etc/resolv.conf /var/chroot/lucid/etc/
  • sudo cp /etc/passwd /var/chroot/lucid/etc/
  • sudo cp /etc/group /var/chroot/lucid/etc/
  • FSTAB changes: (to host 12.04 /etc/fstab)
#bind mount for lucid
/proc /var/chroot/lucid/proc bind defaults,bind 0 0
/home /var/chroot/lucid/home bind defaults,bind 0 0
  • sudo chroot /var/chroot/lucid/
  • sources.list changes:  (the chroot /etc/apt/sources.list)
 #make sure the following 2 lines are in the sources.list
 deb lucid main
 deb lucid universe
  • now install the android build dependencies;
  • apt-get update
  sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl \
               zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev \
               ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
               tofrodos gawk mkisofs

Feel free to add whatever else you may need (vim, ctags, cscope ccache, etc...)
  • Now you may want to have a script “” to log in into the chroot and as the correct user:
  • note: if you installed Java the way you are *supposed to* in $HOME/bin/ and set up the paths in your .profile then the java support “just works” otherwise you deserve what you get.
sudo chroot /var/chroot/lucid/ su - `whoami`

Seems to work.



April 22, 2012

IOIO revisited.

Filed under: Uncategorized — admin @ 5:53 pm

8 or 9 months ago I did some playing with the IOIO using an older version of Ubuntu.  I’ve gotten some time to catch up on my hobbies and picked up the IOIO again.  (thinking of making a ultrasonic collision warning system for my bike by hooking up some range finders to the IOIO and having it talk to my phone to warn of collision.) I had forgotten most of what I managed to get working in the past and I’m back to hopefully capture more of the details that tripped me up this time.

First installing the MPLAB-X no longer has problems with 64 bit ubuntu.

Product Version: MPLAB X IDE v1.10
Java: 1.6.0_24; OpenJDK 64-Bit Server VM 20.0-b12
System: Linux version 3.2.0-23-generic running on amd64; UTF-8; en_US (mplab)
Userdir: /home/mgross/.mplab_ide/dev/v1.10

Had a few gotchas with the C30 compiler for the pic24.  (hmm I see its not using my official JDK for oracle I thought I had my path’s set up correctly…)  See previous blog post for the work around on the C30 compiler.

Next building the FW for the IOIO is a bit confusing as there are 3 flavors of IOIO “historically”  I think only one flavor can be purchased today so I don’t know the value of having the older versions tagging along in the config files.  Further there are 3 different names for the HW I’m using where each one needs to be used while building each of the firmware projects.  Anyway, I am using the SparkFun IOIO build SPRK0016 (there are 5 of these it seems).  I think this refers to the version of the layout (in eagle).  Then there are 3 different IOIO00** targets.  (I use IOIO0023).  Then there are a number of different PIC variants  (I use PIC24FJ256DA206) .. mostly.  Unless you are building one of the projects that include _adb as a variant to the PIC24FJ256DA206.

A number of the projects are libraries and a few are test code and then there is the bootloader and AppLayerV1.  (which are the main ones to build)  The thing to remember is to build the lib’s first.  The following is a list of the projects and build targets I used:

  • AppLayerV1 (IOIO0023)
  • Blink (IOIO0023)  <– demo FW you don’t use.
  • Bootloader (SPRK0016)
  • LatencyTester (IOIO0023) <– demo FW you don’t use
  • libadb (PIC24FJ256DA206)
  • libbtstack (PIC24FJ256DA206)
  • libconn (PIC24FJ256DA206)
  • libusb (PIC24FJ256DA206 and PIC24FJ256DA206_ADB)  If you are using BT to talk to the IOIO use PIC24FJ256DA206.  The adb version is needed for to build the bootloader, and the non-adb flavor is needed for the AppLayerV2… You should build both.

Next you can spend time to figure out the zip file packaging of the *.ioio files the boot loader uses or you can use you Picket3 and just blast the FW.  I have a Pickit 3 and I’m not too patient so I use it for starters.  Later I’ll start using the boot loader to program new FW which is a cool thing.

what you need to do is find the *.hex files for the AppLayerV1 and the Bootloader and concatenate them into one fw.hex file.  Next you need to find the lines in the file with the following in them:


there will be 2 of them.  Keep the last one (at the end of the file) and delete the other line.

  • or you can use the script already in the repo: “tools/merge-hex

Now you can make a fw project in MPLAB-X out of an existing hex file and use mplab-x to program the target.  (It works for me)


Setting up and Building the different APK’s:

This was very hard for me as I’m not a Java / Eclipse guy and nothing seemed to work right the first time.

Note: you need to set compiler compatibility to 1.6 under the java options dialog.

As I’m building on a new box with Ubuntu 12.04beta I had to reinstall all new “everytings”:

Next you need to run “android” from the sdk and down load all the support bits for the following android versions:

  • android-3 (cupcake or donut)
  • android-7 (froyo)
  • android-10 (gingerbread) Note: you want API-10 and higher if you want to use open-accessory.

Next you can use ant to build from each application under the software IOIO directory:

  • android update project -p . -t android-10
  • ant release (or ant debug)
  • when you are done the APK will be in ./bin/.

Or you can build the APK’s using eclipse and pull you hair out trying to understand why nothing works:

  • first after following the directions on [[]] which are *very* important.   You need to open up some projects.  First do the core libraries:
    • ioio_lib
      • right click select properties and look at the Android properties.  Set build target to Android 2.3.3 (api level 10/ android-10)
      • next go to the Java Compiler and turn of Enable project specific settings and turn it off.
    • ioio_lib_bluetood
      • do the same things done to ioio_lib
    • ioio_lib_accessory
      • do the same things don to ioio_lib
    • Finally add applications HelloIOIO and do the same things done to the libs.
    • If you now select clean and build all everything might build.  If not select build all a second time.
      • it seems the libs may not be build the first time before the app is compiled so the second “build all” works.

One last note: some of the projects don’t seem to build but most of them are.

I’m not a fan of eclipse yet.  Maybe it will grow on me as I learn more about java.  (or maybe not.)

I almost forgot, After all this I did get the HelloIOIO application to turn on and off the LED on the IOIO over Bluetooth.

April 15, 2012

MPLABx / mplabc30 and ubuntu 12.04LTS beta2 strangeness

Filed under: Uncategorized — admin @ 8:59 pm

I just updated my old kick a round laptop (HP-g62: i3, 8GB RAM, 500GB HD) with Ubuntu 12.04LTS beta2 and installed the packages recommended by and yocto quick quick start and a handful of python (sci-py and friends) and some assorted things I like to have.  Then I installed MPLabX 1.10 and mplab-c30 compiler (

After this I pulled the latest IOIO code ( and started to build the FW.

I got a few different errors trying to build that came up from the compiler.

“Could not open resource file: /opt/microchip/mplabc30/v3.30c/bin/bin/c3vicefoinfono”

“Could not open … /opt/microchip/mplabc30/v3.30c/bin/bin/../bin/c3vic.infoinfo”  and a few other complaints.

To debug this I used strace -ff -o trace followed by the command line copied from the mplabx IDE and grep for info in the trace.* files created by the strace command.

It turned out I needed to add a few symbolic links to /opt/microchip/mplabc30/v3.30c/bin/bin:

cd /opt/microchip/mplabc30/v3.30c/bin/bin
sudo ln -s ../
sudo ln -s ../device_files


Now things seem to compile.

I don’t know why I am seeing this issue on 12.04.  (Note: on 11.04 I have the same compiler installed and it doesn’t give me any guff)

Powered by WordPress