Running patch from flash


#1

Normally the Axoloti runs the uploaded patch from the internal RAM, a large portion of which is reserved for this purpose. Even when 'Upload to internal flash' is selected in a patch, if I understand correctly it the patch is stored in flash, but runtime is executed RAM just as usual, i.e. the flash is just used for the actual storage.

I had an idea: how hard would it be to run the patch directly from flash. I.e. something along the lines of reserving an area of the flash for the executable patch, and flashing it there when uplaoding, and actually run it from there. The advantage would be that more (fast) RAM would be available for longer delay lines etc, if one doesn't want to use DRAM for whatever reason. The downside of course is that it takes longer write to the flash than write to RAM, and also writing to the flash causes wear on the flash, so it's probably not for everyday use.

The Axoloti very obviously can runtime write to the flash, as it can store a patch there, so it would mostly seem to be an adjustment of the linker control file for where things are stored, and also a portion of the flash must be reserved for the runtime patch and uploading a patch must cause a write to that area. Is there anything else I'm missing?


#2

I don't think that flash ram is fast enough to operate at 168MHz


#3

On the contrary, the STM32F4 is intended to run code directly from flash at its maximum clock rate, there's a special cache on the chip plus an extra wide flash memory bus to accomplish this. Another way of looking at it is that it's only the actual patch code that runs in RAM, the rest of the OS, for instance the interrupt routines which handle the D/A and A/D conversion, run in flash.

So I'm convinced the reason patches are run in RAM on the Axoloti is not for execution speed, but for quick upload and also to avoid wearing out the flash every time the 'Live' button is clicked in th UI.


#4

hehe i see where this comes from and where it tries to go :slight_smile: would be nice for the p6 indeed!!


#5

Yes, exactly... But I thought it might be useful too on a real Axoloti, if there is a need for a lot of RAM and DRAM turns out to be too slow.