Setup:
HW:
Fanstel-WT02C40C (nrf5340/7002)
WIZ5500 ethernet
Versions tested:
ncs-v2.6.0
ncs-v2.5.2
ncs-v2.4.2
Issue:
When attempting to integrate Ethernet and BLE I'm running into an issue where DHCP fails to start the iface on the versions listed above, when introducing CONFIG_BT=y into my system.
I have a working implementation for both my BLE Mesh and for Ethernet, which failed when integrating together so I decided to start piecemeal it together slowly, and on the first step of adding CONFIG_BT=y to my project, is when DHCP begins failing to start Ethernet.
.overlay
&spi4 { w5500: w5500@0 { compatible = "wiznet,w5500"; reg = <0>; spi-max-frequency = <10000000>; zephyr,random-mac-address; int-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; reset-gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; }; };
.conf
# === Ethernet CONFIG_NETWORKING=y CONFIG_NET_IPV4=y CONFIG_NET_IPV6=n CONFIG_NET_DHCPV4=y CONFIG_NET_LOG=y CONFIG_NET_SHELL=y CONFIG_NET_STATISTICS=y CONFIG_DNS_RESOLVER=y CONFIG_NET_L2_ETHERNET=y CONFIG_ETHERNET_LOG_LEVEL_DBG=y CONFIG_NET_L2_ETHERNET_LOG_LEVEL_DBG=y CONFIG_NET_DHCPV4_LOG_LEVEL_DBG=y CONFIG_NET_L2_ETHERNET_MGMT=y CONFIG_ETH_W5500=y CONFIG_ETH_W5500_TIMEOUT=1000 CONFIG_NET_MGMT=y
Code:
struct net_if *iface; iface = net_if_get_default(); if (iface == NULL) { printk("Error getting default network interface.\n"); return; } // Link status callback handler net_mgmt_init_event_callback(&cb, net_mgmt_handler, NET_EVENT_ETHERNET_CARRIER_ON | NET_EVENT_ETHERNET_CARRIER_OFF); net_mgmt_add_event_callback(&cb); // Start DHCP net_dhcpv4_start(iface);
I also need to add WiFi to it, but that's another bridge to be crossed after dealing with this.