Today’s consumer electronics, networking and communication devices are small and highly sophisticated computers (or Systems-on-Chips; SoCs). Each chip contains numerous peripherals and special features that require the right software and drivers to drive them correctly and efficiently. In this article, I am going to describe in high level the system’s hardware components and the system’s software components. I will also describe what they do in high level. This article is meant for people who want to get a high level introduction to the Real-Time Embedded systems.
The System’s hardware in high-level
A final product is based on an optimal board design, which is usually small and contains only the minimum hardware that is required for it. However, development boards (EVMs) are usually larger and contain many debug ports and additional hardware to support the development. An example for it, is the JTAG port which allows to connect a hardware emulator (debugger) that connects a special software in the PC to the target board and allows the user to read and modify memory and registers, and debug the system (steps, breakpoints, etc.). Another useful debug port is the serial console port (RS232) which allows the running programs to display information and logs on the console. There are cases where vendor remove these ports in the final product in order to reduce manufacturing costs and prevent access to hackers.
A typical system, as seen in the picture is usually composed of the following items:
- A target CPU: There are many target CPUs available today, each one with its own characteristics. The CPU is selected according to the requirements of the final product, such as processing power, power consumption, opcode compatibility and more.
- Main RAM: The main memory of the system which stores all the code and data in run-time. There are many types of RAM, such as SDRAM, DDR, DDR2, DDR3, etc. where each device has its own characteristics. Similarly to the CPU, the RAM device is selected according to the system’s requirements and limitations.
- Storage device: Many embedded systems store the code in a storage device such as a Flash device or a Disk. There are many types of devices in various speeds, capacities and data retention abilities.
- Power connector: Some boards require DC voltage in order to operate, in this case, they will be provided with an external power supply unit and the power connector’s shape will be round. Other designs has a built-in power supply and need to be connected directly to the mains power. In such designs, the board will have large capacitors and coils to convert and regulate the power. Note that in this case, you need to make sure that the mains voltage in your location matches the board design (connecting 220v to a 110v design could cause electric shock!). Moreover, this design exposes you to electrical shock if you’ll touch the power supply area, so be careful.
- Expansion sockets: Various board designs implement expansion sockets, such as eSATA, PCIe and other proprietary connections that allows the user to enhance the features of the board with minimum hardware changes (for example, connect an LCD display or another Chip).
- Debug ports: Such as Serial port (console, RS-232), JTAG port or any other port.
- Communication ports: The board in the picture features an Ethernet port, a 4-port Ethernet switch, and a USB host port. Other consumer electronics devices might have different types of ports, such as coaxial, optical, telephony, USB device or any other proprietary port (like in Apple’s devices). Wireless board devices also contain one or more antennas.
- Reset button: Most boards contain such a button, which resets the system, without the need to physically power-cycle it.
- LEDs: Most board design contain one or more LEDs (Light-Emitting-Diodes). These small lights are used as indication or action marks that signal a specific activity, according to the design of the system.
The System’s software in high-level
Now that we have reviewed the hardware in high-level, let’s review the software in high-level. A typical system is composed of the following components:
- A boot-loader: A short binary code which initializes the basic hardware, and prepares the system for the Operating System startup. The boot-loader usually resides in the first sector(s) of the flash (or storage device) and it is usually very small in size (typically 64KB – 128KB).
- An image: A binary image which contains all the code that runs the product. In some cases, the image is composed of a big linked-executable file, and in other cases (such as Linux OS), the image is made of a Kernel and one of more file-systems which hold all the programs and files. Some products require that there will be two images stored on the storage device, for backup and reliability reasons (to cover a case where the first image gets corrupted for any reason).
- Miscellaneous: The storage device can contain other parts, such as parameter sectors which can be stored in small sectors on the top or bottom of the flash device (depends on the flash support), or environment variables that configure the boot-loader (used by u-boot). Other systems might have some other miscellaneous blocks for their own special requirements.
A typical boot process
When powering up the board, the boot ROM code inside the chip does the most basic hardware setup and jumps to the first address of the storage device. This address contains the first command of the system’s boot-loader. In its turn, the boot-loader initializes the hardware which is required for the board setup, like memory controller, Ethernet port, Serial port or any other system specific peripheral. Once the hardware is initialized, the boot-loader loads the image which implements the system’s functionality. There are many variations for this stage, depending on the system type and usage. In some systems, the boot-loader uncompresses the compressed image to the RAM and jumps to the first address of the uncompressed image. Systems which run Linux usually skip this stage because the image contains a strap code which is attached to the start of the image, that does the uncompression work. Other systems load the image through the network (usually with TFTP) or through another standard or proprietary bus.
Once the boot-loader jumps to the image’s first address, it is no longer active, and the control is passed to the Operating system. The boot process of an OS is usually very complex and there are many books about the subject. In general, it initializes the OS sub-systems (such as memory management, file systems, etc) and initializes the rest of uninitialized hardware by calling the drivers’ init functions.
Once the OS has finished its initialization, it starts all the system’s programs or tasks which implement the product’s functionality.
|Check out the ads, there could be something that may interest you there. The ads revenue helps me to pay for the domain and storage.|