[sdiy] Executing guest synthesizer code on stm32f4

nvawter nvawter at media.mit.edu
Tue Dec 30 17:16:52 CET 2014

Hello All!

I made a nice instrument based on the stm32f4 and I want people to be 
able to upload their own synth code into it via microphone.  Has anyone 
got any suggestions for how to do this?

I think in theory the idea is to reserve some space in the linker file 
for the "guest code" (plug-in).  Then, use the main program to listen to 
the microphone, demodulate into the binary, then write the guest binary 
block into flash memory.  Then, have the main program call the guest 
code, leaving all of the sensor variables (such as control voltage, knob 
inputs, patch select knob, etc.) in a magic place, have the synth code 
execute, return a block of data, and have the main program write that to 
the DAC.

Questions I'm having are: how does the guest code know what ram 
locations are available?  Should I statically allocate some RAM for the 
main program and some for the guest program?  How do I use labels in the 
code to jump back and forth between funcions?  E.g. if I write a 
"CV_to_pitch()" function and keep it in the main program, and I want the 
guest code to use that function.  Should I make an intermediate table of 
where those functions are in the flash code, for when they move around, 
creating my own linker in effect?

Has anyone ever done this before?  Are there any reference examples like 
this around?  If anyone has any suggestions/tips/ideas, etc, please let 
me know.

Also, I reached out to the stm32f4 subreddit with the same question, if 
anyone would like to respond there, or read the same request for help 
with different working:

More information about the Synth-diy mailing list