S3C44B0X processor introduction
ARM is a well-known chip design IP supplier in the industry, and its 32-bit RISC microprocessors occupy more than 80% of the global market share. The ARM7 series processors are also the most mature and widely used processors on the market. The S3C44B0X launched by SAMSUNG is a 16/32-bit RISC processor with ARM7TDMI as the core. It is manufactured using 0.25μm CMOS technology and provides cost-effective and high-performance microprocessor solutions for handheld devices and general applications. The S3C44B0X greatly reduces the configuration of peripheral components by providing comprehensive and universal on-chip peripherals, thereby greatly reducing system costs. The internal structure of the S3C44B0X chip is shown in Figure 1.
Circuit Design of Network Interface
Before introducing the circuit design, let's briefly introduce the network controller RTL8019AS. RTL8019AS is a full-duplex Ethernet controller with high cost performance and plug-and-play function produced by Taiwan REALTEK Company. It integrates two RAMs, one 16KB with address 0x4000~0x7FFF and one 32 bytes with address 0x0000~0x001F. The 16K RAM is used as a buffer for sending and receiving data. Generally, 0x4000~0x46FF is used as the sending buffer and 0x4700~0x7FFF is used as the receiving buffer. Figure 2 is an Ethernet interface circuit designed for S3C44B0X using RTL8019AS, 74LV138 (3-8 decoder) and FB2022 (network card transformer).
The data width of this circuit is 16 bits, and it uses the external interrupt EXINT3. The chip select signals nGCS1 and A16, A17, and A18 of the processor are output as the enable control terminal of the network card through 74LV138. nOE and nWE control the reading and writing of the network card, nRESET controls the reset of the network card, and FB2022 plays the role of voltage conversion and filtering. [page]
Introduction to μcLinux operating system and network driver development
Why choose μcLinux for this system
Linux has become one of the most popular operating systems today with its open source code, powerful network functions and many other advantages. μcLinux is derived from the Linux kernel and inherits most of the features of Linux. It is specifically designed for CPUs without MMU (memory management unit) and has done a lot of miniaturization work for embedded systems. It has a small kernel, but powerful functions, a robust system, and a wide range of hardware support features. It is an excellent embedded operating system. S3C44B0X is a processor without MMU, so in this system, μcLinux is a very suitable operating system.
Introduction to Network Driver Development under μcLinux
The implementation process of drivers under μcLinux and Linux is basically the same. Linux regards all devices as specific files and accesses devices through the file system layer. Therefore, in the framework structure of Linux/UCLinux, device-related processing can be divided into two levels - the file system layer and the device driver layer. The device driver layer shields the details of specific devices, and the file system layer provides users with a set of unified and standardized user interfaces. This device management method can achieve "device independence" very well, so that Linux/UCLinux can be easily expanded according to the development of hardware peripherals. For example, to implement a device driver, it is only necessary to provide a set of access interfaces to the file system according to the specific hardware characteristics. The structure of the entire device management subsystem is shown in Figure 3.
In Linux/μclinux, the framework of the entire network interface driver can be divided into four layers, from top to bottom, they are the protocol interface layer, the network device interface layer, the device driver function layer that provides actual functions, and the network device and network media layer. This framework has been built in the kernel network module. When we design a network driver, the main work to be done is to complete the function of the device driver according to the net_device structure defined by the upper network device interface layer and the specific hardware characteristics of the underlying layer. There are two main data structures in the network driver part, one is sk_buff. The transmission of data packets between different protocol layers in TCP/IP and between network drivers is completed through this structure. This structure mainly includes variables required by the transport layer, network layer, and connection layer, pointers that determine the location and size of the data area, and specific device information used to send and receive data packets. Its detailed definition can be found in the kernel source code.
The other is the net_device structure, which is defined in . This structure is the core of the network driver, which defines many device standard methods for system access and protocol layer calls, including the init function for device initialization and system registration, the open and stop functions for opening and closing network devices, the hard_start_xmit function for processing data packet transmission, as well as the interrupt processing function, the interface status statistics function, etc.
Implementation of RTL8019AS driver
In embedded system development, writing device drivers takes up a lot of work. The following is a detailed introduction to the steps of designing the network card driver in this system.
* Initialization function
static int RTL8019_init(struct net_device *dev)
Call the ether_setup (dev) function to set up the general Ethernet interface;
Fill the attribute fields of the net_device data structure;
Call kmalloc to apply for the required memory space;
Manually set the MAC address;
* Device opening and closing functions
static int RTL8019_open(struct net_device *dev)
Disable interrupts;
Register interrupt number and I/O address;
Initialize the device's registers;
Enable interrupt; [page]
The device close function performs the opposite action of the open function.
* Data packet sending function
static int RTL8019_sendpacket(struct sk_buff *skb,
struct net_device *dev)
Turn on the flag tbusy;
Write the data packet into the RTL8019's send buffer and start the DMA send function;
Release the buffer;
* Data packet receiving function
static int RTL8019_rx( int irq, void *dev_id, structpt_regs *regs)
Apply for skb buffer to store new data packets;
Read newly arrived data from the hardware;
Call the function netif_rx() to transmit the new data packet to the upper layer of the network protocol;
finally, compile the driver into the kernel. Since μcLinux does not support dynamic module loading, static compilation must be used. If everything is normal, use the ifconfig and route add commands to set the IP address and subnet mask, and the network card will work normally.
Conclusion
RTL8019AS Ethernet controller has been widely used in embedded systems for its excellent performance, and μcLinux is used for communication and data exchange. Experiments show that the communication between C5416 and S3C4510B using HPI interface meets the real-time requirements of embedded systems.
References:
[1]. S3C44B0X datasheet http://www.dzsc.com/datasheet/S3C44B0X+_589522.html.
[2]. RTL8019AS datasheet http://www.dzsc.com/datasheet/RTL8019AS+_1096173.html.
[3 ]. RISC datasheet http://www.dzsc.com/datasheet/RISC+_1189725.html.
[4]. ARM7TDMI datasheet http://www.dzsc.com/datasheet/ARM7TDMI+_139812.html.
[5]. 74LV138 datasheet http://www.dzsc.com/datasheet/74LV138_1082898.html.
[6]. A16 datasheet http://www.dzsc.com/datasheet/A16_1819409.html.
[7]. A17 datasheet http://www.dzsc.com/datasheet/A17_1819429.html.
[8]. RTL8019 datasheet http://www.dzsc.com/datasheet/RTL8019+_1063656.html.
[9]. S3C4510B datasheet http:/ /www.dzsc.com/datasheet/S3C4510B+_589499.html.
Previous article:Analysis and design of startup process based on embedded uCLinux kernel
Next article:Construction of Embedded Linux System Based on S3C2410
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
- New version of WEBENCH user guide
- [FS-IR02 + D1CS-D54] - 5: Linking with MCU (D1CS-D54)
- Qorvo Acquires UWB Software Provider 7Hugs Labs SAS
- Please tell me how to draw the differential line of this USB
- How is the burning of OTP chip carried out after SMD?
- MSP430FR2355 Mixed-Signal Microcontroller
- Timing Analysis 1 Static Analysis Basics
- MicroPython v1.19 is coming soon
- [EEWorld invites you to play disassembly] PISEN fast charging power bank 10500mAh 22.5W
- Application of Single Chip Microcomputer in Inverted Pendulum Control System