Android AVRDUDE and FTDI Serial Terminal

December 2016 ยท 2 minute read

Task

For this project we had two tasks, try to get avrdude running on android, and then create a vt100 compliant serial application using the FTDI CH232 serial chip.

Solution

We succeeded in being able to flash hex files, read fuses, and communicate over serial. This was tested using a raspberry pi, whose serial terminal could be explored using our app.

Despite much effort, on new versions of android, we couldnt find a way to run without root. There are various bugs and exploits for android versions < 5.0 but this was not practical as we were using our own devices.

In the end a lot of time was spent cross compiling libftdi, libusb and avrdude for android, along with searching for an appropriate exploit for android USB permissions.

The following images show the functionality of the two applications (it was developed from scratch and was only a small coursework, hence the unfinished aesthetic!):

A hex file could be flashed to the device, then the status was read back in the space below

For the serial terminal, the standard options were provided. > 115200 baud caused some missed characters, though that may have been due to the hardware setup…

Custom terminal navigation was added to the top of the keyboard, which saved hand typing VT100 commands!

Fuse burning worked, and was verified by reading back the fuse status

I think this project was pretty useful as it had a good amount of hardware and software development, however it was another impossible task set for the Real Time Embedded Systems module :D The other being running a 6LOWPAN stack on the wrong bluetooth modules! attempt to build something we would actually use in the future – we spend a lot of time programming sensor nodes and using a mobile device to deploy code and debug these has proved useful.