1 Hardware design requirements
According to system requirements, the core processor of the hardware circuit part adopts Samsung's S3C2440. This device is based on the arm920T core and has a main frequency of 400 MHz. It is one of the embedded 32-bit processors with a relatively high cost performance. The S3C2440 microprocessor has rich internal resources, including an LCD controller, SDRAM controller, 4-channel DMA, etc. The storage system of the development board is divided into two parts: SDRAM and Flash. The SDRAM storage system uses two external 32M-byte SDRAM chips with a total of 64M bytes, whose model is HY57V561620FTP. This part is usually called memory. The two SDRAM chips are combined to form a 32-bit wide data bus, which increases the data access speed; the development board has two types of Flash: one is Nor Flash with model SST39VFl60l, which is 2M bytes in size; the other is Nand Flash with model K9F1208, which is 64M bytes in size; the network card chip used in the development board is DM9000, which is adaptive to 10/100M network. The RJ45 connector already contains a coupling coil, so there is no need to connect a network transformer on the development board. The development board can be connected to the Internet network through a network cable to realize embedded Web services. In addition, it also includes power supply, crystal oscillator, JTAG debugging port, and basic input and output ports. The embedded hardware design block diagram is shown in Figure 1.
2 Principle of Embedded Web Server BOA
BOA is a very compact Web server with open source code, excellent performance, and support for CGI general gateway interface technology. It is particularly suitable for use in embedded systems. The main function of the BOA server is to exchange information between interconnected embedded devices, monitor embedded devices through the network, and automatically upload feedback information to the main control device. It is based on the HTTP hypertext transfer protocol, and Web pages are the most basic transmission unit of Web services. The work of embedded Web services is based on the client/server computing model, consisting of a Web browser (client) and a Web server (server), which is also the famous B/S structure. The browser running on the client must first establish a connection with the embedded Web server BOA end and open a socket virtual file. The establishment of this file indicates that the SOCKET connection is successfully established. Then the client browser submits a request to the Web server through the socket SOCKET in the form of GET or POST parameter transmission. After the Web browser submits the request, it is transmitted to the Web server through the HTTP protocol. After receiving the request, the Web server performs transaction processing according to the request, returns an HTML file or calls an external application through CGI, and returns the processing result. The server interacts with external applications and scripts through CGI. According to the method adopted by the client browser when making a request, the server will collect the information provided by the client and send the information to the specified CGI extension program. The CGI extension program processes the information and returns the result to the server. Then the server analyzes the information and sends the result back to the client to display it on the browser.
3 Embedded Web Server BOA Transplantation
First, the Web server BOA is to run on an ARM embedded device, so the BOA source file needs to be cross-compiled. The compilation tool uses the arm-linux-gcc-4.3.2 cross-compilation tool chain. Copy the file arm-lin-ux-gcc-4.3.2. tgz to the directory /tmp, and execute the command cd /tmp; tar zxvfarm-linux-gcc-4.3.2. tgz -C /. In this way, the cross-compilation tool is installed in the /usr/local/arm/4.3.2 directory. To ensure that the cross-compilation tool chain can be directly applied after opening the terminal, it is necessary to create a new directory in /root/. bashrc file, add the compiler path to the system environment variable. Run the command gedit/root/.bashrc to edit the file /root/.bashrc. Add export PATH=$PATH:/usr/local/arm/4.3.2/bin at the end of the file. Save and exit. Then execute the source/root/.bashrc command to make the settings effective. Finally, check whether the cross-compilation tool is installed successfully. The command is to enter arm-linux-gcc-v in the terminal; if you can see the arm-linux-gcc version number 4.3.2 in the output information, it means that the installation is successful.
Secondly, cross-compile BOA source code, copy the BOA source code package boa-0.94.13.tar.gz to the /tmp directory, and decompress the mask package tar zxvf boa-0.94.13.tar.gz; after decompression, enter the directory where BOA is located in the Linux terminal and first execute the command. /con-figure to generate a Makefile file, then open the folder, find the Makefile file, open it with a text editor, find the two lines CC=gcc and CPP=gcc-E, and set them to the cross-compilation tool paths CC=/usr/local/arm/4.3.2/bin/arm-linux-gcc and CPP=/usr/local/arm/4.3.2/bin/arm-linux-gcc-E generated in the previous step, respectively. Then save the Makefile and exit, return to the terminal and execute the make command to cross-compile to get the executable program BOA, which is the executable file that can run on the arm embedded device. You can view the file information through the command fileboa. Copy this BOA file to the target board /bin directory.
Again, configure the boa server. The main purpose of configuring BOA is to enable it to support the execution of CGI programs. Create a BOA directory in the /etc directory of the file system with mkdir boa, copy the boa.conf file in the BOA source directory to the /etc/boa directory of the file system, and then modify it based on this configuration file according to the needs of the embedded BOA. When modifying this configuration file, you need to ensure that other files and settings must be consistent with the configuration file, otherwise the embedded Web server BOA cannot run normally. The main configuration content of the boa.conf file is shown in Figure 2.
4 Embedded Web Server BOA Transplantation Test
The purpose of the test is mainly to verify whether the embedded Web server BOA transplantation and configuration are correct and whether it can work normally. According to the content of the above configuration file boa.conf, create a www directory under the file system directory /var to store HTML documents and image resources required by HTML documents. Create a /www/cgi-bin directory to store CGI programs. [page]
1) Make a Web test page The Web test page is mainly completed by Html language and Javascript script language. Create a new text document and enter the web page code as shown in Figure 3.
Save this file and rename it to index.html. Copy this Html file to the target board /vat/www/ directory. Assume that the development host and the target board are in the same LAN and there is no network failure. The target board IP address is set to 192.168.1.156. Run the browser on the host to perform BOA page test. Enter the IP address 192.168.1.-1 in the browser address bar, and you can see the Web test page as shown in Figure 4.
2) CGI script test Open a terminal on the target board and enter the command
viceshi.cgi to create a new script file and enter the code shown in Figure 5.
:wq Save this script file and copy it to the /var/www/cgi-bin directory, and change the execution permission of this file with chmod+x ceshi.cgi. Then enter the http://192.168.1.156/cgi-bin/ceshi.cgi address in the host (client) browser. After testing, it meets the functional requirements.
5 Conclusion
This paper implements the transplantation of the embedded BOA Web server on the arm9 target board to realize the remote management of microcomputers in various control fields, and passes the post-transplantation test. The successful transplantation of the embedded BOA provides conditions for future applications in specific life and industrial sites, and facilitates the development of future Web application projects.
Previous article:Design of filament power supply for electron beam welding machine based on ARM
Next article:A method for improving the security and stability of UC/OS-II operating system
Recommended ReadingLatest update time:2024-11-16 14:52
- Popular Resources
- Popular amplifiers
- Network Operating System (Edited by Li Zhixi)
- Virtualization Technology Practice Guide - High-efficiency and low-cost solutions for small and medium-sized enterprises (Wang Chunhai)
- Practical Deep Neural Networks on Mobile Platforms: Principles, Architecture, and Optimization
- ARM Embedded System Principles and Applications (Wang Xiaofeng)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- MSP430F5438 study notes FLAHS operation
- Wiring diagram of Hall current sensor
- Application of switch Hall sensor DRV5032 in TWS headset design
- Some learning experiences of NBIoT
- EEWORLD University Hall ---- Digital Signal Processing Beihang Wang Jun
- Application analysis of CC1310 low power consumption advantage
- I am currently using powerSTEP01 to drive a 86mm stepper motor. Does anyone have a driver for this chip?
- C6000 Program Optimization Process and Method
- "Analog input signal" protection circuit
- Simple---a TMS320F28035 key driver