Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
421 views
in Technique[技术] by (71.8m points)

freertos - 如何在FreeRTOS lwIP回显服务器示例(Xilinx Zynq 7000)中使用Microchip PHY?(How to use Microchip PHY in FreeRTOS lwIP echo server example (Xilinx Zynq 7000)?)

I am using the MYIR Z-turn with z7020 chip (Xilixn Zynq device) and trying to get the lwIP working in FreeRTOS based design.

(我正在将MYIR Z-turn与z7020芯片(Xilixn Zynq设备)一起使用,并尝试使lwIP在基于FreeRTOS的设计中工作。)

I've taken the FreeRTOS lwIP echo server example as basis.

(我以FreeRTOS lwIP回显服务器示例为基础。)

I understand that the Xilinx port examples only support Marvell, TI or Realtek PHY chips, but looking at my boards documentation I can see that I'm using the Microchip KSZ9031RNX PHY.

(我了解Xilinx端口示例仅支持Marvell,TI或Realtek PHY芯片,但是通过查看我的电路板文档,我可以看到我正在使用Microchip KSZ9031RNX PHY。)

I read from this and this thread, and also form this AR and from this github repo how to implement the Microchip PHY support.

(我从这个这个线程中读到了内容,还形成了这个 AR和这个 github回购中如何实现Microchip PHY支持。)

So in essence I added support for doing the auto-negotiation with the Microchip PHY in the xemacpsif_physpeed.c file.

(因此,从本质上讲,我在xemacpsif_physpeed.c文件中添加了与Microchip PHY进行自动协商的支持。)

However I still can't get the Ethernet example working.

(但是,我仍然无法使以太网示例正常工作。)

Stepping through the code with a debugger I can see that the network_thread actually hangs when calling the xemac_add function.

(通过调试器逐步执行代码,我可以看到调用xemac_add函数时network_thread实际上挂起了。)

More precicesly it hangs where it tries to perform auto-negotiation by resetting the PHY and waiting the PHY to come out of the reset (while(1) loop) which it never seems to do.

(更精确的是,它挂起了尝试通过重置PHY并等待PHY退出似乎从未执行过的复位(while(1)循环)来尝试执行自动协商的位置。)

However, I think the main problem is the communication with the PHY chip as all calls to the XEmacPs_PhyRead functions seem to return with a value of 0xFFFF.

(但是,我认为主要问题是与PHY芯片的通信,因为对XEmacPs_PhyRead函数的所有调用似乎返回的值为0xFFFF。)

I think this is also the reason why PHY address is not correctly identified in call to detect_phy function - from board documentation I see that PHY address should be 3, but it does not get detected as the XEmacPs_PhyRead function always returns 0xFFFF value when looping down to 0 from 31.

(我认为这也是为什么在对detect_phy函数的调用中未正确标识PHY地址的原因-从开发板文档中,我看到PHY地址应该为3,但是由于XEmacPs_PhyRead函数在循环到0从31。)

In the other hand I know that the hardware is okay and works because I've run linux on the board which is able to use the ethernet interface.

(另一方面,我知道硬件还可以,并且可以工作,因为我已经在板上运行了可以使用以太网接口的linux。)

So it has to be something in the software or configuration.

(因此它必须是软件或配置中的内容。)

I've also tried the standalone version of the echo server, but no difference, it still does not work.

(我也尝试过独立版本的echo服务器,但是没有区别,它仍然无法正常工作。)

Is there something else that I should configure or change in the lwIP source files to make it work with the Microchip PHY?

(我还应该在lwIP源文件中进行其他配置或更改,以使其与Microchip PHY一起工作吗?)

I'm using the Vivado/SDK 2018.3 release and FreeRTOS10 v1.2 and lwIp202 v1.2 versions.

(我正在使用Vivado / SDK 2018.3发行版和FreeRTOS10 v1.2和lwIp202 v1.2版本。)

  ask by rongard translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...