Updating firmware with protected bootloader.

Discussions related to MegaDrum Hardware

Updating firmware with protected bootloader.

Postby dmitri » Tue Jun 01, 2010 10:19 pm

This procedure describes how to load an encrypted MegaDrum firmware over MIDI or USB.

To use this procedure a couple of pre-requisite must be met.
1. MegaDrum must be programmed with the protected bootloader.
2. The procedure must be done on a Windows PC or Mac OS X.

Here is description of the procedure
1. Download and unzip the firmware update utility called mdfwupdate.
(Updated on 23/12/2011 to add Mac OS X version).
mdfwupdate.zip

2. Download the latest encrypted MegaDrum firmware and choose a file matching your MegaDrum version, e.g. for MegaDrum on Atmega644 the file will be called megadrum644_20111213.bin where 20111213 is firmware version date.
3. Power MegaDrum up while holding the key LEFT pressed. If you connect over USB and it is the first time you connect your MegaDrum to your PC, let Windows install drivers. While keeping the key LEFT pressed the MIDI LED will be blinking indicating that it is entering the bootloader mode. When you release the key LEFT the LCD will show (on Atmega based MegaDrum):
Code: Select all
FwSUpdater 16MHz
DOWN-ok.UP-clock

or (on ARM based MegaDrum):
Code: Select all
FwSUpdaterSTM32b
StartUpdateOnPC

4. From a command line run the utility, e.g. on Windows:
Code: Select all
mdfwupdate.exe megadrum644_20111213.bin

On Mac OS X;
Code: Select all
./mdfwupdate megadrum644_20111213.bin

5. First it will prompt you to choose which MIDI output port to use. Type a number corresponding to the MegaDrum MIDI port and press Enter. It will now prompt you to choose which MIDI input port to use. Type a number corresponding to the MegaDrum MIDI port (don't press Enter yet).
6. Skip this step on an ARM based MegaDrum. In MegaDrum select correct frequency for your Atmega crystal by pressing the key UP. Each time you press UP it will cycle one step through 16MHz-20MHz-24MHz-12MHz. If you use a 16MHz crystal for Atmega, you don't need to press UP since 16MHz is a default start up frequency for the bootloader.
7. Skip this step on an ARM based MegaDrum. In MegaDrum press the key DOWN. It will display 'StartUpdateOnPC'.
8. On the PC press Enter. Note, on Mac OS X this must be done within 1 second after step 7 otherwise MegaDrum bootloader will reset itself.
9. It will now start updating the firmware and after a couple of minutes it will finish. While doing the update it will show progress on the command line and on the LCD. On the LCD it will look like this:
Code: Select all
88886>ater 16MHz
StartUpdateOnPC

10. When update has finished, the utility will show
Code: Select all
Transferring.. 100% done.
MegaDrum updated successfully.

and MegaDrum will reboot and will start with new firmware.

This is a screenshot of the whole procedure on the command line:
mdfwupdate.png
You do not have the required permissions to view the files attached to this post.
dmitri
Site Admin
 
Posts: 8709
Joined: Fri Aug 03, 2007 8:05 pm

Re: Updating firmware with protected bootloader.

Postby Firelord » Wed Jun 02, 2010 9:15 pm

This front-end was superseded by MDUpdate.

Just a quick follow-up to my previous attempt of making firmware selection easier for this new utility.

mdfu.png


Download (~ 111 KB)
(current version 1.1)

Updated to version 1.1 (15.06.2010):
- Removed redundant 'UPDATE' button, the update utility will now be launched as soon as a firmware file is selected.

Some things to consider:
- It only runs on Windows and requires .NET 2.0;
- It ships with the mdfwupdate.exe utility built-in, i.e. it will be extracted on first run if not already present in the GUI folder.
You do not have the required permissions to view the files attached to this post.
Last edited by Firelord on Mon Jun 21, 2010 4:05 pm, edited 1 time in total.
Firelord
 
Posts: 666
Joined: Wed Jun 10, 2009 7:50 pm
Location: Estonia

Re: Updating firmware with protected bootloader.

Postby Firelord » Tue Jun 15, 2010 8:55 pm

I also recorded a video of the updating process (following the MIDI-OX video). It can be viewed here:

http://www.youtube.com/watch?v=Y8M3KIRuPWQ
Firelord
 
Posts: 666
Joined: Wed Jun 10, 2009 7:50 pm
Location: Estonia

Re: Updating firmware with protected bootloader.

Postby rockdude » Thu Jun 17, 2010 5:00 am

Firelord wrote:I also recorded a video of the updating process (following the MIDI-OX video). It can be viewed here:

http://www.youtube.com/watch?v=Y8M3KIRuPWQ


Excellent video Firelord! Much appreciated. Videos like this will make things very clear.
rockdude
 
Posts: 276
Joined: Wed Sep 02, 2009 7:18 am

Re: Updating firmware with protected bootloader.

Postby davem » Fri Jun 18, 2010 6:43 pm

Hi dmitri,

I've not been around for a while, and missed the encrypted bootloader stuff. Is there any kind of timeframe on a Mac version of this software? I don't own or have access to a Windows PC and run entirely on Mac software, MCT and all. If you need assistance I can provide it but I'm aware that you probably don't want to divulge information for the system you're using.
davem
 
Posts: 71
Joined: Sun Jun 14, 2009 9:51 pm

Re: Updating firmware with protected bootloader.

Postby dmitri » Fri Jun 18, 2010 7:00 pm

This is a test java version (source code):
BootloaderJavaUpdateConsole.zip


It works on Windows if sysex message length is limited to 22, using MidiSupport.writeMid(), or using 1 byte sysex messages, MidiSupport.writeShort(), but fails if using MidiSupport.write(). Haven't had time yet to figure out why.
Tested it on Mac as well using mmj and seems to work (as watched by MIDI Monitor) but I tested it only with virtual ports so don't know if it'll work with a real MegaDrum connected.
You do not have the required permissions to view the files attached to this post.
dmitri
Site Admin
 
Posts: 8709
Joined: Fri Aug 03, 2007 8:05 pm

Re: Updating firmware with protected bootloader.

Postby Firelord » Fri Jun 18, 2010 9:35 pm

Any chance of getting the c/c++ source code for the utility?
Firelord
 
Posts: 666
Joined: Wed Jun 10, 2009 7:50 pm
Location: Estonia

Re: Updating firmware with protected bootloader.

Postby pfhor » Fri Jun 18, 2010 9:43 pm

+1 on releasing source, would only be beneficial to have the community contribute to it. :)
pfhor
 
Posts: 32
Joined: Sun Nov 22, 2009 8:55 pm
Location: Norway

Re: Updating firmware with protected bootloader.

Postby dmitri » Fri Jun 18, 2010 10:17 pm

c++ source code:
mdfwupdate_source.zip


On Windows with MinGW can be compiled as:
Code: Select all
g++ -D__WINDOWS_MM__ -Wall -o mdfwupdate.exe update.cpp RtMidi.cpp -lwinmm

On Mac OS X can be compiled as:
Code: Select all
g++ -D__MACOSX_CORE__ -Wall -o mdfwupdate update.cpp RtMidi.cpp -framework CoreMidi -framework CoreAudio -framework CoreFoundation

On Linux can be compiled as:
Code: Select all
g++ -D__LINUX_ALSASEQ__ -Wall -o mdfwupdate update.cpp RtMidi.cpp -lasound -lpthread
You do not have the required permissions to view the files attached to this post.
dmitri
Site Admin
 
Posts: 8709
Joined: Fri Aug 03, 2007 8:05 pm

Re: Updating firmware with protected bootloader.

Postby davem » Sat Jun 19, 2010 2:19 am

Much appreciated dmitri. I will make a simple OS X GUI wrapper for the program, if you'd like.
davem
 
Posts: 71
Joined: Sun Jun 14, 2009 9:51 pm

Next

Return to MegaDrum Hardware

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 75 guests