Download the latest stable release of the vi-firmware source code from GitHub - the repository has a script we will use for flashing the firmware.

Next, make sure you have the mini-USB port on the chipKIT connected to your computer to upload a new firmware. This is different than the micro-USB port that you use to read vehicle data - see the device connections section to make sure you have the correct cable attached.

If your network uses an Internet proxy (e.g. a corporate network) set these environment variables:

$ export http_proxy=<your proxy>
$ export https_proxy=$http_proxy
$ export all_proxy=$http_proxy

Run the script from the vi-firmware directory, passing it the file path to the .hex firmware file you obtained.

$ cd vi-firmware
vi-firmware/ $ script/ <firmware file>.hex

If you have more than one virtual serial (COM) port active, you may need to explicitly specify which port to use. Pass the port name as the second argument to the script, e.g.:

$ cd vi-firmware
vi-firmware/ $ script/ <firmware file>.hex /dev/ttyUSB2

The script attempts to install all required dependencies automatically. If you run into problems, or are running an operating system not listed above, you may need to install the dependencies manually. For instructions on how to install the dependencies manually, as well as how to address some common errors, see the troubleshooting section for more information.

  1. Install the FTDI USB-serial Driver - you should already have this if you've programmed an Arduino from your computer.
  2. Install WinAVR and make sure to leave the option to add the tools to your PATH checked.
  3. Open the Windows Device Manager and look under "Ports" for a "USB Serial Port" - take note of the COM port number, e.g. COM14. If there is more than one, unplug the chipKIT and see which disappears.
  4. Open a Command Prompt and navigate to the "script" directory in the vi-firmware folder:
    C:\Users\me> cd Documents\vi-firmware\script
  5. Plug in the chipKIT with the mini-USB connection, and within 5 seconds, run the upload_hex.bat script, passing the path to the firmware file you want to program and the COM port number, e.g.:
    C:\Users\me\Documents\vi-firmware\script> upload_hex.bat C:\Users\me\Downloads\openxc-firmware\focus-2012-CHIPKIT.hex com14
    The chipKIT board will only stay in programming mode for ~5 seconds once plugged into the USB port. If you have issues running the firmware script, unplug the vehicle interface, plug it back in, and quickly re-run the script.

Once you've flashed the firmware using the script, it's time to test your Vehicle Interface. You can use the OpenXC Python Library to run a quick smoke test to verify the firmware flashed successfully.