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.
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
- Popular Resources
- Popular amplifiers
- Design of permanent magnet synchronous motor control system based on VxWorks_Zhang Guilin
- Design of Embedded Multi-protocol Communication Controller Based on VxWorks
- Multi-task real-time scheduling design of low-orbit broadband communication payload management software based on VXWorks
- Design and implementation of CPCI multi-channel card driver based on VxWorks
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
- Smart LED Octahedron
- [Lazy self-care fish tank control system] BLE_MESH fish tank light peripheral production
- Verilog001
- Inter-core Communication Method of TMS320C6678 Multi-core DSP
- How to implement the logic of GD32E230 OAT? Is there any relevant code information?
- Microelectronic Circuit Design (4th Edition, English)
- MAX202 RS-232 Interface Counterfeit Device Warning
- RC π type filter resistor and capacitor value -------
- About the role of capacitors in suppressing differential mode interference and common mode interference
- [Raspberry Pi Pico Review] WS2812B full-color LED light strip/ring display driver