cancel
Showing results for 
Search instead for 
Did you mean: 

Is it really necessary a RTOS?

ennioaloisini
Associate III

Hi all,

I write to you because I would like to understand if it is really necessary to use an RTOS. I always develop projects with different ST processors (F4 and F7) without using RTOS. In those projects the F4/F7 processors communicate with many hardware components using SPI, I2C, RS232, GPIO and PWM. Now I need to increase the communication speed on the RS232, because I need do send few mega bytes of data every second and for that reason I need to integrate the USB with Full Speed or High Speed. Then in another new project I have to handle also a small OLED display. For all these reasons I'm thinking about the possibility to use Azure RTOS that seems well integrated with CubeMX, but I do not know which benefits I could obtain and if I could have some side effects both from performance point of view and also from developing time point of view.

In this situation is it really necessary a RTOS?

Which advantages and disadvantages could I have using a RTOS? 

Let me know!

Thank you very much for the support.

26 REPLIES 26

Okay, my question was not accurate enough, I actually meant Azure.

Some threads I have seen let me think it has some hardware / peripheral drivers integrated?

You seem to have gone from a very general question, "Is an RTOS really necessary?" to specific questions about the capabilities of a particular RTOS.

The general question has been answered - it's a "No" - so perhaps you should mark this thread as solved.

Then start a separate thread with the new, specific questions about Azure RTOS.

Maybe first review some of ST's material on the topic:

https://wiki.st.com/stm32mcu/wiki/Introduction_to_Azure_RTOS_with_STM32

https://www.st.com/content/st_com/en/campaigns/x-cube-azrtos-azure-rtos-stm32.html

https://www.youtube.com/watch?v=QQrMzRjo82Y

 

LCE
Principal

@Andrew Neil yeah, sorry for "thread-jacking".

I was just curious - I won't use any OS anytime soon.

But concerning the original question, the underlying "hardware drivers" if any, would surely help my decision if OS or not.

Hi all,

thank you very much for the valuable advices.

I am writing to you because I would like to understand how I can convert an existing program without Azure RTOS ThreadX with a program in which I use Azure RTOS ThreadX.
For example I would like to add Azure RTOS ThreadX on an existing program that reads a series of values ​​with GPIO, ADC, or by communicating with external components with SPI and I2C and sets digital signals with PWM and GPIO. It also communicates via the serial port with another board.
What should I do with CubeMX?
Do I take the existing project and add ThreadX in the "Middleware" section and change the timebase source for "SYS" from SysTick to TIM6 in the "System Core" section?
Do I need to make further changes in CubeMX?
At the code level I will have to use Threads, but how can I structure the program?
Currently the commands arrive on the serial port through the interrupt and I insert them into the relevant buffer which is read by a function present in the while(1) of the main. The readings of some digital and analog signals are made every few milliseconds and to do this I use interrupts. I would like to understand how I can structure the program. How can I organize at file level, today almost all the code is in the main.c file and I would like to understand with what logic I create the threads and assign them to the various activities (GPI readings, ADC readings, reading from external components with SPI and I2C, management of the serial buffer and related responses, writes to memory, etc.).

Let me know what rules I should follow to structure the code well.

Thank you very much for the support.

That's a new question - and quite a big one.

Please mark a solution for this thread, and then start a new thread with your new question.

Give a link here to the new thread, so that people can find it.

(you could also link back to this thread from the new one, if it helps for reference)

 

Maybe also start by reviewing the introductory Azure RTOS links in this earlier post:

https://community.st.com/t5/stm32-mcus-embedded-software/is-it-really-necessary-a-rtos/m-p/682342/highlight/true#M48348

 

SofLit
ST Employee

Hello,

I didn't read all the long conversation above but I can add these links:

https://www.beningo.com/how-to-choose-between-bare-metal-rtos-and-gpos/#

https://www.embeddedrelated.com/showarticle/1008.php

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Link to the new post about how to convert a project without RTOS into a project with Azure RTOS.

 

https://community.st.com/t5/stm32-mcus-embedded-software/how-to-transform-a-project-without-rtos-into-a-project-with/m-p/684515#M48466