Design of Network Interface Based on VxWorks on ARM7 Platform

Publisher:古通闲人Latest update time:2012-11-10 Source: 21ic Keywords:S3C44B0  VxWorks Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The VxWorks operating system has attracted much attention in embedded systems for its high reliability, excellent real-time performance, and flexible scalability, and is widely used in many industries. With the development of network technology, the combination of embedded technology and network technology has become inevitable. VxWorks is the first embedded real-time operating system to add TCP/IP protocol to its kernel. How to design a network interface based on VxWorks is the primary issue facing embedded developers. This design uses Samsung's ARM7 (S3C44B0) as the core CPU and develops a network interface under VxWorks, including hardware design and software implementation.

1 Hardware Design

The core CPU uses Samsung's S3C44B0. S3C44B0 uses the ARM7TDMI core, which greatly reduces the configuration of components other than the processor in the system circuit by providing comprehensive and general on-chip peripherals, thereby reducing system costs. The network interface chip uses the RTL8019AS produced by Realtek. It is a highly integrated Ethernet controller that not only integrates the performance of the MAC (media access control) sublayer and the physical layer, but is also compatible with NE2000, and has the advantages of strong software portability and low price.

The hardware interface principle of S3C4480 and RTL8019AS is shown in Figure 1. As can be seen from Figure 1, the enable terminal of RTL8019AS is connected to nGCS3 of S3C44B0, so its address is mapped on Bank3 of the system, and the base address is 0x06000000. RTL8019AS supports 8-bit/16-bit data bus, and 16-bit mode is used in this circuit.

RTL8019AS has 32 input/output addresses, and the corresponding address offsets are 0x00 to 0x1f. They are explained as follows:

①The 16 addresses from 0x00 to 0x0f are register addresses.

② The eight addresses from 0x10 to 0x17 are the data read/write port addresses. They are all the same, and each can be used as a data read/write port. You only need to use one of them.

③ The 8 addresses from 0x18 to 0x1f are reset ports. Their functions are the same. But please note that only the reset ports 0x18, 0x1a, 0x1c, and 0xle are valid. Do not use the others because some compatible cards do not support reset of odd addresses such as 0xl9, 0xlb, and Oxld.

When designing software, pay special attention to the following two points:

①The address lines of RTL8019AS are connected to ADDR1~ADDR5 of S3C4480 from SA0~SA4 in sequence. Therefore, the register address of RTL8019 needs to be shifted left by 1 bit.

②RTL8019AS uses EXINT1 interrupt and is triggered by the rising edge.

2 Software Implementation

2.1 VxWorks Network Protocol Stack and MUX Interface

The network protocol stack in VxWorks is called "SENS (Scalable Enhanced Network STack)", which means Scalable Enhanced Network Protocol Stack. SENS is developed based on the 4.4BSD TCP/IP protocol stack. It contains many protocols that the 4.4BSD TCP/IP protocol stack does not have; and SENS adds many new features when implementing some protocol functions. For example, it adds multicast function when implementing IP protocol. The SENS protocol stack layer is shown in Figure 2.

The basic features of SENS are similar to those of the traditional TCP/IP network protocol stack, but as can be seen from Figure 2, the biggest feature of SENS is that there is an additional MUX layer between the data link layer and the network protocol layer. In SENS, the driver of the network interface is called "END (Enhanced Network Driver)", which is an enhanced network driver, and it is in the data link layer. The IP layer and the TCP/UDP layer are collectively called the "network protocol layer". There is an application program interface (API) between the data link layer and the network protocol layer, which is called the "MUX (Multiplexer) interface" in SENS. The MUX interface is shown in Figure 3. The MUX interface serves to isolate the network driver from the network protocol. In the old BSD4.3 driver mode, the network driver and the protocol are closely connected, and both the protocol and the driver need to understand each other's data structure. In the new MUX-based mode, the driver and the protocol do not need to understand each other. They communicate through the MUX interface. For example, after receiving a packet, the network driver does not directly access the protocol data structure; instead, when it is ready to pass the data to the protocol layer, it calls a function provided by the MUX, which handles the details of passing the data to the protocol layer. This makes it very easy to add a new driver or protocol. MUX implements the following set of functions: muxBind(), muxUn-bind(), muxDevLoad(), muxDevUnload(), muxReceive(), muxError(), muxSend(), muxTxRestartRtn(), muxM castAddrDel(), muxMcastAddrGet(), mux-PollSend(), muxMcastAddrAdd(), muxPollReceive(), muxIoctrl(). Network drivers and protocols must call the above functions, and there is no need to add any additional code for them. [page]

2.2 END device driver loading process

In VxWorks, the END device driver loading process can be divided into three steps, namely, specifying the END device, loading the END device, and starting the END device. The END device is specified through the array endDevTbl[ ], which describes the loading entry points and related parameters of all network devices in the system. The system calls the MUX device loading function mux-DevLoad() to load the END device, and calls the MUX device startup function muxDevStart() to start the END device. The loading process of the network device driver is shown in Figure 4. The system calls the usrNetInit() function through the usrRoot() function to complete the initialization of the MUX, load all devices described in the network device table endDevTbl[ ], and bind the IP protocol to the network boot device, etc.

When a network device generates an interrupt, VxWorks calls the interrupt service routine previously registered by the driver. The interrupt service routine should do as little work as possible to complete the operation of sending/removing data packets from the local network device.

2.3 File Configuration

Since RTL8019 is compatible with NE2000 network card chip, only necessary modifications need to be made on its basis. First, copy ne2000End.c in Tornado2.2\target\src\drv\end directory and ne2000End.h in Tornado2.2\target\h\dry\end directory to bsp directory, and then modify the following files.

(1) Modify ne2000End.C

①Modify the header file include directory;
②Modify sysIntCONnect to intConnect;
③Modify sysLanIntenable to intEnable, and change the return type void to STATUS.

(2) Modify ne2000End.h

Shift the register address left by 1 bit, such as:

#define ENE_RSTART(0x01<<1)

(3) Modify config.h

Add network macro definition:

①#define INCLUDE_NETWORK
②#define INCLUDE_END
③#ifdef INCLUDE_END
#undef INCLUDE_SNGKS32C_END
#define INCLUDE_NE2000_END
#endif/*INCLUDE_END*/

(4) Modify configNet.h

Add a new loading function (whose function naming format is xxLoad()) entry point and related parameters in the endDevTbl[ ] table.

(5) Modify Makefile
and add MACH_EXTRA=ne2000End.o

(6) Modify sysLib.c

①Add MAC address definition:

unsigned char ne2000EnetAddr[]=ETHERNET_MAC_ADRS;

②Add sysInByte, sysOutByte, syslnWordString and sysOutWordString functions.

③Add CPU port initialization in sysHwInit():

④ Add the reset and initialization functions of the RTL8019 chip in sysHwInit(). The relevant code is as follows (please refer to the RTL8019 data sheet for the macro definition of the register): [page]




Conclusion

This paper proposes a solution for the network interface under the VxWorks embedded real-time operating system, that is, using ARM7 (S3C44B0) as the core CPU to control the network controller TRL8019 to achieve network communication. This paper first briefly introduces several major chips and gives a hardware schematic diagram; then briefly analyzes the network protocol and driver loading process under VxWorks; finally, for this network interface, the file configuration process under VxWorks is listed in detail, and some software source programs are provided, which has a certain reference value for developers.

Keywords:S3C44B0  VxWorks Reference address:Design of Network Interface Based on VxWorks on ARM7 Platform

Previous article:Research on MVB Class 2 Devices for ARM Processors
Next article:Video Acquisition and Transmission System Based on ARM9

Recommended ReadingLatest update time:2024-11-16 20:57

Design of interface board based on VxWorks target tracking system
1 Introduction At present, the development of modern tank fire control systems has become one of the most effective ways to give full play to tank firepower and improve battlefield survivability. With the development of embedded systems, the VxWorks operating system has been widely used in high-tech and high-re
[Industrial Control]
Design of interface board based on VxWorks target tracking system
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号