ARM development steps (to & from favorites)

Source: Internet
Author: User
ARM development steps
1. make a minimal system board: If you have never done arm development, we recommend that you do not have to be greedy for perfection at the beginning and do all the applications well, because the arm startup method is different from that of DSP or single chip microcomputer, we often encounter various problems. Therefore, we recommend that you first deploy a small system board with only Flash, SRAM or SDRAM, CPU, JTAG, and reset signals, and set aside extended interfaces. To make the minimum system run normally, your task is half done. Fortunately, the peripheral interfaces of arm are basically standard interfaces. If you already have the hardware wiring experience, this is an easy task for you.

2. Write startupCodeAccording to the hardware address, write a small code that can be started, including the following:
Initialize the port and block the interruption.ProgramCopy the data to the SRAM file, remap the code, configure the interrupt handle, and connect to the C language portal. You may see many things in some examples, but do not be troubled by these complicated programs, because you are not a Development Board, your task is to build a small program so that your application can run.

3. carefully study the information on the chips you use. Although arm is compatible with the kernel, each chip has its own characteristics. These issues must be considered when programming. Especially girls, don't be dependent here. They always want to modify others' sample programs, but the changes get messy.

4. Read more operating system programs and open them in arm applications.Source codeThere are a lot of programs. To improve yourself, you must look at other people's programs, such as Linux, uC/OS-II, and so on.

6. If you are working on hardware, each manufacturer basically has a demo board schematic diagram for the chip. Digest the schematic diagram first. In this way, you will be aware of the allocation of resources in future design. The datsheet of the device must be properly digested.

7. If you do software, you 'd better understand the operating system mechanism. Of course, this is a piece of cake for software engineers. However, it would be a bit difficult if it was born from hardware.
Q: Is the minimum system board good at Layer 2 or Layer 4?
Answer: Only at91 can use two-layer boards, and the other can have at least four layers. The ground and power supply of 44b0 can also be well processed by Two-layer boards;
Four-layer plates and 33 euro resistance:
The selection of four layers is not only a problem of power supply and ground, the high-speed digital circuit has requirements on the line impedance, the second layer board is not good to control the impedance. The 33-euro resistor is usually added to the drive end, and also acts as an impedance matching. When wiring, you must first deploy the data address line and the high-speed line to be guaranteed;
In high frequency, the cabling on PCB must be regarded as transmission lines. The transmission line has its own characteristic impedance. Anyone who has learned the transmission line theory knows that when an impedance mutation (unmatched) occurs somewhere on the transmission line, the signal passes through reflection, reflection causes interference to the original signal. In severe cases, the normal operation of the circuit will be affected. When a four-layer board is used, the outer layer usually follows the signal line, and the middle two layers are respectively the power supply and ground plane. In this way, two signal layers are isolated, more importantly, the outer wires form a transmission line known as a "microstrip" (microstrip) with the plane they are near. Its impedance is fixed and can be calculated. It is difficult to achieve this for two-layer boards. This transmission line impedance is mainly related to the width of the wire, the distance to the reference plane, the thickness of copper, and the characteristics of Dielectric Materials. There are many formulas and procedures available for calculation.
The 33-euro resistance is usually connected at one end of the drive (in fact, not necessarily 33-euro, from a few euro to five or 60 Euro, depending on the specific situation of the circuit ), the function of this function is to connect the output impedance of the transmitter and then match the Strip impedance, so that the signal reflected back (assuming that the receiver impedance is not matched) will not be reflected back (absorbed) again ), in this way, the signal at the receiving end will not be affected. The acceptor can also be used for matching. For example, the resistor is used in parallel, but it is rarely used in the digital system because it is troublesome, and many times it is a single-node multi-reception, such as the address bus, which is easier to do than source-end matching.
The high frequency mentioned here is not necessarily a circuit with a high clock frequency. Is it not just a high frequency, but more importantly, a signal increase or decrease time. Generally, we can estimate the frequency of the circuit by using the ascending (or descending) Time. Generally, we take the last half of the ascending time. For example, if the ascending time is 1ns, the reciprocal is 1000 MHz, that is to say, the design of the circuit is based on the MHz band. Sometimes it is necessary to deliberately slow down the edge time, and the output slope of many high-speed ICS is adjustable.

Construct embedded Linux

Linux has a complete set of tool chains, so it is easy to build the development environment and cross-run environment of embedded systems on its own, and can overcome the obstacles of simulation tools (ICE) in embedded system development. The full openness of the kernel allows people to design and develop real-time hardware systems by themselves, which is also easy to implement in Linux. The powerful network support allows Linux network protocol stack to be developed into an embedded TCP/IP network protocol stack.
Linux provides the basic kernel for embedding and all the user interfaces required. It can process embedded tasks and user interfaces.
A small embedded Linux system only requires the following three basic elements:
* Pilot tool
* The Linux microkernel consists of memory management, process management, and transaction processing.
* Initialization process
If you want it to do something and keep it small, you need to add:
* Hardware driver
* One or more applications that provide the required functions.
To add more features, you may need:
* A File System (maybe in ROM or RAM)
* TCP/IP network stack
Next we will introduce the actual development of embedded Linux from four steps: streamlining the kernel, starting the system, changing the driver program, and changing X-window to Microwindows.
Streamlined Kernel
Common commands used to construct the kernel include make config, DEP, clean, mrproper, zimage, bzimage, modules, and modules_install. Command description.
Here is an example:
I am using 2.2.15 included in the mandrake. I didn't modify any program code line. I only needed to modify the configuration file to get the data.
First, use make config to get all the options that can be removed.
Do not floppy; Do not SMP, mtrr; Do not networking, SCSI; remove all Block devices, leaving only the old ide device; remove all character devices; remove all filesystems, leave only minix; do not support sound. Believe me, I have removed all the options. After doing so, I got a 188 K core.
Isn't it small enough? OK. In addition, replace-O3 and-O2 in the following two files with-OS.
./Makefile
./ARCH/i386/kernel/
Makefile
In this way, the entire core becomes 9 K and becomes 179 K.
However, I am afraid this core is difficult to use Linux functions, so I decided to add the network back. Add the network support in general and recompile it. The core is 189 KB. Adding a TCP/IP stack at 10 K seems to be a very computation business.
If there is a stack without a driver, I add the rtl8139 driver commonly used in the embedded board back to 195 KB.
If you need a DOS file system, the size is 213 KB. If minix is replaced by ext2, the size will grow to 222 K.
Linux requires about KB of memory ~ Between kb. 1 MB memory may be able to boot, but it is not very useful, because it is difficult to attach to the C library. 2 MB memory should be able to do something, but it will take more than 4 MB to execute a relatively complete system.
Because Linux's filesystem is quite large, it is about 230 K, accounting for 1/3 of the volume. Memory management accounts for 80 KB, which is similar to the sum of other core components. TCP/IP stack accounts for 65 k, and drivers account for 120 K. Sysv IPC accounts for 21 k, and can be removed if necessary. The core file should be smaller than 10 K.
What if we want to crop the core size? The answer is obvious, of course, the file system. Linux VFS simplifies the file system design. buffer cache and directory cache increase the system efficiency. However, these embedded systems are useless at all. If you can remove them, the core can be reduced to about 20 K. If you skip the entire VFS and directly write the file system as a driver type, you can reduce the K to about 50 K. The entire core is reduced to about KB.
System Startup
The system startup sequence and related files are still in the core source code directory. See the following files:
./ARCH/$ ARCH/boot/
Bootsect. s
./ARCH/$ ARCH/boot/setup. s
./Init/Main. c
Bootsect. s and setup. s
This program is the first program of Linux kernel, including the Linux Bootstrap program, but before explaining this program, you must first describe the actions of an ibm pc when it is started ").
Generally, when a PC is powered on, it is executed from the memory address FFFF: 0000 (this address must be in the rom bios, And the rom bios is usually in feoooh to fffffh ), here, the content is a jump command, which is located in the rom bios and starts to execute a series of actions.
After the system test code, the control is transferred to the boot program (ROM Bootstrap routine) in the Rom ). This program will read the zeroth sector of the disk into the memory. Where can it read the memory? -- Absolute position 07c0: 0000 (that is, 07c00h), which is a feature of the IBM series PC. The Boot Sector on the Linux boot disk is the Linux bootsect program.
Compare the well-known ms dos with the Linux boot section. Ms dos is loaded into the memory by the boot program located in the boot sector on the disk, Io. sys is responsible for loading the DOS kernel-msdos. sys into the memory. In Linux, The bootsect program located in the boot sector is responsible for loading setup and Linux kernel into the memory, and then giving control to setup.
Driver
In Linux, the entry points provided by the device driver are described to the system by a structure.
The entry point provided by the device driver registers with the system when the device driver is initialized so that the system can call it as appropriate. In Linux, you can call register_chrdev to register the drivers for devices.
In Linux, in addition to directly modifying the source code of the system core and adding the device driver to the core, you can also use the device driver as a module that can be loaded, the system administrator dynamically loads it to make it a part of the core. The system administrator can also dynamically uninstall the loaded modules. In Linux, the module can be written in C language and compiled into the target file using gcc (no link exists as a *. o file ). Therefore, the-C parameter must be added to the GCC command line. After successfully registering the device driver with the system (after successful register_chrdev call), you can use the mknod command to map the device into a special file. When other programs use this device, they only need to perform operations on this special file.
Change X-window to Microwindows
Microwindows uses a hierarchical structure. Different layers can be changed to adapt to actual applications. On the bottommost layer, screen, mouse/touch screen, and keyboard drivers are provided to allow the program to access actual hardware devices and other customized devices. On the middle layer, there is a lightweight graphics engine that provides methods to draw lines, fill areas, draw polygon, crop, and use color modes. At the top layer, different APIs are provided for graphic applications. These APIs can provide or do not provide desktop and window shapes. Currently, Microsoft Windows supports windows Win32/wince GDI and nano-x APIs. These APIs provide close compatibility between Win32 and X Window systems, so that other applications can be easily transplanted to Microsoft Windows.
What is an embedded system?
The embedded system is defined: A dedicated computer system centered on applications, based on computer technology, where software and hardware can be tailored to the functional, reliability, cost, volume, and power consumption requirements of the application system.
Embedded systems are user-oriented, product-oriented, and application-oriented. If they develop independently of applications, they will lose the market. The power consumption, volume, cost, reliability, speed, processing capability, and electromagnetic compatibility of embedded processors are all restricted by application requirements. These are also the hot spots of competition among Semiconductor manufacturers. The application software of the embedded processor is the key to implementing the functions of the embedded system. Software requires solid storage, software code requires high quality, high reliability, high real-time system software (OS) is the basic requirement.
It is an application field of Embedded Computer in manufacturing industry, process control, communication, instruments, instruments, automobiles, ships, aviation, aerospace, military equipment, and consumer products.

Connection: http://www.embed.com.cn/bbs/dispbbs.asp? Boardid = 17 & id = 11570 & page = 1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.