Problem with BLE advertisement after migration to NCS v2.9.0

Hello,

I had working BLE application build on v2.6.2.
After migration to SDK v2.9.0 BLE is not advertising anymore.
I think it may be related to default controller that is used in newer version of SDK.

Previous setup:
Custom board
NCS v2.6.2
Zephyr SDK: 0.16.5

Current setup:
Custom board (same as before)
NCS v2.9.0
Zephyr SDK: 0.16.5

I was also trying to change the bt controller by applying following changes to DTS:

chosen {
		zephyr,bt_hci = &bt_hci_controller;
};

&bt_hci_sdc {
    status = "disabled";
};

&bt_hci_controller {
    status = "okay";
};


But then build is not even passing:
In file included from /workspaces/zephyr/modules/hal_nordic/nrfx/./nrfx_glue.h:318,
                 from /workspaces/modules/hal/nordic/nrfx/nrfx.h:39,
                 from /workspaces/zephyr/soc/nordic/common/./soc_nrf_common.h:14,
                 from /workspaces/zephyr/soc/nordic/nrf52/./soc.h:14,
                 from /workspaces/zephyr/modules/cmsis/./cmsis_core_m.h:24,
                 from /workspaces/zephyr/modules/cmsis/./cmsis_core.h:10,
                 from /workspaces/zephyr/include/zephyr/arch/arm/asm_inline_gcc.h:24,
                 from /workspaces/zephyr/include/zephyr/arch/arm/asm_inline.h:18,
                 from /workspaces/zephyr/include/zephyr/arch/arm/arch.h:30,
                 from /workspaces/zephyr/include/zephyr/arch/cpu.h:19,
                 from /workspaces/zephyr/include/zephyr/kernel_includes.h:36,
                 from /workspaces/zephyr/include/zephyr/kernel.h:17,
                 from /workspaces/zephyr/arch/arm/core/offsets/offsets_aarch32.c:28,
                 from /workspaces/zephyr/arch/arm/core/offsets/offsets.c:9:
/workspaces/zephyr/modules/hal_nordic/nrfx/./nrfx_config_reserved_resources_ncs.h:42:10: fatal error: bt_ctlr_used_resources.h: No such file or directory
   42 | #include <bt_ctlr_used_resources.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Parents
  • Hello,

    SDK v2.9.0 will default to using the Softdevice controller (SDC), same the older SDK versions. Have you tried to get logs or start a debug session from VS code to see if the program reaches the advertising start function? 

    The build error you get after selecting the Zephyr controller indicates a configuration issue, but it is difficult to pinpoint which without having your project setup in front of me. Maybe it could be related to the board definition. The way boards are defined was changed in SDK v2.7.0 with the introduction of 'hardware model v2'. This means you should update your existing board to match the new model when using v2.7.0 and later. If you have not updated your board yet, please follow the migration notes at https://docs.nordicsemi.com/bundle/ncs-3.0.0-rc2/page/nrf/releases_and_maturity/migration/migration_hwmv2.html.  If you are you able to build your application for 52840dk/nrf52840 with overlays, you can use that to compare the .config files between the failing and working buildin (build/<app name>/zephyr/.config)

    Best regards,

    Vidar 

  • I extracted some information from my_board.dts into app.overly and rebuilded on nrf52840 with:

    chosen {
    		zephyr,bt_hci = &bt_hci_controller;
    };
    
    &bt_hci_sdc {
        status = "disabled";
    };
    
    &bt_hci_controller {
        status = "okay";
    };


    Unfortunately problem persist:
    /workspaces/zephyr/modules/hal_nordic/nrfx/./nrfx_config_reserved_resources_ncs.h:42:10: fatal error: bt_ctlr_used_resources.h: No such file or directory
       42 | #include <bt_ctlr_used_resources.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~


    I'm aware of hardware model change and applied those changes.

    Before I tried to build with the zpehyr BLE stack I also tried to run it with nordic stack. I can confirm that it's starting but looks like it's freezing it's execution (?):

    rtt:~$ [00:00:24.492,919] <inf> bt_sdc_hci_driver: SoftDevice Controller build revision: 
                                                2d 79 a1 c8 6a 40 b7 3c  f6 74 f9 0b 22 d3 c4 80 |-y..j@.< .t.."...
                                                74 72 82 ba                                      |tr..       

  • I'm still not able to reproduce the error here. I tried with the peripheral_lbs sample and created an overlay similar to yours to select the Zephyr controller:

    jkop_thaumatec said:
    Before I tried to build with the zpehyr BLE stack I also tried to run it with nordic stack. I can confirm that it's starting but looks like it's freezing it's execution (?):

    Please start a debug session via our VS code extension, GDB, or Segger Ozone, and try to see where the program hangs. 

Reply
  • I'm still not able to reproduce the error here. I tried with the peripheral_lbs sample and created an overlay similar to yours to select the Zephyr controller:

    jkop_thaumatec said:
    Before I tried to build with the zpehyr BLE stack I also tried to run it with nordic stack. I can confirm that it's starting but looks like it's freezing it's execution (?):

    Please start a debug session via our VS code extension, GDB, or Segger Ozone, and try to see where the program hangs. 

Children
No Data
Related