Page 1 of 8

Bootloader test

PostPosted: Fri Feb 01, 2008 12:53 am
by dmitri
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.

Re: Bootloader test

PostPosted: Fri Feb 01, 2008 1:17 am
by dmitri
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

Re: Bootloader test

PostPosted: Fri Feb 01, 2008 5:54 pm
by Synthex
Great !
I'll test it this night

Re: Bootloader test

PostPosted: Fri Feb 01, 2008 8:12 pm
by dmitri
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.

Re: Bootloader test

PostPosted: Fri Feb 01, 2008 9:10 pm
by Synthex
PIC18F2550 USB MIDI board is the best ... ;) ... :P

Re: Bootloader test

PostPosted: Sun Feb 10, 2008 1:26 am
by Synthex
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 ...

Re: Bootloader test

PostPosted: Sun Feb 10, 2008 1:34 am
by Synthex
Another problem :
Reset MegaDrum while holding the key LEFT do nothing the second time ...

Re: Bootloader test

PostPosted: Sun Feb 10, 2008 10:21 am
by dmitri
Did you change fuses?

Re: Bootloader test

PostPosted: Sun Feb 10, 2008 5:18 pm
by Synthex
dmitri wrote:Did you change fuses?

Yes.
Reset MegaDrum while holding the key LEFT do nothing the second time ...

Re: Bootloader test

PostPosted: Sun Feb 10, 2008 10:18 pm
by dmitri
Can you post the screenshot of the fuses settings in PonyProg and a dump of the flash memory?