完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
虽说现在能够TCP通信和ping相通了,但还是想弄明白ARP协议工作流程,在仿真调试的时候还是出现“如题的现象”?先把仿真结果和串口输出信息附上,有哪位大侠解释下啊?
接收的arp数据包相关信息 串口输出ARP相关调试信息 电脑信息:IP 192.168.0.54 MAC 00-30-48-7D-F0-2E 板子信息: IP 192.168.0.10 MAC 00-80-48-12-34-56 |
|
|
|
这是不是类似于lwip中etharp_gratuitous()函数的功能啊,是不是PC网卡发送的无回报(gratuitous)ARP请求啊??
|
|
|
|
开启lwip的调试信息后输出如下:
[C] 纯文本查看 复制代码 PHY works in 100Mbps full-duplex mode!netif: added interface en IP addr 192.168.0.10 netmask 255.255.255.0 gw 192.168.0.1netif: setting default interface enetharp_request: sending ARP request.pbuf_alloc(length=42)pbuf_alloc(length=42) == 20000350etharp_raw: sending raw ARP packet.TSRI transfer successfully!pbuf_free(20000350)pbuf_free: deallocating 20000350there are some packets coming!pbuf_alloc(length=64)pbuf_alloc: allocated pbuf 200062a4pbuf_alloc(length=64) == 200062a4ethernet_input: dest:ff:ff:ff:ff:ff:ff, src:00:30:48:7d:f0:2e, type:806etharp_update_arp_entry: 192.168.0.54 - 00:30:48:7d:f0:2eetharp_find_entry: found empty entry 0etharp_find_entry: no empty entry found and not allowed to recycleetharp_arp_input: incoming ARP requestetharp_arp_input: ARP request was not for us.pbuf_free(200062a4)pbuf_free: deallocating 200062a4 |
|
|
|
终于ping通了,自己移植ST官方lwipopts.h的时候直接copy过来的,把以下代码删除就可以ping通了
[C] 纯文本查看 复制代码 ---------- Checksum options ---------- --------------------------------------*//* The STM32F4x7 allows computing and verifying the IP, UDP, TCP and ICMP checksums by hardware: - To use this feature let the following define uncommented. - To disable it and process by CPU comment the the checksum.*/#define CHECKSUM_BY_HARDWARE #ifdef CHECKSUM_BY_HARDWARE /* CHECKSUM_GEN_IP==0: Generate checksums by hardware for outgoing IP packets.*/ #define CHECKSUM_GEN_IP 0 /* CHECKSUM_GEN_UDP==0: Generate checksums by hardware for outgoing UDP packets.*/ #define CHECKSUM_GEN_UDP 0 /* CHECKSUM_GEN_TCP==0: Generate checksums by hardware for outgoing TCP packets.*/ #define CHECKSUM_GEN_TCP 0 /* CHECKSUM_CHECK_IP==0: Check checksums by hardware for incoming IP packets.*/ #define CHECKSUM_CHECK_IP 0 /* CHECKSUM_CHECK_UDP==0: Check checksums by hardware for incoming UDP packets.*/ #define CHECKSUM_CHECK_UDP 0 /* CHECKSUM_CHECK_TCP==0: Check checksums by hardware for incoming TCP packets.*/ #define CHECKSUM_CHECK_TCP 0 /* CHECKSUM_CHECK_ICMP==0: Check checksums by hardware for incoming ICMP packets.*/ #define CHECKSUM_GEN_ICMP 0#else /* CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.*/ #define CHECKSUM_GEN_IP 1 /* CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.*/ #define CHECKSUM_GEN_UDP 1 /* CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.*/ #define CHECKSUM_GEN_TCP 1 /* CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.*/ #define CHECKSUM_CHECK_IP 1 /* CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.*/ #define CHECKSUM_CHECK_UDP 1 /* CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.*/ #define CHECKSUM_CHECK_TCP 1 /* CHECKSUM_CHECK_ICMP==1: Check checksums by hardware for incoming ICMP packets.*/ #define CHECKSUM_GEN_ICMP 1#endif |
|
|
|
只有小组成员才能发言,加入小组>>
如何使用STM32+nrf24l01架构把有线USB设备无线化?
2574 浏览 7 评论
请问能利用51单片机和nRF24L01模块实现实时语音无线传输吗?
2367 浏览 5 评论
3220 浏览 3 评论
2841 浏览 8 评论
为什么ucosii上移植lwip后系统进入了HardFault_Handler?
2795 浏览 4 评论
请教各位大咖:有没有接收频率32M左右的芯片推荐的?先感谢啦!
675浏览 1评论
912浏览 0评论
1033浏览 0评论
676浏览 0评论
508浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-27 20:34 , Processed in 1.461556 second(s), Total 82, Slave 65 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号