FreeRTOS task creation and deletion, suspension and resumption

1. Create BaseType_t xTaskCreate( TaskFunction_t pxTaskCode, const char* const pxName, const uint16_t usStackDepth, void* const pvParameters, UBaseType_t uxPriority, TaskHandle_t* const pxCreateTask) This function is mainly used to create tasks. It creates tasks in a dynamic way. The space and stack size used by tasks created by the dynamic task creation function are managed by FreeRTOS. […]

(1) FreeRTOS task creation and deletion

Table of Contents 1. Task creation xTaskCreate 2. Task creation xTaskCreateStatic 3. Task deletion vTaskDelete 1. Task creation xTaskCreate ? //task.h BaseType_t xTaskCreate( TaskFunction_t pvTaskCode, const char * const pcName, configSTACK_DEPTH_TYPE usStackDepth, void *pvParameters, UBaseType_t uxPriority, TaskHandle_t *pxCreatedTask ); ? Create a new task and add it to the list of tasks ready to run. […]

FreeRTOS_mutually exclusive semaphore of semaphore

Table of Contents 1. Mutually exclusive semaphore 1.1 Introduction to mutually exclusive semaphores 1.2 Create a mutually exclusive semaphore 1.2.1 Function xSemaphoreCreateMutex() 1.2.2 Function xSemaphoreCreateMutexStatic() 1.2.3 Analysis of the Mutex Semaphore Creation Process 1.2.4 Release the mutex semaphore 1.2.5 Obtain mutex semaphore 2. Mutually exclusive semaphore operation experiment 2.1 Experimental procedures 2.1.1 main.c 2.1.2 Experimental […]

FreeRTOS task notification (use task notification to simulate binary semaphore)

Task notification is an event. FreeRTOS has added task notification function starting from version v8.2.0. There is a 32-bit member variable ulNotifiedValue in each TCB, which is specifically used for task notification. Task notifications can be used to replace semaphores, event flag groups, etc. on certain occasions, and have higher execution efficiency. A task that […]

FreeRTOS software timer

The software timer is an optional feature of FreeRTOS, implemented based on the system clock beat. Its implementation does not require the use of any hardware timer resources and is not limited in quantity, only system resource permissions are required. Software timers allow specified functions to be executed after the set time has elapsed. This […]

FreeRTOS memory management

Memory management is a very important function of FreeRTOS. The tasks, message queues, semaphores, event flag groups and software timers described in the previous chapters have two methods when creating them: one is the dynamic memory allocation method; the other is The first is a static method that specifies memory by the user. The memory […]

How to jump to user tasks in FreeRTOS task scheduling

Foreword When learning FreeRTOS, whether it is linked list learning, task definition creation or ready list, it is easy to understand. It is nothing more than the definition of some structures. It does not require a certain understanding of the CPU’s working mode and mode switching like when learning task scheduling. . Taking stm32 as […]

FreeRTOS-Task Management

Table of Contents 1. Task function 2. Top-level task status – simple understanding 3. Create a task prototype xTaskCreate() API function prototype 4. Simple creation of instances 4.1 Simple Example 1: Create 2 tasks 4.2 Simple Example 2: Using task parameters 5. Task priority 6. Time measurement and tick interruption 7. Expand the “not running” […]

FreeRTOS source code understanding (9) – event groups and task notifications

FreeRTOS source code understanding (1) – FreeRTOS ideas sorting out FreeRTOS source code understanding (2) – interrupts and list items FreeRTOS source code understanding (3) – task FreeRTOS source code understanding (4) – task scheduler FreeRTOS source code understanding (5) – task switching FreeRTOS source code understanding (6) – time management FreeRTOS source code understanding […]

FreeRTOS source code understanding (3) – task

FreeRTOS source code understanding (1) – FreeRTOS ideas sorting out FreeRTOS source code understanding (2) – interrupts and list items FreeRTOS source code understanding (3) – task FreeRTOS source code understanding (4) – task scheduler FreeRTOS source code understanding (5) – task switching FreeRTOS source code understanding (6) – time management FreeRTOS source code understanding […]