How To Flash the Midifighter with New Firmware

How To Flash the Midifighter with New Firmware

How To Flash the Midifighter with New Firmware
20100220: created by Fatlimey
20100524: added Mac instructions

The Midifighter uses a DFU (Device Firmware Update) style bootloader that allows
the chip, once put into “bootloader mode”, to receive new programs and settings
over the USB connection. Any tool that supports the DFU command set can be
used to flash a new program to the Midifighter over USB.

To drop your Midifighter into Bootloader Mode, plug in the USB cable while
holding down the four corner keys:

# . . #
. . . .
. . . .
# . . #

Continue to hold the four corner keys until bootloader mode is reached, this will take about 2 seconds, the Midifighter will show a checkerboard pattern to indicate that it is ready to accept DFU commands:

* . * .
. * . *
* . * .
. * . *

An alternative method is to solder two microswitches to the spaces
available at the top-left of the PCB. Pressing the Reset button will act
as if the USB cable was removed then connected again, while holding
down both buttons will immediately drop the device into Bootloader
Mode without the need to hold down the 4-corners key pattern. If you
think you are going to be doing a lot of programming with the Midifighter
I would highly recommend adding these switches, simply for the
convenience factor.

Putting the Midifighter into bootloader mode causes it to disconnect from
USB and reconnect as a different kind of USB device (i.e. not a MIDI class
device), and on some systems this device type requires the installation of a
driver before the reflashing software will recognize the bootloader
device. Setting up this driver is a one-time installation that is only
required of you wish to reflash your Midifighter.

The EEPROMs inside the chip are designed to be programmable for several
thousand cycles, a number of flashes that would take heavy amounts of
development time and testing. It’s just worth knowing that there is a limit
and that one day, a long, long time in the future, with enough reflashes the
chip may break.

1. PC using Atmel Flip

Using the program “Flip” from Atmel.

http://atmel.com/dyn/products/tools_card_mcu.asp?tool_id=3886

At the end of installation, you must select the option to read the README file:

file:///C:/Program%20Files/Atmel/Flip%203.4.1/info/Readme.html

as it contains instructions for installing the USB driver for the DFU
device. This driver allows connection to the DFU bootloader so that a
program can be uploaded. It’s a normal driver install involving:

  • Go to the device manager.
  • Find the AT90USB162 device in the “Jungo” section.
  • Right-click and select “Update Driver…”.
  • Select “Install from a specific location”.
  • Select “Include this location in the search” and specify the driver
    location, which by default would be “C:/Program Files/Atmel/Flip 3.4.1/usb”
  • Select “Finish” to finally install the driver.
  • The device should appear in the “LibUSB-Win32 Devices” section.

Once installed, Flip is simple to use.

  1. Select the chip that is to be programmed. Use the “chip” icon,the menu
    item “Device/Select…” or press Ctrl-S. Select the option:

AT90USB162

This will tell the program what start address and size to use for
program uploads.

  1. With the Midifighter connected and in Bootloader Mode, connect to the
    device by pressing the “usb cable” icon and selecting “USB”, or by
    pressing Ctrl-U. Then select “Open” to connect to the Midifighter.

(TIP: If you are going to be doing software development on the
Midifighter, and uploading fresh firmware often, it’s useful to
select the option:

“Settings/Preferences/Connecting-Closing/Auto-Connect”

This will save you from having to hit Ctrl-U to connect over USB
before each firmware upload.)

  1. Load a “.hex” firmware file using the “File/Load Hex File…” option,
    or by hitting Ctrl-L, and navigating to the hex file and hitting “OK”.

  2. Select the programming steps “Erase”, “Program” and “Verify”. This
    will cause the old program data to be removed, the new data to be
    written and then read back to verify that it was successfully uploaded
    to the device. (“Blank Check” is used to verify that the erase
    operation completed successfully and is mainly used to verify that a
    chip is bad.)

  3. Hit the “Run” button to execute the reprogramming.

  4. Restart the Midifighter using the “Start Application” button, making
    sure the “reset” option is selected, or just unplug and replug the USB
    cable. The Midifighter should reset and act as if it has just been
    plugged in. Depending on the purpose of the new firmware you may
    notice no immediate difference, and if the EEPROM version has been
    incremented you may have lost your persistent settings or you may in
    rare situations encounter the “first boot hardware test”. Read the
    firmware release notes for more information on the exact behavior to
    expect.

Note: If you have issues getting FLIP to either run or connect to the MF please try copying the contents of “C:/Program Files/Atmel/Flip 3.4.1/usb” into “C:/Program Files/Atmel/Flip 3.4.1/bin” and copy atlibusbdfu.dll from the bin folder into you windows folder.

2. PC using the command line.

If you are developing software for the Midifighter, it’s sometimes useful to
be able to automate the reflashing process. Atmel Flip comes with a
command-line application for this called “batchisp.exe”, and it can be found in
the same directory as the “flip.exe” binary.

The simplest way to access this program is to add the directory containing
the Flip binaries to the $PATH environment variable. For example, if you
have installed Flip version 3.4.1, the path can be appended using:

> set PATH = %PATH%;"C:\Program Files\Atmel\Flip 3.4.1\bin"

Reprogramming and rebooting a chip takes three calls of the program. To
reflash the Midifighter with a firmware file called “myhexfile.hex” you
would issue these three commands:

> batchisp -hardware usb -device at90usb162 -operation memory EEPROM erase
> batchisp -hardware usb -device at90usb162 \
-operation memory EEPROM loadbuffer myhexfile.hex program
> batchisp -hardware usb -device at90usb162 -operation start reset 0

3. Mac
(Thanks to SarahEmm)

You will need to download the latest “.hex” firmware from the Midifighter sourceforge site:

Then your steps are:

  • Ensure you have the Apple Developer Tools installed (they come on a CD/DVD with new macs/new OSes)

  • Install MacPorts. An installer can be found at The MacPorts Project -- Download & Installation.

  • Open a Terminal window (found under /Applications/Utilities/Terminal) to get a command line.

  • At the command line, run

sudo /opt/local/bin/port install dfu-programmer

to build and install dfu-programmer and dependencies.

  • Hold down the four corner buttons on your Midifighter and plug in the USB cable.

  • At the command line, run

dfu-programmer at90usb162 erase &&
dfu-programmer at90usb162 flash --debug 1 midifighter.hex &&
dfu-programmer at90usb162 reset

(without the linebreaks, where midifighter.hex is the name of the new firmware file to be programmed).

  • Unplug and re-plug your Midifighter to start running the new firmware.

4. Linux

Coming soon

whats new in this firmware?

You need the new firmware before wiring the extra controls in right?

The 2010-01-18 firmware has a patch that enables the analog inputs to function correctly:

Digital inputs need a pull-up resistor for now until I can enable the internal resistor inside the chip.

Just flashed the firmware in & breadboard tested a knob a few days ago. Knob worked perfectly. Fatlimey, thou art a frakkin’ genius! Many thanx.

All part of the service.

Hi limey there are a couple spammers around you may wanna slap mate :stuck_out_tongue:

plz help, im trying to flash my midifighter

i was following the PC instructions and i installed FLIP, but am stuck now i cant find jungo or update the usb DFU thing.
and if i try to connect to usb using flip i get an error asking for atlibusbdfu.dll
i tried to download sum kind of jungo thing, but all i could get is sumthing called WinDriver

i also tried the mac instructions and installed macports and dev tools.
after doing the whole " sudo /opt/local/bin/port install dfu-programmer " thing and typing my password i get another error . .

sussed it by copying the contents of “C:/Program Files/Atmel/Flip 3.4.1/usb” into “C:/Program Files/Atmel/Flip 3.4.1/bin” and copied the atlibusbdfu.dll from the bin folder into the windows folder. . .

then was able to continue the steps without error

signed driver for flip

I needed a signed driver for flip on windows 7 64bit.

here is a link: http://www.avrfreaks.net/index.php?module=Freaks%20Files&func=viewFile&id=3842&showinfo=1

i need a signed driver for my vista install also

would that link work pencap?

once unzipped how exactly do i install this?

iv gotten to the part where i need to update my drivers in the device manager but it doesnt want to let me with unsigned drivers.

midifighters died a couple days ago =(

edit:
ok forget all that just copy the new .dll and stuff into ‘atmel/usb’. also doesnt really have to be in checkerboard pattern to flash. totally got it working -cheers-

good idea!!!

why dose any boddy make a “How to Flash the Midifighter” Video, a super great Article to the Video and Post this to the Dj Tech Tools Home Site ?

Is this not Easyer for all Midifighters user?:slight_smile:

im so lost this whole flashing thing scares the shit outta me to be honest and im stuck at #1 for macs: “Ensure you have the Apple Developer Tools installed (they come on a CD/DVD with new macs/new OSes)”

i got my mac as a handy down with no cds :confused:

I got them for free on their website.

a video on how to would be great
it would make alot of sense to make one, why make a video of the vci firmware update and not your brand controller with your name on it?

D-Step - Have you managed to flash it yet? I’ve just flashed mine using OSX and can help !

Maybe I should make that vid …

My buddy wants to build a midi controller using an arduino and we were wondering if this firmware could be flashed on to other boards or PCB?

notshy-i havnt figured it out yet :rage: a video would be great!

Maybe one for the weekend !

Where are you stuck? Do you have Developer Tools and Mac Ports installed?

I rebuild the MF and created my own PCB. Now, if i plug in my MF with the AVR to flash the Firmware first time, I got the “Unknown Device” Message. It’s an AT90USB162 with the original Bootloader. I tried everything, Flip, the singend Drivers from Flip for Windows 7 x64, but my PC won’t communicate with the MF.

Can anybody help me?

(Sorry for my bad english, i’m german)

Greets