Difference between revisions of "DiscFerret:Downloads"

From DiscFerret
Jump to: navigation, search
(Upgrading the firmware)
Line 22: Line 22:
 
# Copy the firmware HEX file and mphidflash into the same directory.
 
# Copy the firmware HEX file and mphidflash into the same directory.
 
# From a command prompt, change into the directory containing mphidflash (e.g. `cd mphidflash`).
 
# From a command prompt, change into the directory containing mphidflash (e.g. `cd mphidflash`).
# On Linux, run the following command: `./mphidflash -r -n -v 04d8 -p fbba -w discferret_firmware_XXXX.hex` (replace XXXX with the firmware version number).
+
# On Linux, run the following command: <pre>./mphidflash -r -n -v 04d8 -p fbba -w discferret_firmware_XXXX.hex</pre> (replace XXXX with the firmware version number).
# On Windows, run the following command: `mphidflash -r -n -v 04d8 -p fbba -w discferret_firmware_XXXX.hex` (replace XXXX with the firmware version number).
+
# On Windows, run the following command: <pre>mphidflash -r -n -v 04d8 -p fbba -w discferret_firmware_XXXX.hex</pre> (replace XXXX with the firmware version number).
 
# Unplug the DiscFerret, remove the BOOT jumper, then reconnect the USB and power cables (in that order). Your DiscFerret should now be running the latest firmware.
 
# Unplug the DiscFerret, remove the BOOT jumper, then reconnect the USB and power cables (in that order). Your DiscFerret should now be running the latest firmware.
  
Line 44: Line 44:
  
 
The Microcode Type and Microcode Version will only be valid if a microcode bundle has been uploaded to the DiscFerret (i.e. if an application which uses the DiscFerret has already been run). If the Microcode Type is anything other than `0xDD55`, then the microcode version will not be valid. Device information can only be queried when the DiscFerret is running the operating firmware; the bootloader has no support for firmware version querying.
 
The Microcode Type and Microcode Version will only be valid if a microcode bundle has been uploaded to the DiscFerret (i.e. if an application which uses the DiscFerret has already been run). If the Microcode Type is anything other than `0xDD55`, then the microcode version will not be valid. Device information can only be queried when the DiscFerret is running the operating firmware; the bootloader has no support for firmware version querying.
 
  
 
== Microcode ==
 
== Microcode ==

Revision as of 13:06, 1 March 2011

Firmware

The latest firmware package is version 001C, which can be downloaded from here.

Change history

Version 001C (2010-02-13)

Fix a serious bug relating to USB hot-plugging. If the DiscFerret was powered up before the USB cable was connected, then the USB stack may not start up correctly. Additionally, if the USB cable is unplugged while the DiscFerret is powered up, the USB PHY may lose sync with the host.


Upgrading the firmware

To upgrade the firmware on a DiscFerret, you will need a copy of the "mphidflash" program from http://code.google.com/p/mphidflash/.

The upgrade procedure is as follows:

  1. Disconnect the USB and power cables from the DiscFerret.
  2. Install a jumper cap over the two-pin header marked "BOOT".
  3. Reconnect the USB cable, then the power cable.
  4. The amber "MCU Status" LED should now be blinking rapidly.
  5. Copy the firmware HEX file and mphidflash into the same directory.
  6. From a command prompt, change into the directory containing mphidflash (e.g. `cd mphidflash`).
  7. On Linux, run the following command:
    ./mphidflash -r -n -v 04d8 -p fbba -w discferret_firmware_XXXX.hex
    (replace XXXX with the firmware version number).
  8. On Windows, run the following command:
    mphidflash -r -n -v 04d8 -p fbba -w discferret_firmware_XXXX.hex
    (replace XXXX with the firmware version number).
  9. Unplug the DiscFerret, remove the BOOT jumper, then reconnect the USB and power cables (in that order). Your DiscFerret should now be running the latest firmware.

To identify the current firmware version of your DiscFerret (and its MCU Serial Number), use the id_program.py tool from the Firmware Source Code archive:

./id_program.py --info

This will display a screen similar to the following:

Device opened successfully
Device information:
	product:        DiscFerret magnetic disc analyser
	microcode_ver:  0x0020
	serialnumber:   TARKA
	firmware_ver:   0x001B
	microcode_type: 0xDD55
	hardware_rev:   0I06
	manufacturer:   Red Fox Engineering

The Microcode Type and Microcode Version will only be valid if a microcode bundle has been uploaded to the DiscFerret (i.e. if an application which uses the DiscFerret has already been run). If the Microcode Type is anything other than `0xDD55`, then the microcode version will not be valid. Device information can only be queried when the DiscFerret is running the operating firmware; the bootloader has no support for firmware version querying.

Microcode

Microcode bundles (RBF files) are included with release versions of the C and Python APIs. Generally speaking, you should only use the microcode version which was included with a given version of the API. To upgrade to a later microcode version, upgrade the API.

For reference, the latest 'release' Microcode is version 0020, which is available to download here: microcode_0020.rbf.


Bootloader

If the DiscFerret will not enter the bootloader even with the BOOT jumper installed, the bootloader may have become corrupted. In normal use, this should not be possible. It is, however, still possible to recover the DiscFerret, as long as you have a suitable PIC programmer. To do this, five wires must be soldered to the programming pads on the bottom of the DiscFerret PCB, and a PIC programmer (e.g. a Microchip PICKit 2) is connected to these wires. See the DiscFerret circuit diagram for the pin configuration of these pads.

NOTE: The DiscFerret uses a PIC18F85J50 microcontroller, which uses 3.3V Low Voltage Programming. Make ABSOLUTELY SURE your PIC programmer supports this programming mode (the PICKit 2 and PICKit 3 do), and that the device is set to "PIC18F85J50" (NOT auto-detect). Failure to follow these instructions WILL destroy the microcontroller IC!

After reprogramming the bootloader, the Unit Serial Number must be reprogrammed using id_program.py, which is included in the Firmware Source-Code Bundle, under the "test" directory. You will need to install the Python LibUSB wrapper library (on an Ubuntu Linux system, this is in the package `python-usb`) in order to use this tool.

DISCLAIMER: Damage caused by incorrectly reflashing the bootloader is NOT covered by the warranty! If you are not confident in your abilities, contact Red Fox Engineering to arrange for your DiscFerret to be re-programmed (a small charge may be made in order to cover postage and packing costs).

Bootloader HEX file: Bootloader Release 1.0 Final.