Wednesday, 7 November 2018

Wrapper library for avrdude

The problem: Through an Android app, be able to programmatically verify arduino flash contents to ensure it has not been changed (maliciously)

I am able to do that with avrdude using the command as below in the android adb shell

avrdude -C/data/data/com.myapp.avrdude/local/etc/avrdude.conf -v -patmega2560 -cstk500v2 -P/dev/ttyACM0 -b115200 -D -Uflash:v:firmware.hex:i

This works well with arduino, but the problem comes in when I want to do the same with a board that uses an FTDI chip. When it's connected to the android device it does not show up in /dev/ location.

On a linux machine the arduino device appears as /dev/ttyACM0, and the FTDI device is /dev/ttyUSB0. The problem is the FTDI device does not appear on android therefore the avrdude command above becomes useless.

I do not want to build the kernel driver for FTDI as specified here

The approach I want to go with which I think is most viable is to find/build a simple java wrapper for avrdude that interacts with the usb device at a higher level, this way I can make use of the FTDI java library to execute a command to verify flash.

Is this approach viable? If not, what is the best way to approach this problem?



from Wrapper library for avrdude

No comments:

Post a Comment