[sdiy] Executing guest synthesizer code on stm32f4

Roman Sowa modular at go2.pl
Fri Jan 2 12:09:13 CET 2015


This was already mentioned in another words so far, so I'll just chip in 
with a little analogy to good old DOS. Every (almost?) I/O operations 
was done via software interupts, like INT 15 for example.  That could be 
also done by simple indirect CALL. Every INT points to index table that 
is located at RAM address starting from 0, and each int has its own 
location. Index table is written by OS at startup, so even if OS gets 
upgraded, the user program still calls the same index, even if actual 
subroutine is at different address now.
Before execution, user program loads a few registers or a stack with 
input values, calls the software INT. Results are also stored in 
registers or stack.
Then you provide a list with all available calls and required parameters.

Roman
doing that with 80186 back in 1990's


W dniu 2014-12-30 o 17:16, nvawter pisze:
>
> 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:
> http://www.reddit.com/r/stm32f4/comments/2qtnsx/how_would_i_do_this_upload_blocks_of_binary_code/
>
> _______________________________________________
> 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