Task Scheduling in FreeRTOS – Context Switching

Task Scheduling in FreeRTOS - Context Switching

The previous article on FreeRTOS task scheduling – startup mentioned that the first task runs in an infinite loop mode. Clearly, having only one task running is not sufficient. So how does the running task yield control of the MCU to allow other tasks to run? One way is for the task to voluntarily yield … Read more

Embedded Software Interview – Operating Systems: 1 – What is Priority Inversion and How to Resolve It

Embedded Software Interview - Operating Systems: 1 - What is Priority Inversion and How to Resolve It

1. What is Priority Inversion? A high-priority task is indirectly blocked by a low-priority task, causing a medium-priority task to execute before the high-priority task, which violates the original intention of priority scheduling. 2. Example Illustration Assume there are three tasks: High Priority Task (High) Medium Priority Task (Medium) Low Priority Task (Low) The process … Read more

Learning Notes on Callback Functions in C: Concepts, Classifications, and Embedded Applications

Learning Notes on Callback Functions in C: Concepts, Classifications, and Embedded Applications

1. What is a Callback Function? A Callback Function is a programming pattern implemented through function pointers, characterized by the following core features: Passing Method: Function A (the callback function) is passed as a parameter to Function B. Calling Relationship: Function B calls Function A under specific conditions, in contrast to the traditional top-down calling. … Read more

ESP32 Performance Optimization Strategies: Execution Efficiency Analysis

ESP32 Performance Optimization Strategies: Execution Efficiency Analysis

In ESP32 development, execution efficiency analysis is a core aspect of performance optimization, aimed at identifying code bottlenecks through quantitative methods and optimizing them accordingly. The following are execution efficiency analysis strategies based on the characteristics of the ESP32 and practical project experience, covering performance testing methods, algorithm optimization, compiler configuration, and task scheduling: 1. … Read more

Understanding the Timer Module in FreeRTOS

Understanding the Timer Module in FreeRTOS

Introduction:In modern embedded systems, timers are one of the core components for task scheduling, event triggering, and resource management. However, hardware timer resources are limited, making it difficult to meet the diverse timing requirements in complex application scenarios.The software timer module in FreeRTOS is a key component in real-time systems. By utilizing virtualization technology, it … Read more

Priority Inversion Problem in FreeRTOS

Priority Inversion Problem in FreeRTOS

Priority inversion in FreeRTOS occurs when a high-priority task is blocked while waiting for resources (such as a mutex) held by a low-priority task, allowing a medium-priority task to execute in the meantime, which leads to scheduling anomalies where the high-priority task cannot run in a timely manner. Scenario Example: Task Priorities: There are three … Read more

Understanding the Task Module in FreeRTOS (Part 2)

Understanding the Task Module in FreeRTOS (Part 2)

The source code of the task function contains the following parts: 1. Priority handling 2. Task creation 3. Starting the first task 4. Task switching 5. Task blocking/waking The previous article focused on the first three points, while this article will start from the scheduler to discuss the task switching (scheduling) mechanism. 1. Scheduling Mechanism … Read more

AI Systems: From NPU Scheduler to AI Inference Engine

AI Systems: From NPU Scheduler to AI Inference Engine

In the article AI System – 7 Pytorch Digital Recognition Practice and Operator Introduction, it mentions AI algorithms implemented using Pytorch on PC, and in AI System – 17 NPU Architecture Design Introduction, it discusses hardware implementation in NPU. Now, there is a question: How can AI algorithms be deployed and adapted on hardware? This … Read more

Plombery: The Ultimate Python Task Scheduling Tool!

Plombery: The Ultimate Python Task Scheduling Tool!

Are you still troubled by scheduling tasks for your Python scripts? Complicated configurations, lengthy code, and a lack of visual monitoring can leave you overwhelmed. Plombery may change your perception of Python task scheduling, leading you into a new world that is efficient, convenient, and visual! 1. What is Plombery? Plombery is a simple and … Read more

Operating Systems in Embedded Systems

Operating Systems in Embedded Systems

Concepts and Characteristics of Embedded Systems Embedded Systems are specialized computer systems that are embedded within larger devices or systems to perform specific functions. In Internet of Things (IoT) systems, embedded systems act like neural nodes, playing a crucial role in various fields such as smart homes, industrial control, smart energy, intelligent transportation, and smart … Read more