Enhancing Programmers’ Self-Cultivation

Enhancing Programmers' Self-Cultivation

Table of Contents 1.1 Starting with Hello World 1.2 The Essence Remains Unchanged 1.3 The Higher You Stand, The Further You See 1.4 What the Operating System Does 1.4.1 Don’t Let the CPU Doze Off 1.5 What to Do When Memory is Insufficient 1.5.1 About Isolation 1.5.2 Segmentation 1.5.3 Paging 1.6 Many Hands Make Light … Read more

In-Depth Notes on ZephyrRTOS (2): Basic Program Structure and Multithreading

In-Depth Notes on ZephyrRTOS (2): Basic Program Structure and Multithreading

I believe that the most important aspect of embedded systems is the scheduler, which I think is also the main value of FreeRTOS. However, in addition to the debugger, ZephyrRTOS offers much more. Main Thread The ZephyrRTOS kernel starts the Main Thread after completing the necessary startup tasks, including the initialization of drivers, before entering … Read more

How to Communicate Between Threads in C Language

How to Communicate Between Threads in C Language

First, there is no communication issue between threads within the same process. You can access data however you want; thus, we actually need to do something to actively “isolate” different threads to avoid dirty reads and writes. Second, multi-threaded programming (as well as multi-process programming) requires a foundation in operating systems. Without understanding the operating … Read more

Embedded Linux: Thread Creation, Termination, Reclamation, Cancellation, and Detachment

Embedded Linux: Thread Creation, Termination, Reclamation, Cancellation, and Detachment

Click the blue text above to follow us The operations of thread creation, termination, cancellation, reclamation, and detachment are core to multithreaded programming. In multithreaded programming, it is essential to manage the lifecycle of threads properly to avoid issues such as resource leaks, race conditions, or zombie threads. 1 Creating Threads In Linux, by default, … Read more

Embedded Linux: Registering Thread Cleanup Handlers

Embedded Linux: Registering Thread Cleanup Handlers

Click the blue text above to follow us In Linux multithreading programming, specific cleanup operations can be performed when a thread terminates by registering a thread cleanup handler. This is similar to using atexit() to register process termination handlers. The thread cleanup handler is used to perform resource release or cleanup tasks when a thread … Read more

Does Embedded Development Require Architectural Design?

Does Embedded Development Require Architectural Design?

My Understanding of Architectural Design 1. Understanding of Architectural Design Concepts I believe most readers of this article are engaged in embedded development, and you may have noticed that job postings for architectural design roles on recruitment websites are predominantly focused on Web development, with very few openings for system architects in embedded positions. My … Read more

Microsecond-Level Delay Solutions on RTOS

Microsecond-Level Delay Solutions on RTOS

Microsecond-Level Delay Design Solutions Generally, in an RTOS system with a clock of 1KHz, the minimum time for thread_sleep() is 1ms. In real-time control, there are situations where microsecond (us) level delays are required. What should we do in this case? There are two implementation approaches for microsecond-level delays: one is to increase the system … 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

Microsecond-Level Delay Solutions in RTOS

Microsecond-Level Delay Solutions in RTOS

Follow+Star Public Account Number, don’t miss the wonderful content Source | MultiMCU EDU Typically, the RTOS system tick is 1KHz, of course, there are cases of 100Hz or 10KHz. At 1KHz, the shortest system delay is 1ms, and in real-time control, there are situations that require microsecond (us) level delays. What should we do? There … Read more

Multithreading with FreeRTOS on ESP32

Multithreading with FreeRTOS on ESP32

LingShun Lab (lingshunlab.com) mainly introduces how to use multithreading with FreeRTOS on the ESP32. What is Multithreading? It refers to the technology of implementing multiple threads to execute concurrently from software or hardware. Computers with multithreading capabilities can execute more than one thread at the same time due to hardware support, thereby improving overall processing … Read more