nrf5340 Ethernet and BLE Mesh coexist

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.

  • Hi,

    First there are some things I need to know.

    1. Your case states Ethernet + Mesh coexistence while in the case you say BLE. Bluetooth Mesh and BLE are two different protocols, so where does BLE come into play?

      • 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.
      What errors are you getting? Can you provide any building and/or device logs?
    2. I see that you've seen this case:  DHCPv4 client + Ethernet (W5500) Fails to work in SDK 2.4 It looks to have a similar issue with the DHCP client as you observe. Did the fix resolve the issue?
    3. Have you had a look/asked around on the Zephyr forums regarding the Ethernet issues? We only have Ethernet support through Zephyr in the SDK so you might find more hits if you search around there
    4. Have you made sure that you have handled all the coexistence requirements w.r.t having multiple protocols in one device?
      1. https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/device_guides/wifi_coex.html

    Kind regards,
    Andreas

  • Hi Thanks for the reply,

    1. I have a fully working BLE Mesh project already, when I tried integrating my ethernet to it it started failing, so I started piecemeal all the configurations over to a working Ethernet sample. CONFIG_BT=y is a prerequisite to CONFIG_BT_MESH, and I didn't make it that far before I replicated the issue with DHCP failing to start the iface.

    Error: DHCP starts it's init, but fails to up the interface:
    Note: One thing though, on v2.4.2 DHCP actually gets into the selecting state but fails to ever serve an actual address. But v2.5+ exhibits the behavior below.

    [00:00:04.443,389] <dbg> net_dhcpv4: dhcpv4_manage_timers: (sysworkq): iface 0x20002228 dhcpv4=0x20002298 state=init timeleft=0
    uart:~$ net iface
    
    Interface eth0 (0x20002228) (Ethernet) [1]
    ===================================
    Interface is down.
    uart:~$ net iface up 1
    Cannot take interface 1 up (-120)


    2. The issue you linked was specifically for DHCP entering the selecting state and not being able to serve and address due to not be able to set the mac address for the eth_w5500, the issue above persists through this.

    3. I haven't found one yet, but I'll go ask about it over there as well, thanks for the recommendation.

    4. I've been able to get WiFi and BLE Mesh working together, I haven't found any such coexistence api's however for Ethernet and Bluetooth as a whole though

  • Noted, thank you for providing me with this. I'll look closer into your reply but I won't be able to give you a reply before earliest next week as I'm currently out of office. In the meanwhile, let me know if the zephyr issue gets you anywhere before then


    Kind regards,
    Andreas

  • Hi Wade,

    I've followed the zephyr issue you've made and it looks to me you will get better help there than here (the ethernet support comes from Zephyr through the w5500 so the expertise on the topic is more present on their end).

    I will leave the case open and keep monitoring the zephyr issue, so I recommend you keep pushing there if you've not already resolved it. Apologies for not being more of help than this.

    Kind regards,
    Andreas

Related