[sdiy] "AVR synthesizer"

Ingo Debus debus at cityweb.de
Thu Feb 17 08:51:24 CET 2005


Am Mittwoch, 16.02.05 um 14:30 Uhr schrieb Rainer Buchty:

>>
>> so I can see that we may have to include some kind of 'boot loader' 
>> so that
>> as things develop people can update their chips (I forgot, the MEGA16 
>> also
>> allows self programming, hence MIDI-Sysex update should be possible, 
>> so in
>> fact 4 advantages over the older 8535).
>
> Ah, I'd like to see the MIDI-Sysex approach.

Some thoughts about user-updatable software:
IMHO under no circumstances it should be possible that the device is 
becoming useless by an incomplete or otherwise corrupted dump. On the 
Fizmo mailing list several people reported that their synth didn't work 
at all anymore after they attempted to load an updated version of the 
OS into it. So many things can go wrong with Sysex dumps, and after 
all, it's also not entirely impossible that an updated version has bugs 
and the used wants to revert to the original version.

So I think it's mandatory that a new version is buffered in a different 
memory location before the only existing original version in the device 
is overwritten.

In my projects I do it like this:
There's always a "basic" version in the device which also contains the 
code for the Sysex update feature. The device can be run with the basic 
version alone. The "updated" version always resides in a different 
memory location. It does not contain the code for the Sysex update 
feature. When a new "updated" version is to be loaded, the old 
"updated" version is overwritten, but not the basic version. Thus even 
when the upload goes wrong, the unit can stil be run with the basic 
version.
After power-up, the processor first decides which version to run. If 
the "updated version valid flag" is set it runs the updated version. 
OTOH. when the user wants to upload another updated version the basic 
version must be used, because otherwise the upload would certainly 
cause a crash, with the updated version being overwritten while 
running. So the user can force the basic version to be run, by pressing 
a button during power-up.
When the beginning of a version update is received, the first thing the 
processor does is clearing the "updated version valid flag" (in 
nonvolatile memory). Then it starts to overwrite the existing (if any) 
updated version. Only after the update is complete and valid (correct 
checksum) this flag is set again.

This is a bit wasteful with program memory, but I have plenty :-)

Ingo




More information about the Synth-diy mailing list