[sdiy] FW: Simple MIDI Seq for firmware updates
Jerry Gray-Eskue
jerryge at cableone.net
Sat Mar 13 05:04:06 CET 2010
-----Original Message-----
From: Jerry Gray-Eskue [mailto:jerryge at cableone.net]
Sent: Friday, March 12, 2010 10:04 PM
To: MTG
Subject: RE: [sdiy] Simple MIDI Seq for firmware updates
Boot loaders are a bit tricky, you need to know the image is not corrupted
and need to be able to roll back to the original boot loader in the case of
a programming flaw, incomplete program update, memory corruption etc. A
simple way to do this using a protected (hardware write protection is best)
boot loader that is always in place, the system starts the boot loader runs
a checksum on the image and looks for an abort load signal of some sort. The
abort signal can be a jumper or other message. If there is no abort signal
received the loader executes the program.
Now using MIDI System Exclusives is not hard, and its function is open
ended.
To send a program update you could sent the System Exclusive byte followed
by a program image block, the catch is all the image data must have the MSB
set to 0, in effect you are working with 7 bit data. For simplicity of
coding and debugging I would suggest sending the image one nibble at a
time - in binary 0000xxxx. These nibbles can be easily spliced back together
on the receiving end. Follow the image block with the EOX byte.
For the handshake your target system can Send a System Exclusive message
block of its own. A MIDI receiver is also allowed to act as a MIDI
transmitter.
I would be good to checksum each image block and have the responding System
Exclusive indicate that the check sum was good or bad (failed).
For each failed transfer you just resend the same block.
It would also be good to have a checksum embedded in the program image so
the boot loader can do a final check before executing the loaded program.
This also allows the boot loader to check the image on each system reset as
noted above.
- Jerry
-----Original Message-----
From: synth-diy-bounces at dropmix.xs4all.nl
[mailto:synth-diy-bounces at dropmix.xs4all.nl]On Behalf Of MTG
Sent: Friday, March 12, 2010 5:09 PM
To: Synth-diy at dropmix.xs4all.nl
Subject: [sdiy] Simple MIDI Seq for firmware updates
I'm working on a bootloader of sorts to allow me to update the firmware of a
new MIDI device. Because of the CPU architecture and memory constraints I
have to send realtively small blocks. I've done this before over RS232 with
my own "updater" but not over MIDI. My own updater worked by loading the
whole firmware image into PC memory then sending the blocks over one-by-one.
So my choices are to learn the MIDI API and write my own "updater" program
or look at how other people do it. It seems that .MID files are popular when
you can't send the whole firmware over in one chunk. I don't see how I can
do the individual blocks with SysEx (E.g. MIDI-OX) because there would
probably be a handshake of sorts after each block. So can anyone recommend a
SIMPLE sequencer that allows me to see the MIDI file data at a level that
would allow me to understand how to create my own .MID files for the purpose
of firmware updating?
Or am I missing something really obvious?
GB
_______________________________________________
Synth-diy mailing list
Synth-diy at dropmix.xs4all.nl
http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
More information about the Synth-diy
mailing list