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)
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 [[http://developer.android.com/sdk/eclipse-adt.html]] which are *very* important. You need to open up some projects. First do the core libraries:
- 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.
- do the same things done to ioio_lib
- 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.