Understanding Memory Alignment of C Structs in Embedded Systems

Understanding Memory Alignment of C Structs in Embedded Systems

Today, I bring you a classic and commonly mistaken question about memory alignment of C language structures: Calculate the number of bytes occupied by the following structure in a 32-bit environment: typedef struct test_struct { char a; short b; char c; int d; char e; }test_struct; Please provide your answer: Let’s take a look at … Read more

Essential Data Structures for Embedded System Development

Essential Data Structures for Embedded System Development

In embedded system development, the choice of data structures is crucial for optimizing memory usage, improving program efficiency, and simplifying code logic. Today, Hua Mei has summarized the eight commonly used data structures in embedded development (recommended to bookmark): 1. Array An array is a simple linear data structure used to store a collection of … Read more

Mastering FreeRTOS: A Comprehensive Guide to Doubly Linked Lists

Mastering FreeRTOS: A Comprehensive Guide to Doubly Linked Lists

Abstract: Today, we will discuss the doubly linked list by combining the source code of FreeRTOS’s linked list. Note: A linked list item is a node, and a node is a linked list item; they refer to the same thing, and it doesn’t matter what you call it. 1. Defining the Linked List Structure // … Read more