diff --git a/module_dfu/doc/building_xmos_dfu.rst b/module_dfu/doc/building_xmos_dfu.rst new file mode 100644 index 00000000..e2dec5ee --- /dev/null +++ b/module_dfu/doc/building_xmos_dfu.rst @@ -0,0 +1,10 @@ +Building the loader–OSX +======================= + +The loader is compiled using libusb, the code for the loader is contained in the +file xmosdfu.cpp + +To build the loader +------------------- + + ``g++ -m32 -o xmosdfu -I. xmosdfu.cpp libusb-1.0.0.dylib`` \ No newline at end of file diff --git a/module_dfu/doc/factory_image.rst b/module_dfu/doc/factory_image.rst new file mode 100644 index 00000000..f301c005 --- /dev/null +++ b/module_dfu/doc/factory_image.rst @@ -0,0 +1,26 @@ +Installing the factory image to the device +========================================== + +To rebuild the USB audio firmware with the DFU device interface edit the +device_defines.h file and comment in the #define DFU line. + +Use the XMOS Development Tools to run the command: + + ``xflash --boot-partition-size 0x20000 usb_audio.xe`` + +This programs the factory default firmware image into the flash device. This +will add a new interface to the device that supports the DFU mechanism. + +To use the firmware upgrade mechanism you need to build a firmware upgrade +image: + +#. Edit the ``device_defines.h`` file and change the BCD_DEVICE number for the + application. +#. Rebuild the application. + +To generate the firmware upgrade image run the following command: + + ``xflash --upgrade 1 usb_audio.xe 0x20000 -o new_firmware.bin`` + +You should now have the file ``usb_audio_class1.bin`` which contains the +firmware for the audio class 1 implementation. diff --git a/module_dfu/doc/index.rst b/module_dfu/doc/index.rst new file mode 100644 index 00000000..54e4974a --- /dev/null +++ b/module_dfu/doc/index.rst @@ -0,0 +1,10 @@ +DFU loader for XMOS USB AUDIO devices +===================================== + +.. toctree:: + + Introduction + Installing the factory image to the device + Using the DFU loader–Windows + Using the DFU loader–OSX + Building the loader–OSX diff --git a/module_dfu/doc/introduction.rst b/module_dfu/doc/introduction.rst new file mode 100644 index 00000000..8591529d --- /dev/null +++ b/module_dfu/doc/introduction.rst @@ -0,0 +1,22 @@ +Introduction +============ + +The DFU loader is a flash device firmware upgrade mechanism. To work correctly +your development board must contain the latest DFU enabled firmware. + +The firmware upgrade for XMOS USB devices implementation uses the USB standard +DFU device class mechanism and is based on the following specification: +http://www.usb.org/developers/devclass_docs/usbdfu10.pdf + +Supported functionality: + +- Download of new firmware to device +- Upload of existing firmware from device +- Revert device back to factory image +- Automatic reboot of device on firmware upgrade + +You must use XMOS Development Tools version 10.4.1 (or later) with firmware +interface. + +The DFU device on Windows requires the Theyscon USB Audio 2.0 Windows driver +version 1.13.3.0 or later. diff --git a/module_dfu/doc/thesycon_dfu.rst b/module_dfu/doc/thesycon_dfu.rst new file mode 100644 index 00000000..2dda7db7 --- /dev/null +++ b/module_dfu/doc/thesycon_dfu.rst @@ -0,0 +1,57 @@ +Using the DFU loader–Windows +============================ + +Set up the image loader +----------------------- + +#. Open the DFU Console Window from the Thesycon folder on the Start menu + (Program Files>Thesycon>USB Audio 2.0 Class Driver EVAL>DFU console). +#. change directory to where the files have been extracted. + +To check the device has been detected, run the following command in the DFU +console: + + ``dfucons info`` + +The console shows the DFU devices that have been detected. + +Download new firmware +--------------------- + +To program the new firmware run the command: + + ``dfucons download usb_audio_class1.bin`` + +Note that once this is done the device restarts as an XMOS audio 1.0 device. The +original factory default audio 2 application is still present but the device is +now running the upgraded application firmware. + +You can check the device has been updated by running the command: + + ``dfucons info`` + +This will display the device revision. + +Uploading existing firmware from the device +------------------------------------------- + +You can retrieve a firmware image from the device, providing an upgrade image is +present. +Run the command: + + ``dfucons upload currentfirmware.bin`` + +The file ``currentfirmware.bin`` contains the latest upgrade image. This file is +an exact copy of the data from the flash and can be downloaded to the device +again to test. + +Reverting firmware to factory image +----------------------------------- + +To revert the device back to its factory (i.e XFLASH) installed state from the +new firmware, run the command: + + ``dfucons revertfactory`` + +The device will now only contain the factory firmware and will be running as an +audio 2 device again. diff --git a/module_dfu/doc/xmos_dfu.rst b/module_dfu/doc/xmos_dfu.rst new file mode 100644 index 00000000..08c65210 --- /dev/null +++ b/module_dfu/doc/xmos_dfu.rst @@ -0,0 +1,45 @@ +Using the DFU loader–OSX +======================== + +Set up the image loader +----------------------- + +#. Open a terminal +#. Change directory to where the files have been extracted +#. Source the ``setup.sh`` script + +Download new firmware +--------------------- + +To program the new firmware run the command: + + ``./xmosdfu --download usb_audio_class1.bin`` + +Note that once this is done the device restarts as an XMOS audio 1.0 device. The +original factory default audio 2 application is still present but the device is +now running the upgraded application firmware. + +Uploading existing firmware from the device +------------------------------------------- + +You can retrieve a firmware image from the device, providing an upgrade image is +present. + +Run the command: + + ``./xmosdfu --upload currentfirmware.bin`` + +The file ``currentfirmware.bin`` contains the latest upgrade image. This file is +an exact copy of the data from the flash and can be downloaded to the device +again to test. + +Reverting firmware to factory image +----------------------------------- + +To revert the device back to its factory (i.e XFLASH) installed state from the +new firmware, run the command: + + ``./xmosdfu --revertfactory`` + +The device will now only contain the factory firmware and will be running as an +audio 2 device again.