At present, SoC is developing towards a smaller area and higher speed. 100M network communication can no longer meet people's production and work needs. Gigabit network communication has become an urgent requirement in work. There are two modes to choose from to achieve Gigabit network communication with FPGA. One is to write an IP soft core, and the other is to use the MAC core embedded in FPGA. Method 1 is flexible, but it is not easy to implement. Therefore, Xilinx classifies it as a paid IP; the three-state configurable characteristics of MAC in method 2 make it possible for us to achieve Gigabit network communication. This article is based on this embedded Ethernet MAC module and successfully implements Gigabit network communication under the VxWorks operating system.
1 Gigabit communication hardcore architecture embedded in Virtex4 FX series FPGA
Virtex4 FX series FPGAs have multiple hard cores embedded for Gigabit communication. For example, XC4VFX20 connects two EMAC cores through a host interface. The two EMACs can be used together or only one of them can be used.
The Ethernet MAC hard core embedded in Virtex4 has the following features:
Supports half-duplex and/or full-duplex operation
Designed to comply with IEEE 802.3-2002 standards
Supports 3 different operation modes: 1 Gbps, 100 Mbps, 10Mbp
Support MII, GMII, RGMII, SGMII communication methods
Provide technical support for VLAN frames and JUMBO frames of unlimited length
Provides optional network management features including per-packet statistics vectoring and flow control
The TEMAC core can be configured and monitored through a processor-independent interface, providing users with additional flexibility in selecting the ideal processor for their application.
In 1Gigabit mode, TEMAC supports Gigabit Media Independent Interface (GMII) and Reduced Gigabit Media Independent Interface (RGMII). GMII is a byte-wide parallel SDR interface running at 125 MHz, while RGMII is a half-byte parallel DDR interface running at 25 MHz, providing a total bandwidth of 1 Gbps. In addition, TEMAC supports MII interface in both 100 and 10 Mbps modes. MII interface is 4-bit wide and operates at 25 MHz in 100MBps mode. In 10MBps mode, MII interface operates at 2.5MHz.
Since the Ethernet MAC hard core is embedded in Virtex4 and PowerPC is also embedded in the FX series, PowerPC can be used to control Ethernet MAC to achieve Gigabit network communication.
2 BSP Porting under VxWorks
The VxWorks operating system is an embedded real-time operating system (RTOS) designed and developed by the American WindRiver Company in 1983. It adopts a microkernel structure, supports multiple processors, has rich network protocols, good compatibility and scalability, and has the function of dynamic linking and downloading programs. Since its launch in the 1980s, it has gradually occupied a place in the field of embedded real-time operating systems with its continuously launched upgraded versions, high-performance kernel and user-friendly development environment, and has become famous for its successful application in high-tech products such as Mars Exploration Rovers and Patriot Missiles. The board support package BSP (Board Support Package) of VxWorks is a low-level software development package between the underlying hardware and the upper-level software. Its main function is to shield the hardware and provide the operating system driver. The specific functions include:
1) Single board hardware initialization, mainly CPU initialization, provides underlying hardware support for the entire software system;
2) Provide device drivers and system interrupt service routines for the operating system;
3) Customize the operating system functions to provide a real-time multi-tasking operating environment for the software system;
4) Initialize the operating system and prepare for the normal operation of the operating system. [page]
In embedded system design, BSP development is a very complex and tedious task. The EDK suite provided by Xilinx can greatly reduce the work of developers. The BSP generator (BSPgen) in EDK can automatically generate user-customizable BSPs based on different microprocessors, peripherals, and RTOS combinations. It contains the necessary support software for the system, including Boot code, device drivers, and RTOS initialization. BSPgen can be used to package Xilinx device drivers into a subdirectory of the BSP, and seamlessly integrate Xilinx device drivers with VxWorks and its Tornado integrated development environment, fully reducing the development cycle.
However, the BSP generated by BSPgen is only a fixed BSP template, which cannot correctly reflect the memory mapping of RAM/ROM and does not support the kernel/driver customized by the user through the BSPgen process. Therefore, the BSP generated by BSPgen needs to be modified and tailored.
For BSP developers, with the help of EDK's BSPgen, it is also necessary to do the following tasks:
1) Modify the RAM, ROM address and serial port rate in config.h and Makefile
2) Modify sysSerial.c and set the serial port correctly
3) Add driver files for devices that cannot be seamlessly integrated with VxWorks
4) Configure Ethernet parameters in sysNet.c and set the MAC address
5) Disable or enable Cache according to the configuration in EDK
6) Modify sysLib.c to display the correct information
7) Set the host IP address
After the above modifications, place the new BSP in the Tornado installation directory Tornado_roottargetconfig. Based on this BSP, generate a new VxWorks project in the Tornado integrated environment, and then you can carry out general embedded operating system development.
The address mapping of RAM and ROM in EDK is shown in the following table:
Table 1 RAM/ROM address mapping
Modify the addresses in makefile and config.h according to Table 1. The MAC address of the network is defined in sysNet.c by the following statement, which must be modified according to the actual MAC address, such as the MAC address in this article: 00:0A:35:01:88:25
static char XEmacMacAddr0[6] = { 0x6, 0x5, 0x4, 0x3, 0x2, 0x1 }; //Before modification
static char XEmacMacAddr0[6] = { 0x00, 0x0A, 0x35, 0x01, 0x88, 0x25 }; //After modification
sysSerial.c initializes the serial port. Since the serial port ID must be correctly specified, sysLib.c can display the information of the vxWorks image, so corresponding modifications must also be made.
After modifying the BSP generated under EDK and generating the correct VxWorks image in the Tornado integrated environment, it can be downloaded to the FPGA. Observe whether the serial port output is correct and perform corresponding debugging to confirm that the BSP transplantation is correct.
Previous article:Development of Electronic Systems Based on SoPC Builder
Next article:Oscillator application based on the inverter inside CPLD
Recommended ReadingLatest update time:2024-11-17 00:19
- Popular Resources
- Popular amplifiers
- Analysis and Implementation of MAC Protocol for Wireless Sensor Networks (by Yang Zhijun, Xie Xianjie, and Ding Hongwei)
- MATLAB and FPGA implementation of wireless communication
- Intelligent computing systems (Chen Yunji, Li Ling, Li Wei, Guo Qi, Du Zidong)
- Summary of non-synthesizable statements in FPGA
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
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
- EEWorld invites you to dismantle (fifth issue): dismantle Xiaomi fast charging power strip
- The moon rises over the sea, and the world is sharing this moment
- [Project source code] Cymometer, an equal-precision frequency meter based on FPGA
- Last 4 days to apply for free: Mil based on NXP high-speed, high-performance LS1028A development board
- [National Technology N32G457 Review] UART-DMA indefinite length packet loss test
- msp430g2553 adc sampling accuracy problem
- Can the almighty gods help me find what IC this is?
- ADC12_A initialization parameters
- Xianji official data package: Review of Xianji HPM6750
- Brushless DC Motor Control System