英文:
Azure NetX Duo only provides the driver for LAN8742 compatible Ethernet PHYs. How can I manage other Ethernet PHYs?
问题
我正在开发一个针对STM32F4的应用程序,使用Azure RTOS Netx Duo。具体来说,我正在尝试适应示例应用程序Nx_TCP_Echo_Server,以适应我的开发板,该开发板上搭载了由Analog Devices生产的Ethernet Phy ADIN1200。
关于示例Nx_TCP_Echo_Server
Nx_TCP_Echo_Server示例应用程序是为STM32F429ZI-NUCLEO演示板制作的(Nx_TCP_Echo_Server的代码 在GitHub上)。在STM32F429ZI-NUCLEO演示板上,以lan8742驱动程序与Ethernet Phy兼容(请参阅lan8742驱动程序代码 在GitHub上)。不幸的是,我开发板上的Ethernet PHY ADIN1200与该驱动程序不兼容。
我注意到nx_ip_create()
函数的第六个参数是指向nx_stm32_eth_driver
的函数指针。
这个函数指针指向lan8742驱动程序。
下面是在示例应用程序Nx_TCP_Echo_Server中的app_netxduo.c
文件中展示的nx_ip_create()
函数的调用:
/* 创建主NX_IP实例 */
ret = nx_ip_create(&IpInstance, "Main Ip instance", NULL_ADDRESS, NULL_ADDRESS, &AppPool, nx_stm32_eth_driver,
pointer, 2 * DEFAULT_MEMORY_SIZE, DEFAULT_PRIORITY);
NetX Duo文档提供了以下信息:
NX_IP结构包含了管理单个IP实例所需的一切,包括通用TCP/IP协议信息以及应用程序特定的物理网络驱动程序的入口例程。驱动程序的入口例程在nx_ip_create服务期间定义。可以通过nx_ip_interface_attach服务向IP实例添加其他设备。
我的开发环境
我的开发环境包括:
- STM32CubeMX版本6.7.0
- 在STM32CubeMX中,我已经安装了STM32F4版本1.27.1的软件包。
- 为了使用ThreadX,我已经向CubeMX添加了X-CUBE-AZRTOS-F4版本1.1.0的软件包。
在之前的环境中,我只能找到适用于LAN8742的驱动程序。
我的问题
我如何找到除lan8742之外的NetX Duo的其他Ethernet PHY驱动程序?
编辑
我找到了ADIN1200的驱动程序,但它与我的开发工具提供的lan8742.c
驱动程序相去甚远(请参阅lan8742的代码)。事实上,这两个驱动程序的API非常不同;例如,NetX Duo(以及之前的LwIP)需要一个类似于LAN8742_RegisterBusIO()
(在LAN8742驱动程序中存在)的函数来初始化一个结构,其中包含用于写入和读取Ethernet PHY寄存器的函数指针,但在此驱动程序中不存在此函数及其数据结构。
英文:
I'm developing an application for STM32F4 with Azure RTOS Netx Duo. In particular I'm trying to adapt the example Nx_TCP_Echo_Server application for my board where is present the Ethernet Phy ADIN1200 produced by Analog Devices.
Note about example Nx_TCP_Echo_Server
The Nx_TCP_Echo_Server example application has been made for a STM32F429ZI-NUCLEO demo board (code of Nx_TCP_Echo_Server on github).
In the demo board STM32F429ZI-NUCLEO the Ethernet Phy is compatible with the lan8742 driver (see the lan8742 driver code on GitHub). Unfortunately the Ethernet PHY ADIN1200 present on my board is not compatible with that driver.
I have noted that the sixth parameter of the function nx_ip_create()
is the pointer function nx_stm32_eth_driver
.
This pointer function points to lan8742 driver.
Below I show the invocation of the function nx_ip_create()
present in the file app_netxduo.c
(code of app_netxduo.c) of the Nx_TCP_Echo_Server example application:
/* Create the main NX_IP instance */
ret = nx_ip_create(&IpInstance, "Main Ip instance", NULL_ADDRESS, NULL_ADDRESS, &AppPool, nx_stm32_eth_driver,
pointer, 2 * DEFAULT_MEMORY_SIZE, DEFAULT_PRIORITY);
The documentation of NetX Duo reports the following info:
> The NX_IP structure contains everything to manage a single IP instance. This includes general TCP/IP protocol information as well as the application-specific physical network driver's entry routine. The driver's entry routine is defined during the nx_ip_create service. Additional devices may be added to the IP instance via the nx_ip_interface_attach service.
My development environment
My development environment is composed by:
- STM32CubeMX version 6.7.0
- In the STM32CubeMX I have installed the Package STM32F4 version 1.27.1
- To use ThreadX I have added to CubeMX the software pack X-CUBE-AZRTOS-F4 version 1.1.0
By the previous environment I can find only the driver for LAN8742.
My question
How can I find other Ethernet PHY drivers for NetX Duo other than the one for lan8742?
EDIT
I have found this driver for ADIN1200 but it is very far from the driver lan8742.c
provided by my development tool (see the code of lan8742).
In fact the API of the 2 drivers are very different; for example NetX Duo (and before it: LwIP
) needs a function like LAN8742_RegisterBusIO()
(present in the LAN8742 driver) to init a structure with pointer functions useful to write and read registers of the Ethernet PHY, but in this driver this function and its data structures are not present.
答案1
得分: 1
你可以从https://github.com/azure-rtos/samples找到不同的物理驱动程序。
- mimxrt1060:KSZ8081RNB
- same54:KSZ8091RNA
- stm32f746:LAN8742A-CZ-TR
- rx65n rsk:DP83620SQE
对于其他情况,你需要根据现有的驱动程序自己开发驱动程序。
英文:
You can find different phy drivers from https://github.com/azure-rtos/samples.
- mimxrt1060:KSZ8081RNB
- same54:KSZ8091RNA
- stm32f746:LAN8742A-CZ-TR
- rx65n rsk:DP83620SQE
For others, you will need to develop the driver by yourself, based on existing ones.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论