background
After the hardware engineer completed the PCB and schematic design, the routine was modified according to the tutorial of Zhengdian Atom to verify the correctness of the hardware.
STM32F407 and LAN8720 debugging records .
Zhengdian Atom network communication experiment
The next step is to implement the function on the product board.
The original product uses the W5500 hard TCP/IP protocol solution.
The debugging route attempts to start with UDP loopback.
In the introduction of ICMP protocol
, you can see that the protocol points out that the error type belongs to port unreachable.
I tested it with other programs. Sure enough, when the IP of the target device is correct and there is no corresponding port on the target device, it will reply to the ICMP message.
It can be seen that the problem lies in the port initialization.3. Factory routine test
I had no choice but to compare it with the original routine of Atom. It can send messages and receive messages normally.
During the test, I accidentally intercepted such a message:
It can be observed that only when the source address and the destination address are both 8089, ICMP will not return an error message.
When either of the two is not 8089, an error will be reported.
Going back to check the code carefully, there are indeed two places where UDP_DEMO_PORT is used.
They are
err = udp_connect(udppcb, &rmtipaddr, UDP_DEMO_PORT);
and
err = udp_bind(udppcb, IP_ADDR_ANY, UDP_DEMO_PORT);
One is bound to the local port and IP, and the other is bound to the remote device's IP and port.
The udp_connect function has not been used before. The LWIP manual describes this function as follows:
LwIP Application Developers Manual
Connected pcbs only receive data from the connected remote address, while unconected pcbs receive datagrams from any remote address.
Therefore, the UDP port connected will only receive packets with the bound source address and source port.
Try to comment out the udp_connect function, and all packets can be received successfully.
Previous article:Analysis of STM32 network packet loss problem
Next article:Hardware connection of STM32 transplantation lwip
Recommended ReadingLatest update time:2024-11-22 20:40
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- EEWORLD University Hall----Detailed explanation of TI's new generation of wide input buck chips
- Capacitive touch MSP430FR2676 MCU motherboard
- Automotive resolver decoding application design guide
- 【XMC4800 Relax EtherCAT Kit Review 2】-Building the environment and lighting up the LED
- 【GD32L233C-START Review】-Serial port to USB to implement printf printing
- Common problems in OLED development
- ECG monitor solution based on DSP system platform
- How to write a program into a 44b0 blank board?
- Finding the missing pieces of the TI power puzzle
- A novice asks about AD copper plating, thank you