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 upload_hex.sh
script from the
vi-firmware
directory, passing it the file path to the
.hex firmware file you obtained.
$ cd vi-firmware
vi-firmware/ $ script/upload_hex.sh <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/upload_hex.sh <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.
PATH
checked.
C:\Users\me> cd Documents\vi-firmware\script
C:\Users\me\Documents\vi-firmware\script>
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.