It's like I compile some C funtion to my library, send it to target (via usb), who will update/substitute DSP processing function to the new one saving in into the SRAM. C language recognise function as an address of its beginning, right? I would implement like two SRAM spaces for two functions I will switch between them every time new one is completely copied into memory.
Your plan certainly sounds plausible.
The STM32F4 series provides a 112KB SRAM1 area accessible by both the I-Bus, D-Bus and S-Bus, as well as DMA, Ethernet and OTG-USB.
You can typically specify the storage area of a particular section of code within the compiler/IDE toolset.
For example, using KEIL you simple right click on the source code file and assign an appropriate memory storage location for the resulting binary:
You will need to utilize either a standardized function prototype for all dynamic routines.
Or predefine several typedefs which act as function prototypes which you can then point to the specific entry point of the routines and utilize as function pointers.
The scheme would be essentially several function pointers which point to only two entry points, the proper function call chosen depending on the newly downloaded routine.
The new routine can then be downloaded via USB written into the SRAM at a predetermined entry point, it shouldn't be any serious issues dividing the SRAM1 area into two banks.
BigDog