Task Scheduling and Kernel Implementation of FreeRTOS

Task Scheduling and Kernel Implementation of FreeRTOS

This article introduces the tasks and scheduling kernel implementation of FreeRTOS.1. Concept of Tasks In FreeRTOS, a task is the smallest unit of system scheduling and execution. Each task has its own stack space, program counter (PC), registers, and state. Task Stack Spaceis a contiguous memory area that stores local variables, function call information, and … Read more

Switching Tasks in ThreadX RTOS

Switching Tasks in ThreadX RTOS

Using the QEMU simulator to outline the ThreadX task scheduling process.0. Build ExampleCreate Task 0 and Task 1 #include "tx_api.h" #include "tx_thread.h" // Task 0 entry void thread_0_entry(ULONG thread_input){ TX_THREAD *current_thread; thread_0_counter++; TX_THREAD_GET_CURRENT(current_thread); tx_thread_terminate(current_thread); } // Task 1 entry void thread_1_entry(ULONG thread_input){ while(1) { /* Increment the thread counter. */ thread_1_counter++; while(1); }} // Create … Read more

Detailed Explanation of FreeRTOS Multitasking Execution Principles – Part Two

Detailed Explanation of FreeRTOS Multitasking Execution Principles - Part Two

Detailed Explanation of FreeRTOS Multitasking Switching Underlying Principles 6. Task State Transitions 6.1 State Transition Diagram Create Ready Queue CPU Execution [NEW] —–> [READY] —–> [RUNNING] ↑ ↓ ↓ ↑ ↓ [Time Slice Expired] ↑ ↓ ↓ [Waiting for Event] [BLOCKED] [Delay Waiting] [SUSPENDED] 6.2 State Transition Conditions Transition Trigger Condition Description NEW → READY … Read more

Mastering FreeRTOS from Scratch: Differences Between Bare Metal and RTOS

Mastering FreeRTOS from Scratch: Differences Between Bare Metal and RTOS

RTOS, known in Chinese as 实时操作系统 (Real-Time Operating System), is the main focus of this series, which aims to master FreeRTOS. Next, we will compare it with bare metal systems and understand the advantages of RTOS, allowing us to clearly recognize why we should learn RTOS. Bare Metal System In a bare metal system, the … Read more

FreeRTOS Queue Management

FreeRTOS Queue Management

Inter-Process Communication In bare-metal development, two applications typically use global variables for message passing. However, in applications using an operating system, using global variables for message passing involves “resource management” issues. FreeRTOS implements message passing between tasks and between tasks and interrupts through a mechanism called “queues”. Queue Management Queues generally use a first-in-first-out (FIFO) … Read more

From Startup to First Task Execution in ThreadX RTOS

From Startup to First Task Execution in ThreadX RTOS

Utilizing the VSCode debugging environment to observe the startup process of ThreadX.0. Startup AnecdoteThe example program for the debugging environment built on ThreadX RTOS encounters a HardFault exception, as shown in the figure below.However, this issue does not occur on another host. The same example code, when debugged step by step, locates the specific instruction … Read more

Porting FreeRTOS Code

Porting FreeRTOS Code

1. Introduction to FreeRTOS FilesThe official website of FreeRTOS:https://freertos.org/zh-cn-cmn-sThe latest code and related documentation can be obtained from the FreeRTOS official website.The path to obtain historical versions of FreeRTOS code:https://sourceforge.net/projects/freertos/files/FreeRTOS/This article uses version V9.0.0.Preparation of the IM94 series Demo project.The contents of the FreeRTOS files are shown in the figure below:2. Porting FreeRTOS1. Copy the … Read more

3D UAV-MEC Multi-Agent Collaboration for Energy-Efficient Task Scheduling

3D UAV-MEC Multi-Agent Collaboration for Energy-Efficient Task Scheduling

Abstract: In response to the computing power processing needs of intelligent applications, Multi-access Edge Computing (MEC) provides computing services at the network edge. Unmanned Aerial Vehicles (UAVs) have good maneuverability and can serve as temporary aerial edge nodes in MEC to provide edge services to ground users. However, the MEC environment is complex and dynamically … Read more

Real-Time Scheduling Strategies for AI Quality Inspection Systems Enabled by Multi-Access Edge Computing

Real-Time Scheduling Strategies for AI Quality Inspection Systems Enabled by Multi-Access Edge Computing

Click on the blue text丨Follow us Source: Journal of Electronics and Information Authors: Zhou Xiaotian, Sun Shang, Zhang Haixia, Deng Yiqin, Lu Binbin Abstract Keywords AI quality inspection is an important part of smart manufacturing. The equipment generates a large number of computation-intensive and delay-sensitive tasks during product quality inspection. Due to insufficient computing power … Read more

Energy-Efficient Task Scheduling for 3D UAV-MEC Collaboration

Energy-Efficient Task Scheduling for 3D UAV-MEC Collaboration

Abstract: In response to the computational needs of intelligent applications, multi-access edge computing (multi-access edge computing,MEC) provides computational services at the network edge. Unmanned aerial vehicles (unmanned aerial vehicle,UAV) possess excellent maneuverability and can serve as temporary aerial edge nodes to provide edge services for ground users within the MEC environment. However, the MEC environment … Read more