For the development of ARM-Linux programs, it can be mainly divided into three categories: application development, driver development, and system kernel development. Each type of software development has its unique characteristics. Today, let’s explore the differences between ARM-Linux development and MCU development, as well as the basic development environment for ARM-Linux.
1. Differences Between ARM-Linux Application Development and MCU DevelopmentFirst, it should be noted that there are mainly two ways to develop applications for ARM: one is to develop applications directly on the ARM chip without using an operating system, also known as bare-metal programming. This development method is mainly used for some low-end ARM chips and is very similar to MCU development, which will not be elaborated here.
The other way is to run an operating system on the ARM chip, requiring corresponding driver programs for hardware operations. Application development is based on the operating system, and this method of embedded application development is quite different from MCU development. The main differences between ARM-Linux application development and MCU development are as follows:
(1) Different Hardware Devices for Application Development EnvironmentMCU: Development board, emulator (debugger), USB cable; ARM-Linux: Development board, network cable, serial cable, SD card; for ARM-Linux development, there is usually no hardware debugger, especially during application development, where hardware debuggers are seldom used. Debugging is mainly done through the serial port; however, it should be noted that there are hardware emulators for ARM chips, but they are usually used for bare-metal development.
(2) Different Program Download MethodsMCU: Download via emulator (debugger) or serial port;
ARM-Linux: Serial port download, tftp network download, or directly reading and writing to SD, MMC cards, etc., to achieve program download; this is directly related to the hardware devices in the development environment. Due to the absence of hardware emulators, ARM-Linux development typically does not use emulators for downloading; while this may seem inconvenient, it actually provides more download methods for ARM-Linux application development.
(3) Different Hardware Resources of ChipsMCU: Usually a complete computer system, including on-chip RAM, on-chip FLASH, and various peripherals such as UART, I2C, AD, DA;
ARM: Typically only the CPU, requiring external circuits to provide RAM for normal ARM operation, with external circuits providing FLASH, SD cards, and other storage systems, and implementing various peripheral functions through external circuits. Due to the strong processing capability of ARM chips, various complex functions can be achieved through external circuits, far exceeding the capabilities of MCUs.
(4) Different Storage Locations for FirmwareMCU: Typically has on-chip flash memory, with firmware programs usually stored in that area. If the firmware is large, external circuit designs are needed to use external flash for firmware storage.
ARM-Linux: Because it does not have on-chip flash and needs to run an operating system, the entire system image is usually larger. Therefore, the operating system image and applications for ARM-Linux development are typically stored on external MMC or SD cards, or using SATA devices, etc.
(5) Different Boot MethodsMCU: Its structure is simple, with internal integrated flash, usually having fixed jump instructions added by the chip manufacturer to jump directly to the program entry point (usually in flash) when powered on; the developed application is compiled and directly downloaded to the corresponding address space using dedicated download tools; thus, after powering on, the system directly runs to the corresponding program entry point, achieving system startup.
ARM-Linux: Due to the use of ARM chips, which have high execution efficiency and powerful functions, and relatively rich peripherals, it is a powerful computer system that requires running an operating system. Therefore, its boot method is quite different from that of MCUs, but is fundamentally similar to that of home computers. Its startup generally includes stages like BIOS, bootloader, kernel startup, and application startup;
(a) BIOS Startup: BIOS is the corresponding startup information set by the device manufacturer (chip or circuit board manufacturer). After the device is powered on, it reads the relevant hardware device information, initializes the hardware devices, and then jumps to the location of the bootloader (a fixed location set by BIOS). (According to personal understanding, the BIOS startup is similar to the MCU startup, requiring the use of a corresponding hardware debugger to write firmware stored in a certain flash space. After powering on the device, it reads the instructions in the flash space to start the BIOS program.)
(b) Bootloader Startup: This part belongs to the embedded Linux software development section, where the bootloader program can be customized through code modification. Bootloader downloading is usually done by directly reading and writing to SD cards. That is, by writing a customized bootloader and compiling it into a bootloader image file, tools (dedicated or general) are used to download it to the MBR area of the SD card (usually the first sector of the storage area). At this point, it is necessary to set the BIOS or configure the circuit board’s hardware circuit to choose the loading position of the bootloader; if the BIOS is set to boot from the SD card, after the BIOS initialization is complete, it will jump to the SD card location to execute the bootloader, thus achieving bootloader startup. The main function of the bootloader is to initialize necessary hardware devices, create some information needed by the kernel, and pass this information to the kernel through relevant mechanisms, thus bringing the system’s software and hardware environment to a suitable state, ultimately calling the operating system kernel, truly performing the function of booting and loading the kernel.
(c) Kernel Startup: After the bootloader completes initialization and related tasks, it will call the kernel startup program. This marks the entry into the actual startup of the operating system, including relevant hardware configuration, task management, resource management, and other kernel program startups.
(d) Application Startup: After the operating system kernel starts, the required applications can begin to start, completing the actual business operations.
2. Basic Development Environment for ARM-LinuxHaving introduced the differences between ARM-Linux application development and MCU development, you should now have a basic understanding of ARM-Linux application development. Next, let’s introduce the basic development environment for ARM-Linux, which mainly includes hardware and software environments, using iMX53 and Ubuntu as examples.
(1) Hardware EnvironmentDevelopment board: The hardware environment for running ARM, or the corresponding project’s ARM circuit board;
Computer: Used as the development host, installing Linux (such as Ubuntu), or using a virtual machine to install Ubuntu;
Serial cable: Used for terminal serial debugging or program downloading during development;
Network cable: Used to connect the ARM board and the development host, enabling tftp download of the kernel (programs, etc.) and running programs via the network nfs. SD card (and card reader) or other storage devices: Used to store bootloader, kernel images, etc., as well as the final software system storage; during development, it is usually used to save the bootloader and guide system startup.
(2) Software EnvironmentUbuntu: As the operating system, it serves as the carrier for the entire software development environment, where all relevant development tools are set up.
LTIB: This is a compilation toolchain provided by Freescale that can conveniently compile source code files into suitable program code and debug programs; users can also build their own compilation toolchain by downloading the source code.
tftp: Used to download kernel files, application files, etc., from the development host Ubuntu to the ARM board.
nfs network file system: Used to establish a network nfs root file system on the development host, allowing the ARM board to read the virtual root file system on the development host and complete system startup; facilitating system development and debugging.
minicom: A serial debugging tool used for communication between the development host and the ARM board, enabling operation and debugging of applications on the ARM board;
Eclipse: An integrated development environment mainly for code editing, compiling, etc. DS5, RealView, or gedit can also be used for editing, and LTIB can be used for compilation and management.
Disclaimer:This article is original by the author, and the content reflects the author’s personal views. The Electronics Enthusiast Network reproduces it only to convey a different perspective and does not represent the Electronics Enthusiast Network’s endorsement or support of this view. If there are any objections, please contact the Electronics Enthusiast Network.
-
Xiaomi’s First Battle of the New Year! The Entire Mi 10 Series Supports Wi-Fi 6! Wi-Fi 6 Enters the Popularization Year
-
Smartphones Suffer, Tablets Unexpectedly Thrive, What Impact Does the Pandemic Have on the Electronics Supply Chain?
-
Keysight U5855A Infrared Thermal Imager Helps You Develop Sharp Vision
-
Frequent Acquisitions of WiFi Chips, 2020 Sparks a New Round of Competition!
-
“Mask Shortage”? Which Electronics Companies Have Started Cross-Industry Production of Masks?