Design of Network Interface Based on VxWorks on ARM7 Platform

Publisher:创客1992Latest update time:2012-02-11 Source: dzscKeywords:S3C44B0  ARM7  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 call the above functions, and there is no need to add any additional code for them.

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.

[page]

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 registers):




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  ARM7  VxWorks Reference address:Design of Network Interface Based on VxWorks on ARM7 Platform

Previous article:Design of intelligent traffic signal light system based on ARM
Next article:Design of Multifunctional Vehicle Bus Embedded System Based on ARM and FPGA

Recommended ReadingLatest update time:2024-11-16 15:56

ARM7 MCU (Learning) - (II), Interrupt Control Programming - 02
After setting up the MDK interrupt~~ You can use it immediately after interruption~~ If you want to know more, look for the EDA software section~~ Just finish writing it today~~ 2. Interrupt Control Programming 2. (01) Counter (control the count addition, subtraction or clearing through three external interrupts)
[Microcontroller]
ARM7 MCU (Learning) - (II), Interrupt Control Programming - 02
Analysis of technical difficulties in starting program in embedded applications using ARM7
Analysis of technical difficulties ⑴.Use of MMU MMU is the abbreviation of memory management unit, which is a device used to manage the virtual memory system. MMU is usually part of the CPU and has a small amount of storage space to store the matching table from virtual address to physical address. This ta
[Industrial Control]
Analysis of the use of ARM7 MCU + RTL8019 embedded TCP_IP protocol stack
I. General Provisions This document is the description document of the embedded TCP/IP protocol stack. By reading this document, embedded TCP/IP application developers can master the development of server and client applications based on the embedded TCP/IP protocol stack, such as FTP server, WEB server, serial port
[Microcontroller]
Design of touch screen touch point data acquisition system based on ARM7 LPC2210
This paper proposes the design of a touch screen touch point data acquisition system based on the ARM7 series LPC2210 microcontroller and the embedded operating system μC/OS-II, and completes the physical layer circuit conversion between the microcontroller and the host computer, realizing Data communication based on
[Microcontroller]
Design of touch screen touch point data acquisition system based on ARM7 LPC2210
ARM7 LPC2378 remote upgrade ---- IAP function
    For In Application Programming (IAP), the IAP procedure should be called by pointing the word pointer in register r0 to the memory (RAM) containing the command code and parameters. The result of the IAP command is returned to the result table pointed to by register r1. The user can reuse the command table to obtai
[Microcontroller]
ARM7 LPC2378 remote upgrade ---- IAP function
Using U-Boot to transplant uClinux to S3C44B0
1 Introduction S3C44B0 is a 32-bit processor developed by Samsung for handheld devices or other general-purpose devices. It is based on the ARM7TDMI core and has no memory management unit (MMU). uClinux is widely used in embedded systems that use microprocessors without MMU. As a derivative of linux, it has the
[Microcontroller]
Using U-Boot to transplant uClinux to S3C44B0
uCOS-II interrupt - Research on the method of implementing interrupt nesting in ARM7
In uCOS-II, or any preemptive OS system, interrupt nesting is a problem that must be solved. In conclusion, not all CPUs support interrupt nesting, even the ARM series cores. For the ARM7 series, such as the LPC2xxx series chips, the hardware does not support interrupt nesting, while for the new CortexM3 series, inter
[Microcontroller]
uCOS-II interrupt - Research on the method of implementing interrupt nesting in ARM7
ARM7 (lpc2146) study notes-0606
1. ADS 1. Save the file name in full (including the extension) 2. If the *.tdt file is deleted, the entire project will be recompiled 3.*.axf is the debugging file of the project 4. *.scf   scatter loading description file 5. The RelinFLASH version of ADS sets JTAG encryption. After downloading this version
[Microcontroller]
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号