Hello Team,
Greetings!
I am working on the IMXRT1170-EVKB board and implementing dual Ethernet (ETH0 & ETH1) to work simultaneously at 100M and 1G speeds.
I started by importing the SDK example ""evkbmimxrt1170_lwip_ping_bm_cm7,"" which runs successfully in standalone mode within the same workspace. The Ethernet port selection is controlled using:
- "BOARD_NETWORK_USE_100M_ENET_PORT (1U)"
- "BOARD_NETWORK_USE_100M_ENET_PORT (0U)"
However, I need both Ethernet ports (100M and 1G) enabled concurrently. To achieve this, I have:
- Configured and initialized two Ethernet interfaces (100M and 1G) using lwIP.
- Assigned unique MAC addresses, PHY resources, and clock configurations.
- Created "netif_100M" and "netif_1G" structures for each interface.
Modifications in the Driver and Configuration Files:
1. Enabled "IP_FORWARD" in "opt.h".
2. Enabled ping initialization for both Ethernet interfaces.
3. Updated "lwipopts.h":
- Set "LWIP_SINGLE_NETIF = 0" to allow multiple interfaces.
- Set "LWIP_NUM_NETIF = 2" to define the maximum number of network interfaces.
After integrating these changes, I can successfully send pings for both Ethernet inputs. However, only the "1G Ethernet (ETH1) responds", while the "100M Ethernet (ETH0) does not receive any response".
I have attached the terminal screenshot and the complete modified project "evkbmimxrt1170_lwip_ping_bm_cm7" for reference. Could you please review my configuration and suggest any missing steps that might be causing this issue?
Looking forward to your guidance.
Thank you in advance!
Best Regards,
Prince Kumar
Great!
B.R,
Sam
Hello SAM,
Thank you for your feedback.
I am now able to see responses for both pings. After debugging the ping.c file, I found that the issue was with the ping_recv function, where the receive function was conflicting/overwriting packets for both targets.
To resolve this, I created a loop to handle multiple ping targets (ping_targets[2]), ensuring that both pings are processed correctly. The function now properly checks the received ICMP echo reply against both targets.
After these changes, both pings are working as expected.
Thanks, and best Regards,
Prince Kumar
It doesn't seem reasonable:) Would you please double check if the macros you mentioned above are enabled or not, and ping 192.168.1.x from other undependent sources.
I tried the attched package with MCUXPresso, but build failed.
Building file: ../drivers/fsl_cache.c
../lwip/doc/NO_SYS_SampleCode.c: In function 'eth_mac_irq':
../lwip/doc/NO_SYS_SampleCode.c:7:20: warning: implicit declaration of function 'pbuf_alloc' [-Wimplicit-function-declaration]
7 | struct pbuf* p = pbuf_alloc(PBUF_RAW, eth_data_count, PBUF_POOL);
| ^~~~~~~~~~
../lwip/doc/NO_SYS_SampleCode.c:7:31: error: 'PBUF_RAW' undeclared (first use in this function)
7 | struct pbuf* p = pbuf_alloc(PBUF_RAW, eth_data_count, PBUF_POOL);
| ^~~~~~~~
../lwip/doc/NO_SYS_SampleCode.c:7:31: note: each undeclared identifier is reported only once for each function it appears in
../lwip/doc/NO_SYS_SampleCode.c:7:41: error: 'eth_data_count' undeclared (first use in this function)
7 | struct pbuf* p = pbuf_alloc(PBUF_RAW, eth_data_count, PBUF_POOL);
| ^~~~~~~~~~~~~~
../lwip/doc/NO_SYS_SampleCode.c:7:57: error: 'PBUF_POOL' undeclared (first use in this function)
7 | struct pbuf* p = pbuf_alloc(PBUF_RAW, eth_data_count, PBUF_POOL);
| ^~~~~~~~~
../lwip/doc/NO_SYS_SampleCode.c:9:11: error: 'NULL' undeclared (first use in this function)
9 | if(p != NULL) {
| ^~~~
../lwip/doc/NO_SYS_SampleCode.c:1:1: note: 'NULL' is defined in header ''; did you forget to '#include '?
+++ |+#include
1 | void
../lwip/doc/NO_SYS_SampleCode.c:11:5: warning: implicit declaration of function 'pbuf_take' [-Wimplicit-function-declaration]
11 | pbuf_take(p, eth_data, eth_data_count);
| ^~~~~~~~~
../lwip/doc/NO_SYS_SampleCode.c:11:18: error: 'eth_data' undeclared (first use in this function)
11 | pbuf_take(p, eth_data, eth_data_count);
| ^~~~~~~~
../lwip/doc/NO_SYS_SampleCode.c:14:9: warning: implicit declaration of function 'queue_try_put' [-Wimplicit-function-declaration]
14 | if(!queue_try_put(&queue, p)) {
| ^~~~~~~~~~~~~
../lwip/doc/NO_SYS_SampleCode.c:14:24: error: 'queue' undeclared (first use in this function)
14 | if(!queue_try_put(&queue, p)) {
| ^~~~~
../lwip/doc/NO_SYS_SampleCode.c:16:7: warning: implicit declaration of function 'pbuf_free' [-Wimplicit-function-declaration]
16 | pbuf_free(p);
| ^~~~~~~~~
Hello Sam,
Thank you for your quick response.
I did the modification as suggested. removed/commented "netif_set_default(&netif_100M);" but still getting the same issue. Like pinging response getting only from 1G not from 100M.
B.R,
Prince Kumar
Hi @Princekmr
Please remove 'netif_set_default(&netif_100M);' in your code.
This function will enable a default interface instead, please comment it and test again.
B.R,
Sam