Let’s get straight to the answer first: Yes!
However, the operating system is not strictly necessary . The operating system takes up more resources of the microcontroller, such as FLASH and RAM, which indirectly increases the hardware cost. Even if the cost increases by 1 cent, for high-volume products, every minute is an engineer's salary. .
I have been developing microcontrollers for more than 10 years. Most of the products are actually programmed with bare metal, and relatively few use operating systems.
Of course, this is related to product functions. Generally, products with complex functions and demanding real-time requirements will use the operating system.
Currently, the most commonly used real-time operating systems are uC/OS-II, FreeRTOS, and rt-thread.
Below, I will briefly explain to you the advantages and disadvantages of the three systems. Please correct me if there is anything wrong!
1. uC/OS-II
uC/OS-II is a commercial real-time operating system developed by Micrium. Its kernel design is very stable and reliable. It pays more attention to the richness of scheduling algorithms and system services, and is suitable for applications that require higher real-time performance and stability.
The advantages and disadvantages of uC/OS-II are as follows:
Features:
Development friendly: lots of information.
Real-time performance: uC/OS-II can provide very fast interrupt response and task switching to ensure real-time performance of the system.
Portability: uC/OS-II can support a variety of different processor architectures, making applications easier to port to different hardware platforms.
Reliability: Because the kernel design of uC/OS-II is very stable and reliable, it is widely used in a variety of embedded systems.
Mature ecological environment : Since uC/OS-II has been released for a long time, its community and ecological environment are very mature and complete, and users can easily obtain documentation, examples and support.
shortcoming:
Commercial license fee: uC/OS-II is a commercial real-time operating system, and users need to purchase a commercial license to use it.
Resource occupation: uC/OS-II occupies a lot of microcontroller resources and requires large storage space and memory space.
In addition, developers can tailor it, which means you can modify the system code to customize it according to the functions of your product. The premise is that you have a thorough understanding of the system code. Otherwise, don't try it easily, otherwise it will be easy to dig a hole for yourself.
2. FreeRTOS
FreeRTOS is an open source real-time operating system with a high market share.
Features:
Commercial licensing fee: free for commercial use
Lightweight: The kernel of FreeRTOS is very small and suitable for resource-constrained microcontrollers.
Real-time performance: FreeRTOS can provide very fast interrupt response and task switching to ensure the real-time performance of the system.
Portability: FreeRTOS can support a variety of different processor architectures, making applications easier to port to different hardware platforms.
Community support: The FreeRTOS community is very active, and a large number of developers participate in development and maintenance, making the FreeRTOS ecological environment very complete.
Good documentation and materials: FreeRTOS has very rich documentation and materials, and it is relatively simple to learn and use FreeRTOS.
shortcoming:
Few components: Some functional components are not perfect enough, such as GUI (graphical interface), TCP/IP, and file systems that need to be expanded to third parties.
3. rt-thread
This is a domestic real-time operating system suitable for IoT products. It is characterized by extremely low resource usage (1.2KB RAM and 3KB Flash), and the code structure is more convenient for low-power functions.
advantage:
Lightweight: The core of RT-Thread is very small and suitable for resource-constrained microcontrollers.
Real-time performance: RT-Thread can provide very fast interrupt response and task switching to ensure the real-time performance of the system.
Tailorability: RT-Thread can select the required components as needed to reduce the resources occupied by the system.
Object-oriented: RT-Thread supports object-oriented programming, making the code clearer and easier to understand.
Cross-platform support: RT-Thread can support many different processor architectures.
shortcoming:
The ecosystem is relatively incomplete: Compared with some mature embedded operating systems, RT-Thread has a relatively small number of communities and developers, and the ecological environment is relatively incomplete.
The learning curve is steep: RT-Thread is a relatively new operating system with relatively few documents and information, and the learning curve is relatively steep.
Not suitable for large-scale systems: Since RT-Thread's kernel design is originally designed to be lightweight and real-time, it is not suitable for building large-scale embedded systems.
4. My own understanding of RTOS
Finally, let me talk about my understanding of these real-time operating systems.
I think a real-time operating system is essentially a program architecture with high real-time performance .
Real-time is to ensure that my task is executed within the specified time, which cannot be achieved using the traditional while(1) polling method.
The program architecture is like the foundation when building a house. Only when the foundation is stable can it cope with the impact of harsh external environments on the house, such as typhoons and earthquakes.
The same goes for when we write programs. The program architecture is the "foundation". Only when the foundation is stable can your program be able to cope with the sudden changes in functions and chip changes made by the project manager. Only then will your code be able to withstand the twists and turns and the product functions will be stable. .
Unfortunately, many engineers do not have the ability to write program architecture because the requirements for experience and coding level are strict.
Therefore, for generally complex projects, just use a ready-made, stable real-time operating system.
This can guarantee at least two things:
1. There is no problem with the program structure.
2. There is no problem with the real-time nature of the program.
However, there are disadvantages to using ready-made ones, that is, RTOS has many functions, many of which your product cannot use at all, but you have no choice and you don’t know how to tailor them, which will waste a lot of your microcontroller resources.
So in the past few years, when I was doing projects, I always used the program structure I wrote myself, and then the real-time nature of the program was avoided manually.
Previous article:What is the difference between FLASH and EEPROM during microcontroller development? How to choose?
Next article:Can a microcontroller achieve true multi-threading?
- Popular Resources
- Popular amplifiers
- ESP32 Formats and Communication Application of Communication Protocols with ESP32 Microcontroller
- Research report on overall technical requirements of vehicle control operating system
- Research report on the standardization requirements of vehicle computing platforms
- ZxOS Zephyr-based Guest Operating System for Heterogeneous ISA Machines
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- How to measure analog voltage using the ADC of MSP430?
- Analysis and application of key technologies of BLE low-power Bluetooth
- 求助Cortex_M4_IPU1_C0:Error connecting to the target:Device is held in reset.
- Power-saving Mode of ADI AD5933 Impedance Converter
- "New Concept Analog Circuit" - Signal Processing Circuit, Yang Jianguo's new book
- How to use the IP of Video On-Screen Display in zynq
- Review Weekly Report 20220516: Mil Allwinner Automotive-Grade CPU Development Board MYC-YT507, Award-winning Review is here
- [Silicon Labs BG22-EK4108A Bluetooth Development Evaluation] 2. Hardware Testing: Lighting and Code Explanation
- How to use the Smart Analog Combo in MSP430 MCUs
- [phyBOARD-i.MX 8M Plus Development Board] Part 3: Demo Program Compilation, Download and Run