Using Linux to develop an embedded system has different configuration development methods according to different application requirements, but generally it will go through the following processes:
1. Establish a development environment
Operating systems generally use RedHat-Linux, with versions ranging from 7 to 9. Select all customization or installation, download the corresponding GCC cross compiler through the network for installation (such as arm-Linux-gcc, arm-μclibc-gcc), or install the cross compiler provided by the product manufacturer.
2. Configure the development host
Configure MINICOM. The general parameters are baud rate 1 15 200bps, 8 bits of data, stop bit 1, no parity, and the hardware and software flow control is set to none. The configuration of HyperTerminal under Windows is the same. MINICOM software is used as a monitor and keyboard input tool for debugging embedded development board information output. Configuring the network, mainly configuring NFS network file system, requires closing the firewall to simplify the setup process of embedded network debugging environment.
3. Establish a boot loader.
Download some open source BOOTLOADER from the Internet, such as U-BOOT, BLOB, Li Meihui, LILO, ARM-BOOT, RED-BOOT, etc. And transplant and modify it according to your own specific chip. Some chips don't have a built-in boot loader, such as Samsung's ARM7 and ARM9 series chips, so you need to write a Flash program on the development board. There are free download programs of ARM peripheral Flash chips written by JTAG parallel port simple emulator on the internet, and there are also open source J-Flash programs under Linux. If you can't burn your own development board, you need to modify the source code according to your specific circuit. This is the first step in the normal operation of the system. If you buy a manufacturer's emulator, it will be easier to burn Flash, which can greatly improve the development speed for those who need to develop their own products quickly but can't understand the core technology.
4. Download the Linux operating system transplanted by others.
Such as μCLinux, ARM-Linux, PPC-Linux, etc. It would be better if there is a Linux operating system specially transplanted for the CPU used. After downloading, you can add your own specific hardware driver for debugging and modification. For CPU with MMU, the driver can be debugged in a modular way. For a system like μCLinux, it needs to be compiled into the kernel for debugging.
5. Establish the root file system
Download from www.busybox.net and use the pruning function of BUSYBOX software to generate a basic root file system, and then add other programs according to your own application requirements. The default startup script can't meet the needs of the application, so it needs to be modified in the root file system. Its storage location is located in the /etc directory, including: /etc/init.d/rc. s,/etc/profile,/etc/。 Introduction, etc. , and the file system configuration file /etc/fstab is automatically mounted. The specific situation will vary from system to system. In embedded systems, the root file system is generally set to read-only, and tools such as mkcramfs and genromfs need to be used to generate burned-in image files.
6. Establish the flash disk partition of the application.
JFFS2 or YAFFS file systems are usually used, which requires drivers for these file systems to be provided in the kernel. Some systems use 5 12kB ~ 32mB linear Flash(NOR type), some systems use 8 ~ 5 12mB nonlinear Flash(NAND type), and some two systems are used at the same time, so it is necessary to plan the partition scheme of Flash according to the application.
7. Develop applications
Applications can be put into the root file system, YAFFS and JFFS2 file systems. Some applications directly design applications and kernels without using the root file system, which is somewhat similar to μCOS-II.
8. Burn the kernel, root file system and applications.
9. Release products