Learning FreeRTOS Code (Part Four)

Learning FreeRTOS Code (Part Four)

•STM32 Cube Software Package Code Structure ARM has added a middleware layer, CMSIS_RTOS/cmsis_os.c, to ensure compatibility with various operating systems. Taking the STM32L4XX MCU software package as an example, other FreeRTOS release code files are located at this path: STM32Cube_FW_L4_V1.18.0\Middlewares\Third_Party\FreeRTOS\Source •vTask/xTask/eTask Online explanations state that both vTask and xTask are tasks within the FreeRTOS system, … Read more

What is the Difference Between FreeRTOS Hook Functions and Idle Tasks?

What is the Difference Between FreeRTOS Hook Functions and Idle Tasks?

Recently, I used FreeRTOS in a project and became curious about idle tasks and hook functions, so I wanted to understand what these two are used for. Here, I will share some of my insights.1. Idle TaskThe idle task is a task that is created by default after the FreeRTOS system starts, and it has … Read more

How FreeRTOS Manages Time: An Analysis of Tick, Interrupts, and Scheduling Mechanisms

How FreeRTOS Manages Time: An Analysis of Tick, Interrupts, and Scheduling Mechanisms

Table of Contents Background and Overview Source and Configuration of Tick Timer 2.1 <span>configTICK_RATE_HZ</span> 2.2 Hardware Timer & <span>vPortSetupTimerInterrupt</span> Processing Flow of Tick Interrupt 3.1 Interrupt Entry and FreeRTOS Hook 3.2 Time Statistics and Delay Management Time Slicing and Dynamic Priority Scheduling 4.1 Preemptive vs. Cooperative Kernel 4.2 Round Robin Scheduling Context Switching Mechanism 5.1 … Read more

Is the Stack Size of RTOS Tasks Related to the Amount of Task Code?

Is the Stack Size of RTOS Tasks Related to the Amount of Task Code?

Recently, a colleague raised the following question:“I have a lot of code in my task; does this mean that the stack for this task needs to be allocated larger?”Below, we will describe the relationship between the amount of task code and stack allocation. 1RTOS Task Stack Allocation Many RTOSs on the market require the stack … Read more

Mastering Microcontrollers: Answer These Questions to Prove Your Skills!

Mastering Microcontrollers: Answer These Questions to Prove Your Skills!

With the rapid development of electronic technology, microcontrollers have become one of the essential basic components in many fields. They are small yet complete microcomputer systems that integrate a central processing unit (CPU), RAM, ROM, various I/O ports, and interrupt systems onto a single silicon chip using ultra-large-scale integration technology, and are widely used. 1. … Read more

Exploring Open Source Embedded RISC-V SoCs: Supported Operating Systems and Development Platforms

Exploring Open Source Embedded RISC-V SoCs: Supported Operating Systems and Development Platforms

The RISC-V architecture is rapidly emerging as a strong force in the SoC design field due to its open-source and scalable features. However, for many developers, understanding which operating systems can run on RISC-V SoCs and what development platforms are needed remains a challenge. This article will delve into the operating systems supported by RISC-V … Read more

Essential Knowledge for Embedded Projects – Basics of Operating Systems

Essential Knowledge for Embedded Projects - Basics of Operating Systems

RTOS (Real-Time Operating System) Real-Time Characteristics: The ability to respond to external events and execute tasks within a specified time frame, such as in industrial control, ensuring precise timing for sensor signal acquisition and actuator control operations, thereby maintaining the stable and efficient operation of automated production lines. Task Scheduling Mechanism: Understanding preemptive scheduling (where … Read more

Comparison of Real-Time Performance of Commonly Used RTOS in Embedded Development

Comparison of Real-Time Performance of Commonly Used RTOS in Embedded Development

For real-time operating system (RTOS) kernels, the speed of quickly finding the highest priority task from the task ready list is an important metric for measuring real-time performance.This article analyzes the highest priority task lookup algorithms of μCOS-II, μCOS-III, and FreeRTOS, providing reference for selecting RTOS for embedded development applications.First, the conclusions are given:1) μCOS-II … Read more

Understanding the Basic RTOS Features of VxWorks: A Practical Guide for Engineers

Understanding the Basic RTOS Features of VxWorks: A Practical Guide for Engineers

Understanding the Basic RTOS Features of VxWorks: A Practical Guide for Engineers VxWorks is a real-time operating system (RTOS) developed by Wind River, widely adopted in mission-critical embedded systems. This article will introduce the fundamental features of VxWorks, including task control, inter-process communication (IPC), signal handling, and virtual devices, along with practical code examples. Why … Read more

FreeRTOS Multitasking Development: Building Efficient and Stable Embedded Systems

FreeRTOS Multitasking Development: Building Efficient and Stable Embedded Systems

1. FreeRTOS Multitasking Architecture 1.1 Overview of Task Model As a lightweight real-time operating system, the core of FreeRTOS is its multitasking capability. In FreeRTOS, applications are organized as a set of independent tasks, each executing in its own context (such as a separate stack space) without dependencies on each other. Each task can be … Read more