FreeRTOS Development: How to Create Tasks

FreeRTOS Development: How to Create Tasks

1. Task-Related APIs Function Purpose xTaskCreate() Create a task vTaskDelete() Delete a task (NULL can be passed to delete itself) vTaskSuspend() Suspend a task (NULL can be passed to suspend itself) vTaskResume() Resume a task vTaskDelay() Delay (block the task for a period) vTaskDelayUntil() Periodic delay (ensure constant period) uxTaskPriorityGet() Get task priority vTaskPrioritySet() Set … Read more

No C++ Standard Library in Embedded Development? Use C Language to Simulate std::future!

No C++ Standard Library in Embedded Development? Use C Language to Simulate std::future!

This article is based on a thorough review of relevant authoritative literature and materials, forming professional and reliable content. All data in the article is verifiable and traceable. Special statement: The data and materials have been authorized. The content of this article does not involve any biased views and objectively describes the facts with a … Read more

Microcontroller Development

Microcontroller Development

In the embedded field, embedded real-time operating systems are becoming increasingly widely used. Using an embedded real-time operating system (RTOS) can more reasonably and effectively utilize CPU resources, simplify application software design, shorten system development time, and better ensure the system’s real-time performance and reliability. FreeRTOS is a mini real-time operating system kernel. As a … Read more

Scheduling Strategies in RTOS Applications

Scheduling Strategies in RTOS Applications

Transitioning from bare-metal (front-back architecture) software development to using a Real-Time Operating System (RTOS) can be a challenging task. However, there are many advantages to using an RTOS, such as simplifying application integration and supporting task preemption scheduling. This becomes meaningful when developers use complex 32-bit microcontrollers and have sufficient Flash and RAM space. Many … Read more

BitBake – A Powerful Engine for Embedded Linux Build Systems

BitBake - A Powerful Engine for Embedded Linux Build Systems

BitBake is a powerful build tool primarily used for building embedded Linux systems, playing a core role in the Yocto Project. It is not just a simple build tool but a complete task execution engine capable of handling complex dependencies and build processes. Basic Concepts BitBake uses specific configuration files (.bb files) to describe how … Read more

Comprehensive Analysis of FreeRTOS Task Management: Mastering Core Techniques from Creation to Deletion

1. Basic Concepts In the context of the entire microcontroller program, we refer to it as an application. When using FreeRTOS, we can create multiple tasks within the application; some documents refer to tasks as threads. For example, in daily life, a mother may need to do two things at the same time: Feeding: This … Read more

Understanding FreeRTOS Cooperative and Preemptive Scheduling Algorithms

Understanding FreeRTOS Cooperative and Preemptive Scheduling Algorithms

In FreeRTOS, Cooperative Scheduling and Preemptive Scheduling are two different task scheduling algorithms. The core difference between them lies in the triggering mechanism for task switching and how task priorities are handled. 1. Cooperative Scheduling 1.1 Concept Cooperative Scheduling is a non-preemptive scheduling algorithm. In cooperative scheduling mode, task switching only occurs when a task … Read more

Embedded Real-Time Operating Systems

Embedded Real-Time Operating Systems

Dian Dian Xia wants to learn about RTOS, but doesn’t know where to start, sigh.Real-Time Operating Systems? I’m familiar with them, let me explain slowly.Ke Ke Jun Real-Time Operating Systems (RTOS) are widely used in consumer electronics, entertainment products, home appliances, industrial equipment, medical instruments, military weapons, and scientific research equipment. They play a critical … Read more

Embedded Communication Protocol: How Many RTOS Interview Questions Can You Answer?

Embedded Communication Protocol: How Many RTOS Interview Questions Can You Answer?

1. What Is the Task State Machine Model? The task state machine model describes the lifecycle and state transitions of a task. Typical states include: (1) Ready: The task can execute but is waiting for the scheduler to allocate CPU. (2) Running: The task is currently using the CPU to execute. (3) Blocked: The task … Read more

Understanding Synchronization and Mutual Exclusion in RTOS

Understanding Synchronization and Mutual Exclusion in RTOS

1. The Concepts of Synchronization and Mutual Exclusion To understand synchronization and mutual exclusion in one sentence: I wait for you to finish using the bathroom before I use it. What is synchronization? It is: Hey, I am using the bathroom, please wait. What is mutual exclusion? It is: Hey, I am using the bathroom, … Read more