Using Semaphores in FreeRTOS for STM32F103 Serial Data Transmission

Using Semaphores in FreeRTOS for STM32F103 Serial Data Transmission

1. Development Software: CubeIDE.2. Hardware Involved: STM32F103C8T6 minimum system board, ST-LINK v2 (STM8 & STM32), USB TO TTL (CH340). As shown below (for reference only):Connection Circuit Diagram:(1) STM32F103C8T6 <—> ST-LINK v2SWCLK <—> SWCLK; SWD <—> SWDIO ;3V3 <—> 3.3V ; GND <—> GND.(2)STM32F103C8T6 <—> USB TO TTLA10 <—> TXD ; A9 <—> RXD;3V3 <—> 3V3 … Read more

Introduction to FreeRTOS: Basics of Semaphores

Introduction to FreeRTOS: Basics of Semaphores

SemaphoreWe all know about queues, which can be used to transmit different types of data.However, sometimes we only need to convey a state without transmitting specific information.Thus, we introduce semaphores, which do not transmit data but rather convey states, serving as notifications and saving memory. A semaphore cannot transmit data; it only has a count … Read more

FreeRTOS Core API Overview

FreeRTOS Core API Overview

FreeRTOS – Core API Overview • Task management is the foundation for building concurrent programs. • Queues, semaphores, and mutexes: are solutions for inter-task communication and synchronization issues. • Event groups and task notifications: provide solutions for handling more complex synchronization scenarios. • Software timers: address the need for low-overhead handling of numerous timed events. … Read more

FreeRTOS Semaphores Explained

FreeRTOS Semaphores Explained

Semaphores Cover generated by Nano Banana 🍌🍌🍌 Using<span><span>binary semaphores</span></span> allows deferring tasks (tasks with high processing load and time consumption) in an interrupt to be completed in a processing (synchronization) task, ensuring that ISR() executes quickly. If the task in the interrupt is very urgent, it can be set to the highest priority, allowing the … Read more

Signals and Semaphores in FreeRTOS

Signals and Semaphores in FreeRTOS

1. Overview of Signals and Semaphores In FreeRTOS, signals and semaphores are both important mechanisms for inter-task communication (IPC), but they serve different purposes and operate differently. 1.1 Signals • In FreeRTOS, signals refer to task notifications, which are a lightweight signaling mechanism. • Each task has a 32-bit notification value. • Can be used … Read more

ARMv8 Synchronization and Semaphores: Load-Exclusive/Store-Exclusive Instructions Explained

ARMv8 Synchronization and Semaphores: Load-Exclusive/Store-Exclusive Instructions Explained

In the previous article, the basic principles of synchronization and semaphores in ARMv8 were introduced: An Overview of ARMv8 Memory Types and Attributes. This article continues to explore this topic by detailing the exclusive-related instructions: Load-Exclusive/Store-Exclusive usage. 1. Local Monitor and Global Monitor The article on An Overview of ARMv8 Memory Types and Attributes provides … Read more

Resource Management in FreeRTOS

Resource Management in FreeRTOS

Scan to FollowLearn Embedded Together, learn and grow together The FreeRTOS introductory series aims to help beginners quickly get started and master the basic principles and usage of FreeRTOS while organizing knowledge. FreeRTOS Quick Start – Exploring the System FreeRTOS Official Chinese Website is Now Live FreeRTOS Coding Standards and Data Types FreeRTOS Quick Start … Read more

Concurrency and Race Conditions in Linux

Concurrency and Race Conditions in Linux

Tip: For a better reading experience, it is recommended to read on a PC! 1 What are Concurrency and Race Conditions In Linux systems, concurrency refers to the situation where multiple execution units (processes, threads, interrupts, etc.) access shared resources simultaneously or alternately, while a race condition refers to the uncertain behavior or errors caused … Read more

Detailed Explanation of FreeRTOS Task Management and Communication Mechanisms

Detailed Explanation of FreeRTOS Task Management and Communication Mechanisms

1 Task Creation and Management Task Creation Use <span>xTaskCreate()</span> to create a task: BaseType_t xTaskCreate( TaskFunction_t pxTaskCode, // Task function (entry) const char * const pcName, // Task name (for debugging) configSTACK_DEPTH_TYPE usStackDepth, // Stack size (in words) void * const pvParameters, // Task parameters UBaseType_t uxPriority, // Priority (0~configMAX_PRIORITIES-1) TaskHandle_t * const pxCreatedTask // … Read more

Introduction to Semaphores in VxWorks 7

Introduction to Semaphores in VxWorks 7

Overview of Semaphores in VxWorks 7 In real-time operating systems (RTOS), semaphores are an important synchronization mechanism used to manage resource access and task synchronization in a multitasking environment.VxWorks 7 provides various types of semaphores to meet different application scenario requirements, mainly including: • Mutex Semaphores: Ensure mutual access to shared resources. • Binary Semaphores: … Read more