User Tools

Site Tools


pidflight:flashingfirmware

PIDflight Lap

Flashing firmware to lap timing device

The following are two options you may use to flash the firmware HEX file to the Arduino nano board.

  • The Xloader option is available only for Windows operating system, it may also be used within Windows virtual machines.
  • The avrdude option is packaged with the Arduino IDE and can be used on all platforms.

Drivers

The CH340 chip is used by a number of Arduino compatible boards to provide USB connectivity. You may need to install the following driver to connect and flash firmware to these boards.


Xloader

  1. Download and open Xloader.
  2. Select the PIDflight Lap HEX file.
  3. Select “Device” as “Duemilanove/Nano (ATmega328)”
  4. Specify “COM port” as the COM port of the Arduino.
  5. Ensure “Baud rate” is set to 57600.
  6. Select “Upload” to flash the firmware HEX to the Arduino board.


avrdude

Using avrdude to flash the HEX file to the Arduino Nano board.

avrdude -U flash:w:[HEX FILE]:i -e -p atmega328p -b 57600 -c arduino -P [COM PORT]

Example:

$ avrdude -U flash:w:pidflight-lap-firmware-1.2.0.hex:i -e -p atmega328p -b 57600 -c arduino -P /dev/ttyUSB0

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: erasing chip
avrdude: reading input file "pidflight-lap-firmware-1.2.0.hex"
avrdude: writing flash (7350 bytes):

Writing | ################################################## | 100% 2.26s

avrdude: 7350 bytes of flash written
avrdude: verifying flash memory against pidflight-lap-firmware-1.2.0.hex:
avrdude: load data flash data from input file pidflight-lap-firmware-1.2.0.hex:
avrdude: input file pidflight-lap-firmware-1.2.0.hex contains 7350 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.73s

avrdude: verifying ...
avrdude: 7350 bytes of flash verified

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done.  Thank you.

Troubleshooting

  • No COM port showing when Arduino is plugged in Xloader or Device Manager – try installing the CH340 driver from the drivers section.
  • Failing to flash the HEX file to the Arduino – try another USB cable and/or USB port.
pidflight/flashingfirmware.txt · Last modified: 2018/11/20 13:02 by cmengler