Bootloader test

Discussions related to MegaDrum Hardware

Bootloader test

Postby dmitri » Fri Feb 01, 2008 12:53 am

Here is the bootloader for Atmega32 to test:
see latest version down the thread

Fuses must be set so that Bootblock size is 1024 words and Atmega32 jumps to Bootblock on reset. In PonyProg it looks like this:
I made a mistake when taking this screenshot. BootLock11 MUST be checked to prevent the bootloader from overwriting itself accidentally
bootloader_fuses.png


A MegaDrum firmware file must be modified slightly: three bytes, 0xF0 0x7F 0x40, must be prepended and one byte, 0xF7, must be appended and rename the *.hex file to *.syx, e.g. see this file:
megadrum32_16_32_20080130_2.syx


Now you can upload this file using MIDI-OX. But before doing this you MUST set 'Low Level Output Buffers' to at least 60000 (in MIDI-OX menu go Options->Configure Buffers and set Output, NOT Input, Buffers to 60000).

After you programmed the bootloader into Atmega32, reset MegaDrum while holding the key LEFT. It'll ask you to press the key DOWN. If you changed you mind you can reset MegaDrum again without holding any keys and it will boot an old firmware. If you press the key DOWN, it'll erase the old firmware and will wait for the Sysex with a new firmware. Now in MIDI-OX go to Actions->Send->SysEx File... and choose the firmware *.syx file you've prepared beforehand. The update will take around 5 seconds and after it's finished MegaDrum will reset itself and boot the new firmware.

I tested it with 16MHz version and it appears to work fine.
You do not have the required permissions to view the files attached to this post.
dmitri
Site Admin
 
Posts: 8706
Joined: Fri Aug 03, 2007 8:05 pm

Re: Bootloader test

Postby dmitri » Fri Feb 01, 2008 1:17 am

And I forgot. Here is the source code of the MegaDrum MIDI SysEx bootloader.
It is based on ATMEL AVR UART Bootloader for AVR-GCC/avr-libc. See readme.txt
in the archive.
BootloaderSysex.zip
You do not have the required permissions to view the files attached to this post.
dmitri
Site Admin
 
Posts: 8706
Joined: Fri Aug 03, 2007 8:05 pm

Re: Bootloader test

Postby Synthex » Fri Feb 01, 2008 5:54 pm

Great !
I'll test it this night
Synthex
 
Posts: 1471
Joined: Fri Oct 12, 2007 6:06 am
Location: France

Re: Bootloader test

Postby dmitri » Fri Feb 01, 2008 8:12 pm

Don't know why yet but I haven't manage to upload firmware into MegaDrum with FTDI232 USB board and Serial2MIDI Kawai driver although it works fine with PIC18F2550 USB MIDI board.
dmitri
Site Admin
 
Posts: 8706
Joined: Fri Aug 03, 2007 8:05 pm

Re: Bootloader test

Postby Synthex » Fri Feb 01, 2008 9:10 pm

PIC18F2550 USB MIDI board is the best ... ;) ... :P
Synthex
 
Posts: 1471
Joined: Fri Oct 12, 2007 6:06 am
Location: France

Re: Bootloader test

Postby Synthex » Sun Feb 10, 2008 1:26 am

Bootloader works well. :)
I tested it with 20MHz version.

But after sending the sysex firmware, MegaDrum will not reset itself.
I must switch off and switch on to boot the new firmware ...
Synthex
 
Posts: 1471
Joined: Fri Oct 12, 2007 6:06 am
Location: France

Re: Bootloader test

Postby Synthex » Sun Feb 10, 2008 1:34 am

Another problem :
Reset MegaDrum while holding the key LEFT do nothing the second time ...
Synthex
 
Posts: 1471
Joined: Fri Oct 12, 2007 6:06 am
Location: France

Re: Bootloader test

Postby dmitri » Sun Feb 10, 2008 10:21 am

Did you change fuses?
dmitri
Site Admin
 
Posts: 8706
Joined: Fri Aug 03, 2007 8:05 pm

Re: Bootloader test

Postby Synthex » Sun Feb 10, 2008 5:18 pm

dmitri wrote:Did you change fuses?

Yes.
Reset MegaDrum while holding the key LEFT do nothing the second time ...
Synthex
 
Posts: 1471
Joined: Fri Oct 12, 2007 6:06 am
Location: France

Re: Bootloader test

Postby dmitri » Sun Feb 10, 2008 10:18 pm

Can you post the screenshot of the fuses settings in PonyProg and a dump of the flash memory?
dmitri
Site Admin
 
Posts: 8706
Joined: Fri Aug 03, 2007 8:05 pm

Next

Return to MegaDrum Hardware

Who is online

Users browsing this forum: Google [Bot] and 46 guests