I. Embedded System Components
From an external perspective, an embedded system is typically a fully functional, integrated hardware and software system that can operate independently with almost no reliance on other external devices. If we break down such a system, we can find that it may roughly consist of several layers, as shown in Figure 1.
The core layer of an embedded system is the central processing unit (CPU), which includes an arithmetic logic unit (ALU) and a control module. Adding memory, power supply, and reset modules to the CPU constitutes what is commonly referred to as the minimum system. Due to technological advancements, integrated circuit manufacturers often integrate many peripherals into a single integrated circuit for greater ease of use; such a chip is typically called a microcontroller. Further expanding upon the microcontroller with power sensing and detection, actuator modules, and accompanying software to form a complete unit with specific functions is called an embedded system or embedded application.
II. Hardware Structure
Although the functions, interfaces, and operations of various embedded systems differ significantly, their basic hardware structures are largely similar and bear a high degree of resemblance to those of general-purpose computers. The hardware of an embedded system appears indistinguishable from that of a general-purpose computer system, consisting of a processor, memory, external devices, I/O interfaces, and a graphics controller. However, the specific applications of embedded systems lead to substantial differences in their hardware and software composition and implementation. To meet the speed, size, and power consumption requirements of embedded systems, operating systems, application software, and special data that need to be stored long-term typically do not use large-capacity, slow storage media like hard disks, but instead mostly use EPROM, E2PROM, or flash memory. In embedded systems, A/D or D/A modules are primarily used for measurement and control, which is rarely used in general-purpose computers. Depending on the specific application and scale, some embedded systems require external buses. With the rapid expansion of embedded system applications, embedded systems are becoming increasingly customized, and the types of buses used to achieve their specific characteristics are also increasing. In addition, in order to test the internal circuitry of embedded processors, processor chips commonly employ boundary scan testing technology (JTAG).
III. Software System
The software architecture of an embedded system is designed specifically for the hardware architecture and user requirements of the embedded system. It is an important component of the embedded system and key to realizing its functions. Similar to the software architecture of a general-purpose computer, the embedded system software architecture is divided into four layers: driver layer, operating system layer, middleware layer, and application layer, each with its own characteristics.
1. Driver layer
The driver layer is the layer that directly interacts with the hardware, providing hardware drivers or low-level kernel support for the operating system and applications. In embedded systems, drivers are sometimes also called board support packages (BSPs). A BSP has the function of initializing the basic hardware environment of the embedded system after power-on. Basic hardware includes microprocessors, memory, interrupt controllers, DMA, timers, etc. The driver layer generally has three types of programs: board initializers, standard drivers, and application drivers.
2. Operating System Layer
The operating system in an embedded system possesses the core functions of a general operating system, responsible for the allocation, scheduling, control, and coordination of all hardware and software resources, as well as concurrent activities. It retains the characteristics of an embedded system and belongs to the category of Embedded Operating Systems (EOS). Mainstream embedded operating systems include Windows CE, Palm OS, Linux, VxWorks, pSOS, QNX, and LynxOS. With an embedded operating system, application development becomes faster, more efficient, and more stable.
3. Middleware layer
Middleware is software used to help and support application software development. It typically includes databases, network protocols, graphics support, and corresponding development tools. Examples include MySQL, TCP/IP, and GU1.
4. Application Layer
Embedded application software is software designed for specific application domains to achieve user-expected goals. Embedded application software differs from ordinary application software in that it not only needs to meet the requirements of practical applications in terms of accuracy, security, and stability, but also needs to be optimized as much as possible to reduce system resource consumption and lower hardware costs. Application software is the most active force in embedded systems, and each type of application software has a specific application background. Although smaller in scale, it is highly specialized, so embedded application software is not as dependent on foreign products as operating systems and supporting software, making it a strength of my country's embedded software industry.