Embedded Systems Architecture and Development Process

1 Definition of Embedded Systems

An embedded system is a specialized computer system that is part of a device or equipment. Typically, embedded systems are control programs stored in ROM on an embedded processor control board. In fact, all devices with digital interfaces, such as watches, microwaves, video recorders, and cars, use embedded systems. Some embedded systems also include operating systems, while others implement the entire control logic with a single program (bare-metal). Embedded systems are a combination of software and hardware, and both can be tailored to meet the strict requirements of application systems regarding functionality, reliability, cost, size, and power consumption.

2 Components of Embedded Systems

2.1 Hardware Layer

The hardware layer includes embedded microprocessors, memory (SDRAM, ROM, Flash, etc.), general device interfaces, and I/O interfaces (A/D, D/A, I/O, etc.). By adding power circuits, clock circuits, and memory circuits on top of an embedded processor, an embedded core control module is formed. Both the operating system and application programs can be embedded in ROM.

2.1.1 Embedded Microprocessor

The architecture of embedded microprocessors can adopt the Von Neumann architecture or Harvard architecture; the instruction system can choose between Reduced Instruction Set Computer (RISC) and Complex Instruction Set Computer (CISC). RISC computers only include the most useful instructions in the channel, ensuring that the data channel quickly executes each instruction, thereby improving execution efficiency and simplifying the design of the CPU hardware structure.

There are more than 1000 types of embedded microprocessors worldwide, with over 30 series of architectures, among which mainstream architectures include ARM, MIPS, PowerPC, and X86.

2.1.2 Memory

Embedded systems require memory to store and execute code. The memory of embedded systems includes Cache, main memory, and auxiliary storage.

1> Cache

Cache is a small, fast memory array located between the main memory and the embedded microprocessor core, storing the program code and data that the microprocessor uses most frequently over a period of time. When data read operations are needed, the microprocessor tries to read data from Cache rather than from main memory, significantly improving system performance and increasing the data transfer rate between the microprocessor and main memory.

The main goal of Cache is to reduce the memory access bottleneck caused by storage (such as main memory and auxiliary storage) to the microprocessor core, making processing faster and more real-time.

In embedded systems, Cache is fully integrated into the embedded microprocessor and can be divided into data Cache, instruction Cache, or mixed Cache, with the size of Cache depending on different processors. Generally, only mid-to-high-end embedded microprocessors will integrate Cache.

2> Main Memory

Main memory is the register that the embedded microprocessor can directly access, used to store system and user programs and data. It can be located inside or outside the microprocessor, with a capacity ranging from 256KB to 1GB, depending on specific applications. Generally, on-chip memory has a small capacity and fast speed, while off-chip memory has a large capacity.

Common types of memory used as main memory include:

ROM types such as NOR Flash, EPROM, and PROM.

RAM types such as SRAM, DRAM, and SDRAM.

3> Auxiliary Storage

Auxiliary storage is used to store large amounts of program code or information. It has a large capacity but is much slower to read compared to main memory, used for long-term storage of user information.

Common external storages in embedded systems include hard disks, NAND Flash, CF cards, MMC, and SD cards.

2.1.3 General Device Interfaces and I/O Interfaces

Embedded systems need a certain form of general device interfaces for interaction with the outside world, such as A/D, D/A, and I/O. Peripherals achieve input/output functions of the microprocessor through connections with other devices or sensors outside the chip. Each peripheral usually has only a single function and can be either external or built-in. There are many types of peripherals, ranging from simple serial communication devices to very complex 802.11 wireless devices.

Common general device interfaces in embedded systems include A/D (analog/digital conversion interface), D/A (digital/analog conversion interface), and I/O interfaces such as RS-232 (serial communication interface), Ethernet, USB (Universal Serial Bus interface), audio interfaces, VGA video output interfaces, I2C (field bus), SPI (serial peripheral interface), and IrDA (infrared interface).

2.2 Intermediate Layer

The intermediate layer between the hardware layer and the software layer is also known as the hardware abstraction layer (HAL) or board support package (BSP), which separates the upper software from the underlying hardware. This allows the lower-level drivers to be independent of the hardware, and upper software developers do not need to care about the specific conditions of the underlying hardware, developing according to the interfaces provided by the BSP layer. This layer generally includes the initialization of related lower-level hardware, input/output operations, and configuration functions of hardware devices.

BSP has the following two characteristics:

Hardware relevance: Because the hardware environment of embedded real-time systems is application-specific, BSP, as the interface between upper software and hardware platforms, needs to provide methods for operating and controlling specific hardware for the operating system.

Operating system relevance: Different operating systems have their own software hierarchy, thus different operating systems have specific forms of hardware interfaces.

In fact, BSP is a software layer between the operating system and the underlying hardware, including most software modules closely related to hardware in the system. Designing a complete BSP requires completing two parts of work: initializing the hardware of the embedded system and designing hardware-related device drivers.

2.3 Software Layer

2.3.1 System Software Layer

The system software layer consists of real-time multitasking operating systems (RTOS), file systems, graphical user interfaces (GUI), network systems, and general component modules. RTOS serves as the foundation and development platform for embedded application software.

2.3.2 Application Software Layer

The application software layer consists of applications developed based on real-time systems to implement control functions for controlled objects. The functional layer faces the controlled objects and users, often requiring a friendly human-computer interface for user convenience.

3 Initialization of Embedded Systems

The system initialization process can be divided into three main stages, in the order from bottom to top, from hardware to software: chip-level initialization, board-level initialization, and system-level initialization.

3.1 Chip-Level

This completes the initialization of the embedded microprocessor, including setting the core registers and control registers of the embedded microprocessor, the core working mode of the embedded microprocessor, and the local bus mode of the embedded microprocessor. Chip-level initialization gradually sets the embedded microprocessor from the power-on default state to the working state required by the system. This is a purely hardware initialization process.

3.2 Board-Level

This completes the initialization of other hardware devices outside the embedded microprocessor. Additionally, it sets certain software data structures and parameters to establish the hardware and software environment for subsequent system-level initialization and application program operation. This is an initialization process that includes both software and hardware.

3.3 System-Level

BSP will transfer control of the embedded microprocessor to the embedded operating system, which will complete the remaining initialization operations, including loading and initializing hardware-independent device drivers, establishing system memory areas, and loading and initializing other system software modules such as network systems and file systems. Finally, the operating system creates an application environment and transfers control to the entry point of the application program.

4 Project Management Process

Embedded system project management is divided into: project initiation -> project planning -> project implementation -> project closure -> project maintenance.

The specific nodes are as follows:

Product project report -> product feasibility analysis report -> preliminary design (preparing the preliminary schedule) -> detailed hardware design -> detailed software design -> detailed structural design -> prototype production -> software self-test (verification phase) -> “Test Outline” and testing -> forming production documents -> document archiving -> small batch trial production -> mass production -> final document archiving.

5 Development Process

Project requirements -> system proposal (proposal review) -> proposal design (design specification) -> hardware and software development (development documentation) -> principle prototype (test report) -> engineering prototype (test report) -> type test or certification (test summary report or certification document) -> R&D phase acceptance.

6 Productization Process

Design data import (Sch, PCB, Gerber, BOM, CAD, etc.) -> production process documentation (gerber, SMT, BOM (COST Down), work instructions) -> testing documentation (testing requirements, testing records, product inspection standards, etc.) -> yield rate (first pass rate, yield rate, pass rate, etc.) -> after-sales quality tracking -> quality issue feedback and continuous improvement -> version iteration.

7 Hardware and Software Integration Practical Examples

7.1 Core system self-check (abnormal process handling indication)

7.2 Peripheral initialization (GPRS power-up timing; power distribution)

7.3 Working state switching (register flipping, hardware defect compensation, leakage control, etc.)

7.4 Interrupt handling (overvoltage and overcurrent protection, abnormal handling)

7.5 Circuit component-level reliability design (I2C dead loop issue: defect of single condition judgment, requiring timer involvement)

7.6 System-level reliability design (communication command redundancy, global reset command second sending)

7.7 Simple applications (A/D accuracy (12BIT -> 10BIT))

7.8 Improving cost-effectiveness (button debounce, electrostatic protection (hardware inherent characteristics))

7.9 Function expansion and reuse (variable frequency buzzer (PWM), variable frequency LED, etc. (hardware function expansion))

7.10 Advanced applications (image compression, MPEG-1, -2, -4, H.263, H.264, digital filtering, uV-level amplification filter circuit design)

Leave a Comment

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