Understanding Semaphore Mechanisms in FreeRTOS

Understanding Semaphore Mechanisms in FreeRTOS

1. Basic Concepts A semaphore is a classic synchronization mechanism for processes/tasks, used to coordinate multiple execution units (such as tasks and threads) in accessing shared resources, preventing race conditions. Thus, it can be generally understood as: A semaphore is an integer counter used to control access to shared resources. Operation Control P (Proberen) Operation: … Read more

Learning FreeRTOS Code (Part Four)

Learning FreeRTOS Code (Part Four)

•STM32 Cube Software Package Code Structure ARM has added a middleware layer, CMSIS_RTOS/cmsis_os.c, to ensure compatibility with various operating systems. Taking the STM32L4XX MCU software package as an example, other FreeRTOS release code files are located at this path: STM32Cube_FW_L4_V1.18.0\Middlewares\Third_Party\FreeRTOS\Source •vTask/xTask/eTask Online explanations state that both vTask and xTask are tasks within the FreeRTOS system, … Read more

Detailed Explanation of Semaphores in Embedded Systems: Comparison and Selection of Common Semaphores

Detailed Explanation of Semaphores in Embedded Systems: Comparison and Selection of Common Semaphores

In embedded system development, semaphores are an important synchronization mechanism used to coordinate resource access among multiple tasks or threads. Through semaphores, developers can ensure the safe use of shared resources, avoiding issues such as race conditions and deadlocks. Today, we will discuss in detail the common types of semaphores in embedded operating systems and … Read more

Practice! 3 Classic Embedded Linux Interview Questions

Practice! 3 Classic Embedded Linux Interview Questions

Click on the above “Baibai Technology” and select “Pin to Public Account” Embedded essentials delivered instantly Question 1: Briefly describe the differences between memcpy and strcpy? Question 2: What are the differences between semaphores and mutexes? Question 3: Briefly describe the process of program compilation? Answer to Question 1: (1) The content copied is different. … Read more

Basics of Embedded μC/OS-II System

Basics of Embedded μC/OS-II System

Wu Jianying Microcontroller Development Board Address Shop:【Wu Jianying’s Shop】 Address:【https://item.taobao.com/item.htm?_u=ukgdp5a7629&id=524088004171】 μC/OS-II maintains all information of an event control block through the OS_EVENT data structure defined in uCOS_II.H [Program Listing L6.1], which is the event control block ECB mentioned at the beginning of this chapter. This structure not only includes the definition of the event itself, … Read more

Deep Dive Into Thread Synchronization in C#

Deep Dive Into Thread Synchronization in C#

Thread Synchronization in C#: From Basics to Advanced Hello everyone! Today I want to talk with you about the thread synchronization mechanisms in C#. In multi-threaded programming, different threads may access shared resources simultaneously, which is like multiple people trying to grab a hamburger at the same time. If not managed properly, chaos can ensue. … Read more

Methods for Multithreaded Access to UART in RTOS

Methods for Multithreaded Access to UART in RTOS

Reader *Shi San* asks: Can the blogger introduce methods for multiple tasks to access the same hardware under RTOS? For example, multiple tasks need to use the serial port to print information. My answer is: Both mutexes and queues can solve the access conflict problem. Multithreaded access to the same serial hardware is commonly used … Read more

Understanding Inter-Task Communication in RTOS

Understanding Inter-Task Communication in RTOS

Follow+Star PublicAccount, don’t miss out on exciting content Author | strongerHuang WeChat Official Account | strongerHuang I came across an interesting question: why do RTOS tasks not use global variables for inter-task communication when bare-metal code uses global variables? Those who have a deep understanding of RTOS principles, or have read RTOS source code should … Read more

Why Not Use Global Variables for Inter-task Communication in RTOS?

Why Not Use Global Variables for Inter-task Communication in RTOS?

Follow+Star Public Account Number, don’t miss wonderful content Author | strongerHuang WeChat Public Account | strongerHuang Students who have a deep understanding of RTOS principles or have read RTOS source code should know: RTOS implements inter-task communication usually by a series of pointers. The “effective data” of inter-task communication is actually implemented by pointers pointing … Read more