Realization of wireless network function of USB network card based on S3C2410 processor

At present, embedded technology has been widely used in various market products such as industrial control, consumer electronics, and communication systems. And with the increasing development of the Internet, embedded systems with wireless access functions have more prospects for development. This article will introduce the application of the 54M USB wireless network card supporting the IEEE 802.11g protocol in the embedded system. The embedded system uses the S3C2410 processor of the ARM9 series.

Authors: Wu Yongkang, Zhang Dong, Yang Chengzhao

At present, embedded technology has been widely used in various market products such as industrial control, consumer electronics, and communication systems. And with the increasing development of the Internet, embedded systems with wireless access functions have more prospects for development. This article will introduce the application of the 54M USB wireless network card supporting the IEEE 802.11g protocol in the embedded system. The embedded system uses the S3C2410 processor of the ARM9 series.

1 System hardware architecture

1.1 System structure

The overall structure of the system is shown in Figure 1.

Realization of wireless network function of USB network card based on S3C2410 processor

The system core chip uses Samsung’s S3C2410 processor, which is a Samsung’s 16/32-bit RISC embedded microprocessor based on the ARM920T core. It is mainly for handheld devices and cost-effective, low-power applications. The frequency can reach 203MHz. The processor integrates many important functional modules and supports multiple buses. The processor integrates a USB HOST controller and supports two USB HOST communication ports.

The system uses 64M NAND FLASH as a storage device, which stores the BOOTLOADER, LINUXKERNEL, and FILESYSTEM necessary for the system software. The serial port, USBDEVICE interface, and JTAG interface in the system are mainly used during development and debugging. The system exchanges man-machine information through TOUCH&LCD to meet the needs of a wide range of consumer Electronic products.

The wireless network card is the key equipment of this mobile terminal. In view of the fact that most of the llM wireless network cards on the market have been discontinued or will be discontinued, and the society’s demand for embedded devices with higher network access performance, we choose the chipset model rt2573 54M wireless network card. Since the S3C2410 processor has integrated the USB HOST controller, there is no need to attach an additional chip, and the network card can be directly connected through the USB HOST PORT, which is very convenient.

1.2 Hardware realization of USB host interface

In the USB system, if various USB devices are to be connected to the host, they must be connected to the Fengji through a common interface. This interface is the USB Host Controller. The USB bus protocol defines four signal lines, two of which are responsible for power supply, and the other two signal lines are responsible for data transmission. The USB communication model is a Host-Slave (host-peripheral) master-slave structure, so one of the two parties communicating via the USB bus must play the role of the host (HOST) in the communication control.

The USB interface can obtain a current of 500mA from the host, and supports hot plugging, truly plug and play. A USB interface can support both high-speed and low-speed USB peripheral access. There is a 4-core cable connection, two of which are positive and negative power supplies, which transmit 5V power, two are data transmission lines, and the data lines are simplex. The data rate in the entire system is constant, either high-speed or low-speed.

The S3C2410 processor integrates a USB HOST controller, which can be directly drawn from the CPU without adding an additional control chip. Figure 2 shows the system’s USB HOST interface expansion. S3C2410 processor can support two USB HOST communication ports.

Realization of wireless network function of USB network card based on S3C2410 processor

2 The realization of USB network card wireless network function

2.1 Realization of the software management layer of the wireless network card

After the hardware part of the embedded system is established, the software system needs to be established. This system uses vivi as the Bootloader (bootloader), embedded Linux as the operating system, Cramfs as the main file system, and Jffs2 file system to support read and write functions. Next, the function of the wireless network card needs to be implemented in software.

The software of the wireless network card includes three parts: the wireless network card firmware (Firmware), the wireless network card driver (Driver) and the wireless network card configuration management program.

The software realization structure diagram of the wireless network card is shown as in Fig. 3. The firmware is the most basic control system on the wireless network card, which is mainly based on the MAC chip to realize the control and management of the entire network card, and provides an interface with the physical layer downwards and a program development interface upwards to develop additional mobile host applications for the program The program provides support. In an embedded system, the services provided by IEEE802.11, including authentication, de-authentication, login, and re-login, are all completed by firmware.

Realization of wireless network function of USB network card based on S3C2410 processor

The driver of the wireless network card uses the software programming interface provided by the firmware to control the wireless network card, and cooperate with the firmware to complete the sending and receiving of data and the processing of information frames. The wireless network card driver is mainly designed for the corresponding wireless network card chip. Different chips have great differences in their firmware and register-related settings. In addition to completing the control of the lower layer, the wireless network card driver must also provide an application programming interface for operating and configuring the wireless network card to the upper application and management program to realize its network transmission function.

All Linux network drivers follow a common interface. The design adopts an object-oriented approach. A device is an object (device structure), which has its own data and methods inside. The first parameter of each device method when it is called is the device object itself, so that this method can access its own data (similar to this reference in object-oriented programming). The most basic methods of a network device are initialization, sending and receiving. As shown in Figure 4.

Realization of wireless network function of USB network card based on S3C2410 processor

The initialization program completes the initialization of the hardware, the initialization of the variables in the device and the application of system resources. The sending program is automatically called when there is data to be sent in the upper protocol layer of the driver. Generally, the sending data is not buffered in the driver, and the sending function of the hardware is used directly to send the data. The received data is generally notified through hardware interrupts. In the interrupt handler, fill the hardware frame information into a skbuff structure, and then call netif_rx() to pass it to the upper layer for processing.

The wireless network card driver interface of this system mainly implements the following interface functions:

Realization of wireless network function of USB network card based on S3C2410 processor

The wireless network card configuration management program uses the information query and setting interface provided by the driver to provide users with the status of the wireless network card in real time. At the same time, the management software can realize the necessary configuration of the wireless card parameters such as IP and SSID. Common wireless network card configuration management programs include iwconfig, iwlistt, iwspy, iwpriv, etc. Here are a few main wireless network card configuration management programs:

・Iwconfig: The main wireless management tool, used to view the device configuration and most of the wireless network parameters.

・Iwlish: Used to view most of the parameters that cannot be displayed by the iwconfig tool, such as: bit rate, frequency, etc.

・Impriv: Operate the unique management and control functions provided by the wireless network card driver.

・Iwgetid: Output the ESSID or NWID of the specified device.

2.2 Configuration and activation of wireless network card

To complete the configuration and activation of the wireless network card, first of all, you should set the configuration file and compile the driver to generate the firmware and driver module of the wireless network card. Put the firmware and configuration files in the /etc/Wireless/RT73STA/ folder of the file system.

The main configuration of Rt73sta.dat is as follows:

・NetworkType=Infra/*Since the AP access mode is selected, the network type is Infra*/

・SSID=TPLINK/* SSID/ESSID (Service SetIdentifier) ​​is the abbreviation of “Service Set Identifier” and “Service Set Identifier”, and can have up to 32 characters. It is just like the “workgroup” logo in the wired LAN or a password between the wireless client and the wireless router. Only under the same premise can the wireless network card access the wireless router, which also guarantees the wireless network One of the important measures of safety. Set it to the SSID on your AP here. */

・WirelessMode=0/*The number 0 means that the 11b/g protocol is supported at the same time. */

・TxRate=12/*The number 12 indicates that the transmission speed of 54M is selected. */

Except by modifying the configuration file, most of the parameters can be set directly through the iwconfig tool. At this point, you can start the wireless network card through ifconfig. Ifconfig usb0 192.168.100.99 up. After startup, you can view the network connection status through the ping command.

Realization of wireless network function of USB network card based on S3C2410 processor

It introduces in detail the extension method to realize the wireless access network function of embedded Linux system based on S3C2410 processor, and the realization of hardware and software is described in detail. The realization of wireless access function makes embedded systems have a broad development space and application prospects in the electronic consumer world where network applications are developing rapidly. The system uses 54MBPS wireless network card, which greatly enhances the network access capability of the embedded system and makes it more competitive.

The Links:   CM150DC1-24NF KCS057QV1AJ-G32 MY-IGBT

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *