Skip to content
Snippets Groups Projects
Commit 5d0baf9f authored by Michael DM Dryden's avatar Michael DM Dryden
Browse files

Update flashing instructions in README.markdown.

parent c4be24fb
Branches
Tags
No related merge requests found
Pipeline #89 passed with stage
in 28 seconds
...@@ -11,7 +11,9 @@ This is the documentation for the DStat microcontroller firmware. ...@@ -11,7 +11,9 @@ This is the documentation for the DStat microcontroller firmware.
* [Fuse bits](#fuse-bits) * [Fuse bits](#fuse-bits)
* [Firmware files](#firmware-files) * [Firmware files](#firmware-files)
* [Using Make](#using-make) * [Using Make](#using-make)
* [Using avrdude directly](#using-avrdude-directly)
* [Atmel Studio 6](#atmel-studio-6) * [Atmel Studio 6](#atmel-studio-6)
* [USB DFU Flashing (experimental)](#usb-dfu-flashing-experimental)
* [Connection and testing](#connection-and-testing) * [Connection and testing](#connection-and-testing)
* [Mac OS X and Linux](#mac-os-x-and-linux) * [Mac OS X and Linux](#mac-os-x-and-linux)
* [Windows](#windows) * [Windows](#windows)
...@@ -84,12 +86,13 @@ This can be done from the [Fuses](http://www.atmel.com/webdoc/atmelstudio/atmels ...@@ -84,12 +86,13 @@ This can be done from the [Fuses](http://www.atmel.com/webdoc/atmelstudio/atmels
## Firmware files ## Firmware files
The memory files used to program the microcontroller are found in the root directory: The memory files used to program the microcontroller are found in the root directory:
* Firmware: `dstat-firmware.elf` * Firmware: `dstat-firmware.elf`
* Bootloader: `atxmega256a3u_104.hex` (See note below)
Before programming, make sure your programmer is connected to your computer and its PDI connector is connected to the pin header labelled AVR-PDI on the DStat. Before programming, make sure your programmer is connected to your computer and its PDI connector is connected to the pin header labelled AVR-PDI on the DStat.
The side with the red wire should face the pin labelled 1 on the PCB. The side with the red wire should face the pin labelled 1 on the PCB.
### Using Make ### Using Make
Similar to building from source, the make command can be used to program the microcontroller. Similar to building from source, the make command can be used to program the microcontroller using avrdude (which must be present on your system).
By default, the Makefiles are configured to use an AVR ISP mk2 connected over USB. By default, the Makefiles are configured to use an AVR ISP mk2 connected over USB.
If you are using a different programmer, be sure to set the `AVRDUDE_PROG` and `AVRDUDE_PORT` options in the `config.mk` files found in the DSTAT and EEPROM init directories. If you are using a different programmer, be sure to set the `AVRDUDE_PROG` and `AVRDUDE_PORT` options in the `config.mk` files found in the DSTAT and EEPROM init directories.
See `man avrdude` for more information about these options. See `man avrdude` for more information about these options.
...@@ -98,9 +101,14 @@ To upload the firmware file and set fuse bits: ...@@ -98,9 +101,14 @@ To upload the firmware file and set fuse bits:
```` ````
make program make program
```` ````
Occasionally, setting the fuse bits may fail. The first time the fuse bits are set, verification will fail—simply run the command again.
If an error occurs on verification, simply run `make program` again.
### Using avrdude directly
The make command simply invokes avrdude.
Avrdude can be used directly if preferred (changing the -P and -c options to reflect the programmer you are using):
````
avrdude -p x256a3u -c avrispmkII -P usb -U flash:w:atxmega256a3u_104.hex:i -U application:w:dstat-firmware.elf:e -U fuse4:w:0xff:m -U fuse2:w:0xbf:m
````
### Atmel Studio 6 ### Atmel Studio 6
Follow the directions [here](http://www.atmel.com/webdoc/atmelstudio/atmelstudio.AVRStudio.ProgrammingDialog.Introduction.html) to program the microcontroller. Follow the directions [here](http://www.atmel.com/webdoc/atmelstudio/atmelstudio.AVRStudio.ProgrammingDialog.Introduction.html) to program the microcontroller.
...@@ -108,6 +116,25 @@ Be sure to select `ATXMEGA256A3U` as the Device and `PDI` as Interface. ...@@ -108,6 +116,25 @@ Be sure to select `ATXMEGA256A3U` as the Device and `PDI` as Interface.
In the Memories tab, `dstat-firmware.elf` should be selected for Flash In the Memories tab, `dstat-firmware.elf` should be selected for Flash
### USB DFU Flashing (experimental)
Version 1.2.3 PCBs are equipped with a switch that can be used to put the DStat into a USB flashing mode.
If the switch (SW1) is depressed while plugging the USB cable in, the DStat should boot to the DFU firmware (if done correctly, no LEDs should be lit on the board).
In this mode, the firmware can be updated over USB using Atmel FLIP or avrdude.
Using make:
````
make dfu
````
Using avrdude directly:
````
avrdude -p x256a3u -c flip2 -U application:w:dstat-firmware.elf:e
````
Note, DFU flashing will only work if the DFU bootloader is installed and can't be used to set flash bits or flash a new bootloader.
Unfortunately the XMega doesn't come with a bootloader installed, so flashing with a PDI programmer must be done for at least the first time.
# Connection and testing # Connection and testing
If the firmware has been successfully applied, it will be possible to connect to the DStat over USB. If the firmware has been successfully applied, it will be possible to connect to the DStat over USB.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment