[sdiy] New cute "Microcontrollers" - STM32U with integrated GPU for UIs (+math accel + analog stuff)

brianw brianw at audiobanshee.com
Sat Mar 4 11:46:36 CET 2023


Yes, there's nothing wrong with an RTOS. Usually, it's just adding threads to a bare metal firmware.

Some companies have multiple options for RTOS, each with different overhead. This can be important because the context switch between threads can be orders of magnitude greater than the overhead of a straight interrupt handler. I once designed an LED controller with 512 brightness levels using 9 interrupts, but the shortest interrupt interval was fewer cycles than the RTOS thread switch overhead, so the interrupt had to be taken out of the RTOS scheduler and handled directly - behind the back of the RTOS.

Sometimes, though, just using interrupts for the peripherals that have them, and DMA for the operations that can work with DMA, you end up with what is effectively a multi-threaded design. There's only main "thread" running, and then interrupts handling various individual tasks, each of which can hopefully be handled without a lot of overhead. There never needs to be any thread switching if all "threads" can be handled by interrupts.

On some systems like PIC, I've actually written the interrupt "threads" in assembly, to reduce the instruction cycle counts to the bare minimum (compared to what the C Compiler might produce). On the other hand, I've also learned that careful code design can reduce the number of instructions produced by the compiler, at least for a processor where the vendor has smartly optimized the compiler for their instruction set.

Has anyone considered designing with a full DSP? ... like the SHARC or TMS320? I noticed that the Dave Smith Instruments Evolver had a tiny, 16-bit SHARC that could just barely manage to handle 24-bit audio. Despite being pushed to its limits, it was probably still more efficient than the typical ARM processor.

Brian


On Mar 4, 2023, at 2:23 AM, Steve wrote:
> 
> Mike Bryant:
>>  brian wrote
>> Personally, I prefer to avoid operating systems and to avoid the ARM A series. 
>> 
>> I also avoid OSes, but I use bare metal on a Raspberry CM4 in the latest incarnation of my additive polysynth.  Amazing how much having gigabytes of memory and the capability of almost a thousand sinewaves frees up some of the compromises one has to make with a smaller processor :-)
> 
> Whoa! Looking into that (but using a modest Pi Zero) I have had on my todo list for a whlie...
> How much pain is it to get into bare metal development on that thing, compared to STM32 or PIC?
> Indeed the decadent amount of RAM, and the prospect of pairing that with low-latency, kinda makes me drool, LOL.
> 
> I personally would not hesitate to actually use FreeRTOS on a thing like that, e.g. the UI and file operations and stuff like that, well, why not.
> Have used FreeRTOS on some STM32L476 or so in the past where there really was a benefit of running stuff in several threads, and using everything in ISR mode like some people do seems a bit whacky when the processor has HW support for threads (e.g. helping with context switches).




More information about the Synth-diy mailing list