完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我正在Ubuntu上使用PIC32MZ0512EFE064和LAN8720A、HARMony v2_00b、MPLABX 3.40XC32 1.42。我无法通过DHCP DISCOVERER请求,因为它仅发送42字节(除了实际的BOOTP/DHCP部分),我可以在wireshark(参见附图)中使用交叉网络电缆看到这一点。使用交叉电缆发送DHCP发现器包可能有问题吗?电缆另一端的计算机没有DHCP服务器(它只是笔记本电脑上的Windows 7启动器)。所以整个BOOTP/DHCP包没有被发送,即使包具有正确的长度。我使用的是完全通用的代码(参见从udp_server复制的app.c)。代码总是与appData.tcpipTaskState=APP_TCPIP_WAIT_._IP一起循环。很难知道实际的分组传输发生在哪里。感谢您的帮助,谢谢,Ted
App.c(29.41 KB)-下载140次 以上来自于百度翻译 以下为原文 I am using PIC32MZ0512EFE064 with a LAN8720A, Harmony v2_00b, MPLABX 3.40 XC32 1.42 on Ubuntu. I cannot get past a DHCP DISCOVERER request because it only sends 42 bytes (everything but the actual BOOTP/DHCP section). I can see this in wireshark (see attached capture) using a crossover network cable. Is there perhaps a problem with trying to send a DHCP discoverer packet using a cross-over cable? The computer on the other side of the cable does not have a DHCP server (it is just Windows 7 starter on a laptop). So the entire BOOTP/DHCP packet is not being transmitted, even though the packet has the correct length. I am using totally generic code (see my app.c copied from udp_server). The code constantly loops with appData.tcpipTaskState = APP_TCPIP_WAIT_FOR_IP. It is tough to know where the actual packet transmit is happening. Any help is appreciated. Thanks, Ted Attachment(s) malformed_bootp2.pcapng.zip (1.41 KB) - downloaded 40 times app.c (29.41 KB) - downloaded 140 times |
|
相关推荐
9个回答
|
|
数据包被传输。只是没有正确接收到帧。你可以尝试一些事情:-在两个主机之间插入一个开关。-也许你的PC没有自动MDIX。禁用PIC32上的自动MDIX,并根据使用的电缆手动选择极性。-也可以尝试更改电缆类型。
以上来自于百度翻译 以下为原文 The packet gets transmitted. It's just that the frame is not received properly. You could try few things: - insert a switch between the 2 hosts. - Maybe your PC has no Auto MDIX. Disable the Auto MDIX on the PIC32 and manually select the polarity based on the cable that you use. - You could also try changing the cable type. |
|
|
|
添加更多:这是我第一次使用和声(我正在把一个PIC32 MX+PLIB的工作项目移植到PIC32 MZ和Orthic),所以我犯的一些错误是InStulySoC。HI意识到,我必须得StpCIPPNETWorksDeFultTyMaCyAdDR 0 / /“00:04:A3:11:22:33”,并且定义SyssiPosifftRIS0xFFEF/NRS。T是r0 0xFFFF(i添加端口,而没有真正实现它初始化所有端口)。另一个问题是,我想使用一个BSP.C,但是没有办法只需调用一个空的BSP.C(简单地调用一个BSPIX初始化()),所以我手动添加,并且在那个BSPA初始化中。LISE()是我定义所有端口设置的地方。我认为一个好主意是让我尝试静态IP,看看是否可以ping PCB。我还没有得到DHCP工作。
以上来自于百度翻译 以下为原文 Adding more: this is my first time using harmony (I am porting a working project from pic32mx+plib to pic32mz and harmony), and so some mistakes I made are in system_config.h I realized that I have to set TCPIP_NETWORK_DEFAULT_MAC_ADDR 0// "00:04:a3:11:22:33" and #define SYS_PORT_F_TRIS 0xFFFE //nRST is RF0 0xFFFF (I added ports without really realizing that it initializes all those ports). #define TCPIP_NETWORK_DEFAULT_INTERFACE_FLAGS TCPIP_NETWORK_CONFIG_DHCP_CLIENT_ON | TCPIP_NETWORK_CONFIG_DNS_CLIENT_ON | TCPIP_NETWORK_CONFIG_IP_STATIC I changed to just: #define TCPIP_NETWORK_DEFAULT_INTERFACE_FLAGS TCPIP_NETWORK_CONFIG_DHCP_CLIENT_ON #define TCPIP_NETWORK_DEFAULT_MAC_DRIVER DRV_ETHMAC_PIC32MACObject Another problems was that I want to use a bsp.c - but there is no way to just select a bare bsp.c with simply a call to BSP_Initialize()- so I add that manually, and in that BSP_Initialize() is where I define all the port settings. A good idea I think is for me to try static ip and see if I can ping the PCB. I still have not gotten DHCP to work yet. |
|
|
|
到目前为止,我也没有静态IP工作。我确实确认MII RX线路在我连接到Arris NVG589(AT&T Uverse)交换机(使用普通电缆)时发送DHCP Discover之后似乎有数据——但是交换机上没有镜像端口特性来监视它。但固件从来没有收到任何报价。
以上来自于百度翻译 以下为原文 So far I have no static ip working either. I did confirm that the MII RX lines appear to have data after sending a DHCP Discover when I connect to my Arris NVG589 (AT&T Uverse) switch (with a regular cable)- there is no mirrored port feature on that switch to monitor it though. But the firmware never appears to receive any offer. |
|
|
|
AT&T交换机实际上可以服务dhcp,所以我尝试了一个普通的100/10mbit交换机,它使用2个RealTekIC将它运行到一个支持香蕉运行的lubuntu(带有一个可用的isc-dhcp服务器),wireshark没有收到任何包。因此,东芝小上网本上的交叉电缆是迄今为止唯一显示来自PIC32MZ PCB的任何数据包(42字节数据包)的设备。这对我来说意味着有一个分组被发送出去,但是它可能被交换机拒绝了,因为所要求的长度与实际长度不匹配。跟踪代码有些困难——我试图确定以太网发送寄存器中的字节数被设置在哪里——所有发送函数看起来都获得了正确的长度(328字节)。
以上来自于百度翻译 以下为原文 The AT&T switch actually can serve dhcp, so I tried just a plain 100/10 mbit switch that uses 2 RealTek ICs running it to a banana pro running lubuntu (with a working isc-dhcp server) with wireshark- and wireshark finds no packets received. So the crossover cable on a little Toshiba netbook is the only device so far that shows any packet (the 42 byte packet) from the PIC32MZ PCB at all. This implies to me that there is a packet getting sent out, but that it is perhaps being rejected by the switch because the claimed length does not match the actual length. Tracing the code is somewhat tough- I am trying to determine where the number of bytes in the Ethernet send register is being set- all the transmit functions appear to get the correct length (328 bytes). |
|
|
|
尝试将一个串行控制台连接到您的板并启用TCP/IP命令。然后,“macinfo”将返回MAC统计寄存器,这样就可以对正在发生的事情有所了解。
以上来自于百度翻译 以下为原文 Try to hook a serial console to your board and enable the TCP/IP commands. Then, "macinfo" will return the MAC statistics registers so this will give some insight into what's going on. |
|
|
|
只是为了更新这个-我得到了DHCP和ping工作,基本上我做了一个新的和谐项目基于TCPIP服务器,没有BSP,没有任何我自己的代码。我认为一个关键可能是在pins选项卡中分配以太网管脚(在此之前我从未使用过和谐-手动完成所有工作)-我基本上只是将PHY复位管脚分配给输出和高(LAN8720)。再一次,令人沮丧的是,我必须猜测哪些选择是协调一致的——基本上是基本DHCP+UDP以太网所需要的?我使用的是PIC32MX664,只有DHCP客户端和UDP服务器,甚至没有ping,它工作得很好,没有DNS,没有TCP,没有别的。此外,生成的代码总是有错误——和谐生成大多数代码而没有错误是一个了不起的成就,但是我发现我必须添加一个缺失的变量,或者注释掉一些编译时错误生成函数,比如:system_config/default/framework/system/console/src/sys_console_uart.c:199:对“DRV_USART_Read”和.../framework/crypto/src/asn.c:2866的未定义引用:警告:使用默认时间()存根链接代码。提示:编写一个特定于应用程序的实现。让和谐更有帮助的一件事情是查看某种依赖树——例如,我需要检查“加密”来简单地拥有一个DHCP客户端+UDP服务器+ICMP客户端吗?显然,我猜是这样,因为“crypto.h”包含在生成的源文件中,即使我从未选择过。一些和声选项被高亮显示,即使它们中没有选择。选择一个示例项目会改变许多其他选项,而不需要用户被告知或显示它。但现在DHCP和ping都工作了,我松了一口气,基本上可以根据自己的需要修改这段代码。
以上来自于百度翻译 以下为原文 Just to update this- I got DHCP and pinging to work, basically I made a new harmony project based on a TCPIP server, with no BSP, and without any of my own code in it. One key I think was possibly assigning the Ethernet pins in the pins tab (I had never used harmony before this- doing everything manually) - I basically was only assigning the PHY reset pin to an output and high (LAN8720). Again, though, frustratingly, I had to guess which selections to make in harmony- basically what is needed for a basic DHCP+UDP ethernet? I was using a PIC32MX664 with only DHCP client, and UDP server- not even ping and it worked fine, no DNS, no TCP, nothing else. In addition, there are always errors with the generated code- that harmony generates most of the code without error is a phenomenal achievement, but I find that I have to add a missing variable, or comment out some compile-time error producing function like: system_config/default/framework/system/console/src/sys_console_uart.c:199: undefined reference to `DRV_USART_Read' and .../framework/crypto/src/asn.c:2866: warning: Linking code with default time() stub. Hint: Write an app-specific implementation. One thing that would make harmony much more helpful is seeing some kind of dependency tree- for example, do I need to check "crypto" to just simply have a DHCP client+UDP server+ICMP client? Apparently I guess I do- because "crypto.h" is included in one of the generated source files even though I never selected it. Some harmony options are highlighted even though nothing is selected in them. Choosing a sample project changes many other options without the user being told or shown about it. But now that DHCP and ping are working I am much more relieved and can basically adapt this code for my own needs. I was able to get the serial port console output working- not the input yet- Thanks for all the help |
|
|
|
请注意,PIC32 MZ在硅中包括可用的默认MAC地址。它是从芯片的序列号寄存器中派生出来的,并有一个微芯片OAA前缀。因此,在配置和声时,您可以安全地离开默认MAC地址。
以上来自于百度翻译 以下为原文 Note that the PIC32MZ includes a usable default MAC address in the silicon. It's derived from the chip's serial number registers and has a Microchip OUA prefix. So you can safely leave the default MAC address when configuring Harmony. |
|
|
|
尝试构建tcpip_udp_client示例应用程序,看看它是否正确地请求地址。您可以在framework/tcpip/src/dhcp.c中设置断点,在断点处组装发现包(第1011行),并查看哪里出错。注意,这个文件在1.0801和2.00之间没有变化。
以上来自于百度翻译 以下为原文 Try building the tcpip_udp_client example app and see if that properly requests an address. You can set a breakpoint in framework/tcpip/src/dhcp.c where it assembles the discover packet (line 1011) and see where it goes wrong. Note that this file hasn't changed between 1.08.01 and 2.00b. |
|
|
|
另外,一旦项目关闭,管脚设置显然会重置,因此需要再次设置它们以重新生成代码。也许这些设置应该导出,然后在用户需要重新生成代码时导入。
以上来自于百度翻译 以下为原文 adding that the pin settings are apparently reset once a project is closed, so they need to be set again to regenerate code. Perhaps these settings should be exported and then imported whenever the user needs to regenerate code. |
|
|
|
只有小组成员才能发言,加入小组>>
5058 浏览 9 评论
1942 浏览 8 评论
1877 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3095 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2164 浏览 5 评论
605浏览 1评论
475浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
327浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
500浏览 0评论
411浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-9-15 18:09 , Processed in 1.305453 second(s), Total 93, Slave 76 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号