Is there any ported RTOS for STM32F407VE?

Post Reply
xtream123
Posts: 19
Joined: Thu Dec 19, 2019 1:23 am

Is there any ported RTOS for STM32F407VE?

Post by xtream123 »

Hi there guys,
Is there any available or ported RTOS for STM32F407VE using stevstrong's core?
Thank you. :)

stevestrong
Posts: 34
Joined: Fri Dec 27, 2019 4:53 pm

Re: Is there any ported RTOS for STM32F407VE?

Post by stevestrong »

I am not aware of any RTOS port for my core.
And me, I do not plan to do it.

xtream123
Posts: 19
Joined: Thu Dec 19, 2019 1:23 am

Re: Is there any ported RTOS for STM32F407VE?

Post by xtream123 »

oh..I see, thanks, maybe time can tell.

Why you do not have a plan?is it hard to port an RTOS?

ag123
Posts: 227
Joined: Thu Dec 19, 2019 5:30 am

Re: Is there any ported RTOS for STM32F407VE?

Post by ag123 »

you may want to take a look at this one
an event loop developed on maple mini
https://github.com/ag88/stm32duino-eventloop
but the codes are not specific to the mcu

note that this isn't the only one and neither is it a good let alone best one, there are plenty more implementations and examples which are probably better
https://www.google.com/search?q=event+loop+arduino

an event loop is a 'glorified' version of this,

Code: Select all

loop() {
  task1();
  task2();
  task3();
}
or more correctly 'co-operative multi-tasking', so each task() should not hog and wait for things, instead use global variables to keep state and let go the time slice and return from the function.

the difference between an event loop vs the above simple 'scheduler' is it works more like a node-js event loop
https://www.tutorialspoint.com/nodejs/n ... t_loop.htm
i place events in a queue and send them to tasks so each task has to evaluate if it should process an event.
does it work? well the whole 'windowing' system world works nearly based on this concept, so do node js, javascript etc.

why event loop? for RTOS, it needs to allocate memory to each vtask, hence, this fragments the already very limited memory and you would soon run out of memory. using an event loop, lets you do 'co-operative' multitasking and you can 'send events' between tasks (e.g. task1 check button presses, post the event, another task check the queue and process the event (if needed). 'dynamic' memory is basically your local variables (placed on the stack) and that gets unwound when each function (task) returns.
- not real time, but the event loop has a hidden surprising result of keeping everything in a queue (actually a circular buffer), so your events happen one after another in sequence. it got rid of a lot of synchronization pains, if you put every thing on a queue, there is no need to synchronize, every thing happen one after another as the event loop dispatches events to the tasks one after another.
what about real time? the interrupt request handlers take care of that, anything that needs 'real time' goes into the isr or hardware

the other benefit of an event loop is each task() is a regular c function or c++ method. so you can call it from anywhere with little concerns.
Last edited by ag123 on Fri Feb 14, 2020 3:32 pm, edited 2 times in total.

ag123
Posts: 227
Joined: Thu Dec 19, 2019 5:30 am

Re: Is there any ported RTOS for STM32F407VE?

Post by ag123 »

but seriously even an event loop may be deemed superfluous, if ray reads this thread, he'd probably agree ;)
many other things has been done without needing an event loop

Demonstration code for several things at the same time
https://forum.arduino.cc/index.php?topic=223286.0
Multi-tasking the Arduino - Part 1
https://learn.adafruit.com/multi-taskin ... ino-part-1

stevestrong
Posts: 34
Joined: Fri Dec 27, 2019 4:53 pm

Re: Is there any ported RTOS for STM32F407VE?

Post by stevestrong »

xtream123 wrote:
Fri Feb 14, 2020 1:26 pm
Why you do not have a plan?is it hard to port an RTOS?
I don't know how hard is it to port.
But I will not do it because I don't need it.
Why do you need it?

For easily managing timings I lately used this simple tasker: https://github.com/joysfera/arduino-tasker

Post Reply

Return to “STM32F4 based boards”