cancel
Showing results for 
Search instead for 
Did you mean: 

FreeRTOS with a non FreeRTOS app

Claydonkey
Senior

This question is not very specific. It is quite open ended and is probably best posed to those at FreeRTOS support but I will ask here first as your support is excellent.

Having spent months developing a Project that is optimized to the best of my ability. no blocking calls, interrupts where appropriate (around 10 isrs) that does not use FreeRTOS + given my knowledge of FreeRTOS being minimal.

How should I go about merging 1 RTOS task that itself relies on other tasks/queues?

This primary RTOS task is 'tasked' with capturing a data stream using lwip>UDP Server>Wifi>SDIO. 

This stream needs to be polled/dequeued in the main loop.  (My basic understanding of FreeRTOS suggests this will be via FreeRTOS messaging, if indeed main loop needs to be converted into a FreeRTOS task)

So my question mainly concerns whether the main loop be converted into a FreeRTOS task and all underlying isrs managed via appropriate Mutexes/Semaphores?

If this should be the case (I would like to make the integration as easy (for me) as possible without involving too much rewriting -considering I will probably make alot of mistakes in FreeRTOS). A

Are there any suggestions on how best to proceed? Perhaps there is some documentation I could read or some examples showing migration?

Thanks for any support.

1 ACCEPTED SOLUTION

Accepted Solutions
hs2
Senior

Indeed your current main loop will be a task when migrating to FreeRTOS. Also it's probably reasonable to migrate also your ISR (handlers). You might add a separate ISR handler task which just post-processes the/all HW events (e.g using so called FreeRTOS task notifications) maybe at a higher prioritiy than your main control/managment task and/or the WiFi handler task. The HW event task in turn could communicate with the main task using it's input queue also fed by the WiFi task. Makes life easier to just have a single event/message signaling mechanism.
Note that there is also a pretty good and helpful FreeRTOS community: https://forums.freertos.org
And of course lots of docs https://www.freertos.org/RTOS.html and books https://www.freertos.org/Documentation/RTOS_book.html 😉

Good luck !

View solution in original post

2 REPLIES 2
hs2
Senior

Indeed your current main loop will be a task when migrating to FreeRTOS. Also it's probably reasonable to migrate also your ISR (handlers). You might add a separate ISR handler task which just post-processes the/all HW events (e.g using so called FreeRTOS task notifications) maybe at a higher prioritiy than your main control/managment task and/or the WiFi handler task. The HW event task in turn could communicate with the main task using it's input queue also fed by the WiFi task. Makes life easier to just have a single event/message signaling mechanism.
Note that there is also a pretty good and helpful FreeRTOS community: https://forums.freertos.org
And of course lots of docs https://www.freertos.org/RTOS.html and books https://www.freertos.org/Documentation/RTOS_book.html 😉

Good luck !

Great. Just the reply I hoped for. Thanks and have a great weekend