zephyr: nRF52840 nRF52833 Bluetooth: Timeout in `net_config_init_by_iface` but interface is up

Describe the bug I’m currently trying to build the bluetooth/ipsp sample and have run into a delay of 30 seconds when booting zephyr:

*** Booting Zephyr OS build v3.2.99-ncs1 ***                                                                             
[00:00:00.006,439] <inf> sdc_hci_driver: hci_driver_open: SoftDevice Controller build revision:                          
                                         6d 90 41 2a 38 e8 ad 17  29 a5 03 38 39 27 d7 85 |m.A*8... )..89'..             
                                         1f 85 d8 e1                                      |....                          
[00:00:00.008,941] <inf> bt_hci_core: hci_vs_init: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.008,972] <inf> bt_hci_core: hci_vs_init: HW Variant: nRF52x (0x0002)
[00:00:00.009,002] <inf> bt_hci_core: hci_vs_init: Firmware: Standard Bluetooth controller (0x00) Version 109.16784 Build 2917677098
[00:00:00.010,253] <inf> bt_hci_core: bt_dev_show_info: Identity: EA:6C:8A:46:50:5E (random)
[00:00:00.010,284] <inf> bt_hci_core: bt_dev_show_info: HCI: version 5.3 (0x0c) revision 0x11fa, manufacturer 0x0059
[00:00:00.010,345] <inf> bt_hci_core: bt_dev_show_info: LMP: version 5.3 (0x0c) subver 0x11fa
[00:00:30.011,871] <inf> ipsp: init_app: Run IPSP sample
[00:00:30.012,939] <inf> ipsp: listen: Starting to wait

It all boils down to CONFIG_NET_CONFIG_INIT_TIMEOUT=30 and the wait in net_config_init_by_iface located in subsys/net/lib/config/init.c. The semaphore is seemingly never given, thus net_config_init_by_iface returns -ENETDOWN after a delay of 30 seconds before the application is started.

However, it seems like the BT interface is up and running happily since it immediately pops up in my bluetoothctl

# scan le
Discovery started
[CHG] Controller 64:D6:9A:DD:D0:73 Discovering: yes
[NEW] Device EA:6C:8A:46:50:5E Test IPSP node

I’ve tested the sample an nRF52840-DK (2.0.1) and an nRF52833-DK (1.0.0) both showing the same behavior.

To Reproduce Steps to reproduce the behavior:

nRF52840:

zephyr/samples/bluetooth/ipsp (git)-[tags/v3.2.99-ncs1] % west build --pristine -b nrf52840_nrf52840dk --build-dir build/nrf52840dk_nrf52840/ipsp
zephyr/samples/bluetooth/ipsp (git)-[tags/v3.2.99-ncs1] % west flash --build-dir build/nrf52840dk_nrf52840/ipsp

nRF52833:

zephyr/samples/bluetooth/ipsp (git)-[tags/v3.2.99-ncs1] % west build --pristine -b nrf52833_nrf52833dk --build-dir build/nrf52833dk_nrf52833/ipsp
zephyr/samples/bluetooth/ipsp (git)-[tags/v3.2.99-ncs1] % west flash --build-dir build/nrf52833dk_nrf52833/ipsp

Expected behavior Since the interface is actively advertising itself, the interface seems to be up, but Zephyr does detect the interface beeing up. I would expect Zephyr to detect the interface being up and set it up properly instead of timing out.

Impact I’m currently unable to set up a prototype for a new product we need to pitch our CEO.

Logs and console output Network-Log Enabled:

[00:00:00.000,732] <dbg> net_bt: net_bt_init: (main): dev 0x5e310 driver_data 0x20000720                                                                                                      
[00:00:00.002,929] <dbg> net_if: net_if_init: (main):                                                                                                                                                              
[00:00:00.002,960] <dbg> net_if: init_iface: (main): On iface 0x20001c50                                                                                                                                           
[00:00:00.002,990] <dbg> net_bt: bt_iface_init: (main): iface 0x20001c50                                                                                                                                           
[00:00:00.003,051] <dbg> net_bt: bt_iface_init: (main): [0] alloc ctxt 0x20000720 iface 0x20001c50                                                                                                                 
[00:00:00.003,173] <dbg> net_if: update_operational_state: (main): iface 0x20001c50, oper state DOWN admin DOWN carrier ON dormant ON                                                                              
[00:00:00.003,204] <dbg> net_if: init_iface: (main): On iface 0x20001c58                                                                                                                                           
[00:00:00.003,234] <dbg> net_bt: bt_iface_init: (main): iface 0x20001c58                                                                                                                                           
[00:00:00.003,265] <dbg> net_bt: bt_iface_init: (main): [1] alloc ctxt 0x20000720 iface 0x20001c58                                                                                                                 
*** Booting Zephyr OS build v3.2.99-ncs1 ***                                                                                                                                                                       
[00:00:30.012,451] <err> net_config: net_config_init_by_iface: Timeout while waiting network interface                                                                                                             
[00:00:30.012,481] <err> net_config: net_config_init_app: Network initialization failed (-115)

Environment (please complete the following information):

  • OS: Debian 12
  • Toolchain: arm-zephyr-eabi-gcc
  • Nordic Variant c0689b16ff127d1b71a4cc20310d476e1807e26e

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (8 by maintainers)

Most upvoted comments

Do you establish connection with the Zephyr inteface? If not, the interface cannot be considered as operationally up, and that’s what Zephyr is waiting for. You can’t consider an interface as operational up, if you can’t send packets over it.