Understanding Embedded System Architecture in One Article

“工控有得聊”是机械工业出版社“机工工控”“机工通信”品牌旗下专业资讯和服务平台,致力于帮助读者在电气、通信、自动化领域里,紧跟前沿资讯,掌握核心技术,快速提升专业素养。点击蓝色微信名可快速关注我们!



If you aspire to become a modern embedded systems engineer, you need to determine the system architecture at the beginning of all projects.The system architecture includes two aspects: hardware and software.The hardware part not only determines the complexity and cost of the system but also affects how the subsequent software logic is implemented.Moreover, once determined, it is often difficult to change during the project process.If the architecture needs to be modified, it often leads to significant delays and cost losses for the project.You may not yet fully understand the importance of system architecture, but we need to pay enough attention to it and constantly focus on the system architecture in our projects and why it is designed this way.With experience accumulation, you will naturally gain insights.

Let’s first compare the differences between embedded system architecture and non-embedded system architecture.

Understanding Embedded System Architecture in One Article

Typical Embedded System Block Diagram

Understanding Embedded System Architecture in One Article

Typical AP System Block Diagram

Let’s first introduce what an AP system is. AP stands for Application Processor. Most of our modern devices like smartphones, TVs, and set-top boxes are based on this architecture, which is very similar to PC systems. In the two diagrams above, the solid parts are essential for a system, while the hollow parts are peripheral functional devices that are not essential and can be replaced based on different functionalities. Therefore, if we only consider the solid parts in the diagrams above, we refer to it as the “minimum system”. The minimum system is the simplest form that ensures the system can operate; of course, the minimum system generally has no functionality and only allows software to run on the MCU or AP. For example, one of the greatest physicists of the 20th century, Stephen William Hawking, became a “minimum system” after he became paralyzed due to amyotrophic lateral sclerosis. However, with his will and love for theoretical physics, he continued to use his genius brain (powerful MCU) to ponder the most profound questions in the universe. Perhaps this is not the most suitable example, but I believe anyone who graduated from an engineering major can understand it.

Let’s look at the differences in the minimum system, which are quite obvious. The minimum system of an embedded system seems to lack external program memory and RAM (SRAM and DDR are both types of RAM). So, that’s all?

On the surface, that’s all! However, training engineers requires more detail. You must know the difference between RAM and program memory,RAM stands for Random Access Memory; don’t be fooled by the term “random access,” it merely expresses the ability to read and write any storage unit (like a byte) in RAM at will.It’s like a hotel where you can freely access any room on any floor (of course, provided you are the owner and guests do not complain). In contrast, program memory (like Flash) cannot access individual storage units at will; it can only access in bulk, commonly reading and writing in pages or blocks.It’s more like a hotel where you can only access one floor at a time (at this point, you might be the cleaner). There are many types of program memory, commonly Nor-Flash, NAND-Flash, hard disks, etc.In this book, I will interchangeably use Flash and program memory; please do not be confused.RAM also has many types, such as SRAM, SDRAM, DDR, etc.; I won’t elaborate on this here.Unless otherwise specified in this book, RAM refers to SRAM (Static Random-Access Memory).Besides the different access methods, there is another important physical characteristic: the contents of RAM are lost when the system loses power;in contrast, the contents of Flash are not lost.Thus, these two types of memory are also referred to as:volatile memory (like RAM) and non-volatile memory (like Flash).

At this point, you must be feeling conflicted about why it’s so complicated. Can’t we just use one type? Let’s see what our options are. If we use only Flash, due to its slow access speed, especially when writing data, it is incredibly slow compared to the running speed of the MCU, which will slow down the entire system. If we use only RAM, the data cannot be saved after power loss, and there’s a fatal issue—cost! You can compare the prices of RAM and hard disks in your computer; if you compare the price per unit capacity, you will find they differ by hundreds of times. Therefore, combining these two things is the most cost-effective solution. Life is all about constant trade-offs and compromises! The following diagram categorizes memory based on speed and price.

Understanding Embedded System Architecture in One Article

Layering of Different Memories

What content must be preserved after power loss? Of course, it’s the program, which is why I equate Flash with program memory (some data also cannot be lost after power loss, but we care more about programs). So, what do we put in RAM? Naturally, it’s frequently accessed variables and “time-sensitive” programs. Later, we will encounter related content, but let’s not delve deeper for now.

Returning to the previous topic, from the perspective of the minimum system, embedded systems and AP systems seem to differ only in whether the memory is placed outside the chip. Is it necessary to differentiate so clearly? Well, as mentioned earlier, system architecture is related to both hardware and software. Now let’s look at the differences in software. Because the memory in embedded systems is generally built-in (some MCUs save costs by placing Flash externally), the memory capacity is kept small. Therefore, they generally do not use the operating systems that most people encounter, such as Android, Linux, or Windows. Operating systems consume a lot of system resources; besides the CPU frequency requirements, the most important is the memory capacity requirements. I remember that with the continuous upgrades of Windows, our computer hardware also keeps upgrading. Generally, embedded systems have two software modes: one does not run any operating system, which saves system resources the most, but when the software becomes more complex, running bare-metal becomes difficult. Therefore, another mode is to use RTOS (Real-Time Operating System), which is specifically designed for embedded systems. Its characteristics are simplicity, low resource usage, fast response, and strong scalability.

At this point, you should subtly sense why we need to distinguish between embedded systems and AP systems; the slight changes in minimum system components embody countless wisdom (compromises), which relate not only to hardware but also to software. Here, I want to emphasize that in real projects, the choice of system architecture involves many factors, including technical and cost considerations. This only provides an outline to give you a preliminary impression and basis.

Understanding Embedded System Architecture in One Article
More Exciting Content

Essential Reading for Embedded System Development Engineers

Theory + Practice

A book to quickly immerse you in system development work

Understanding Embedded System Architecture in One Article

(Click on the book cover for details)

Author: Wang Wei, Yao Siwei, Edited

Recommendation: “Embedded System Practical Guide: Focused on IoT Applications”The starting point is the practical application of embedded systems, so it covers a wide range. To control the length, many content points are briefly mentioned but can serve as a starting point. This book first defines embedded systems and then expands around that definition. The book is divided into three parts: the first part focuses on basic application knowledge; the second part builds on the first part with advanced application knowledge, mainly targeting embedded operating systems; the third part is relatively independent, introducing the currently popular low-power Bluetooth principles and applications. Each part of the book has multiple corresponding examples and uses various common software and hardware.

This book is suitable not only for newcomers in the embedded systems industry but also for experienced embedded system development engineers for learning and reference. It can also be used as a teaching material for majors such as automatic control, communication, applied electronics, and mechatronics.

RT-Thread Official Recommended Book

Includes valuable electronic resources

Understanding Embedded System Architecture in One Article

(Click on the book cover for details)

Authors: Wang Yihuai, Shi Hongwei, Sun Jinzong, Luo Xizhao, Edited

Recommendation: Embedded real-time operating systems are important tools and operating carriers for embedded artificial intelligence and IoT terminals. “Embedded Real-Time Operating Systems: Based on RT-Thread EAI & IoT System Development” uses the domestic RT-Thread real-time operating system as a background to explain the basic knowledge elements of real-time operating systems, including threads, scheduling, delay functions, events, message queues, semaphores, and mutexes, and provides program design methods under real-time operating systems. The book is divided into three parts: basic applications (Chapters 1-7), principle analysis (Chapters 8-12), and comprehensive practice (Chapters 13-14). If readers are only engaged in application development under real-time operating systems, they can read only the basic application and comprehensive practice sections; if they wish to understand the principles of real-time operating systems, it is recommended to read the entire book.

This book can serve as a reference for application development engineers, graduate students, and senior undergraduates, and can also be used as training material for real-time operating system technology.

Author: Zhang Lu
Editor: Li Xinxin
Reviewer: Shi Jing

Leave a Comment

Your email address will not be published. Required fields are marked *