Compilation error when enabling the bluetooth (CONFIG_BT=y)

Hello,

I use NCS 2.8.0 and toolchain 2.8.0 for my build. Also, the boad is a custom board with NRF52840.

My zephyr application is structured as show in this link : https://github.com/nrfconnect/ncs-example-application 

My problem is that the program cannot be built when CONFIG_BT=y.

The following errors occur at the end of the compilation :

 [220/225] Linking C executable zephyr\zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map ....

............

./../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(
hci_core.c.obj):(.data.bt_dev+0x16c): undefined reference to `__device_dts_ord_98'

collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Thank you for your help.

Best regards,

Parents
  • Hi,

    ./../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(
    hci_core.c.obj):(.data.bt_dev+0x16c): undefined reference to `__device_dts_ord_98'

    This error might be devicetree problem for which there are some troubleshooting options.

    Best regards,
    Dejan

  • Hi Dejan,

    Thanks for your response. 

    Indeed, after verification in devicetree_generated.h, this DTS node ID concerns the bt_hci_sdc module that is used when the bluetooth is activated.
    So, I don't know why this error occured knowing that the build is complete for other code sample with BLE. 

    I have the following configurations if it helps : 

    CONFIG_GPIO=y
    CONFIG_PM_DEVICE=y
    CONFIG_REQUIRES_FULL_LIBC=y
    CONFIG_REQUIRES_FLOAT_PRINTF=y

    CONFIG_CMSIS_DSP=y
    CONFIG_CMSIS_DSP_FILTERING=y

    CONFIG_MAIN_STACK_SIZE=8192

    CONFIG_FLASH=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    CONFIG_FCB=y
    CONFIG_FLASH_MAP=y
    CONFIG_SETTINGS=y
    CONFIG_SETTINGS_FCB=y

    CONFIG_EVENTS=y
    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_BAS=y
    CONFIG_BT_SMP=y
    CONFIG_BT_DEVICE_NAME="My Device"
    Best regards,

  • Hi,

    Which code sample have you used?

    Can you upload your complete build log?

    Best regards,
    Dejan

  • Hello,

    I use a custom board with its devicetree.

    For the build log, I don't know how to generate it. I'm not familiar with VS code.

    Furthermore, I've tried to build my program with a nRF52840DK overlay DTS by integrating all HW configuration of my custom board in it. The result is different with build complete.

     By checking the generated autoconf.h file for this later, some config are present like : 

    #define CONFIG_BT_HCI_VS 1
    #define CONFIG_BT_CTLR 1
    #define CONFIG_BT_LL_SOFTDEVICE 1
    #define CONFIG_BT_HAS_HCI_VS 1
    #define CONFIG_MPSL 1
    And others ....
    Perhaps, I've omitted some config with the custom board. I don't know. 

    Best regards,
  • Hi,

    The build error in my program is due to the undeclared CONFIG_BT_CTRL.

    Indeed, the Kconfig.defconfig file of my board was not created and then the config below was not declared to enable the SoC native Bluetooth LE controller : 

    config BT_CTLR
        default BT
    After correction, the program with the custom board DTS has its build complete when CONFIG_BT=y and CONFIG_BT_PERIPHERAL=y. 
    Thank your very much for your time. 
    Best regards,
Reply
  • Hi,

    The build error in my program is due to the undeclared CONFIG_BT_CTRL.

    Indeed, the Kconfig.defconfig file of my board was not created and then the config below was not declared to enable the SoC native Bluetooth LE controller : 

    config BT_CTLR
        default BT
    After correction, the program with the custom board DTS has its build complete when CONFIG_BT=y and CONFIG_BT_PERIPHERAL=y. 
    Thank your very much for your time. 
    Best regards,
Children
Related