Difference between revisions of "DiscFerret:Downloads"

From DiscFerret
Jump to: navigation, search
(Access libraries)
Line 11: Line 11:
  
 
To build it:
 
To build it:
  <nowiki>
+
  tar -zxf libdiscferret-1.1r1.tar.gz
tar -zxf libdiscferret-1.1r1.tar.gz
+
make
make
 
</nowiki>
 
  
 
To install it:
 
To install it:
  <nowiki>
+
  make install
make install
 
</nowiki>
 
  
 
By default, the libraries and headers are installed in /usr/local/lib and /usr/local/include respectively. To change this, append "PREFIX=path" to both the "make" and "make install" commands. For example, to install in ''/opt/discferret'', use these commands:
 
By default, the libraries and headers are installed in /usr/local/lib and /usr/local/include respectively. To change this, append "PREFIX=path" to both the "make" and "make install" commands. For example, to install in ''/opt/discferret'', use these commands:
  
  <nowiki>
+
  make PREFIX=/opt/discferret
make PREFIX=/opt/discferret
+
make install PREFIX=/opt/discferret
make install PREFIX=/opt/discferret
 
</nowiki>
 
  
 
The latest version is '''Release 1.1r1''', which can be downloaded from here: [http://www.discferret.com/downloads/libdiscferret-1.1r1.tar.gz libdiscferret-1.1r1.tar.gz].
 
The latest version is '''Release 1.1r1''', which can be downloaded from here: [http://www.discferret.com/downloads/libdiscferret-1.1r1.tar.gz libdiscferret-1.1r1.tar.gz].
Line 36: Line 30:
 
* Add support for the "Track 0 Reached During Seek" status bit
 
* Add support for the "Track 0 Reached During Seek" status bit
 
* Add discferret_seek_* functions to simplify head seek operations
 
* Add discferret_seek_* functions to simplify head seek operations
 
  
 
== Microcode ==
 
== Microcode ==

Revision as of 17:02, 22 March 2011


Access libraries

libdiscferret (C library)

Libdiscferret allows applications written in C or C++ to access the DiscFerret, without having to worry about USB transaction management, packetisation and other low-level issues. It is known to run on any UNIX platform which provides the libusb-1.0 API. At the time of writing, this includes:

  • Linux
  • FreeBSD 8 (or later)
  • Mac OS X (Darwin)

To build it:

tar -zxf libdiscferret-1.1r1.tar.gz
make

To install it:

make install

By default, the libraries and headers are installed in /usr/local/lib and /usr/local/include respectively. To change this, append "PREFIX=path" to both the "make" and "make install" commands. For example, to install in /opt/discferret, use these commands:

make PREFIX=/opt/discferret
make install PREFIX=/opt/discferret

The latest version is Release 1.1r1, which can be downloaded from here: libdiscferret-1.1r1.tar.gz.

Change history

Release 1.1r1
  • Add support for the "Track 0 Reached During Seek" status bit
  • Add discferret_seek_* functions to simplify head seek operations

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 0021, which is available to download here: microcode_0021.rbf.

Microcode change log

Rev 0021 (2011-MAR-21)

  • Add "track 0 reached during seek" status bit.
  • Improve seek logic to prevent "over-stepping" (seeking to a track below Track 0).

Firmware

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

Change history

Version 001C (2011-FEB-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.

Identifying the firmware version your DiscFerret is running

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.

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.

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.