nrf9160dk undefined reference to `__device_dts_ord_82' (BT driver?) after adding CONFIG_SECURE_BOOT=y

I have an nrf9160dk setup with the bluetooth-hci-lpuart flashed to the nrf52 chip and a bt peripheral sample flashed to the nrf91. This works as expected.

However, I am trying to configure the upgradable bootloader chain and as soon as I add the option


The project not longer builds with a linker error:

zephyr/drivers/bluetooth/libdrivers__bluetooth.a(h4.c.obj): in function `bt_uart_init':
C:\Users\username\ncs\v1.9.1\zephyr\drivers\bluetooth\hci\h4.c:544: undefined reference to `__device_dts_ord_82'

If I understand correctly this is because the device cannot locate the BT driver? Am I missing a configuration?
  • Hi,

    You can find information about adding bootloader chain and customizing the bootloader in the documentation. 

    Where do you add CONFIG_SECURE_BOOT option?
    Could you please try to do the same from the command line

    west build -b nrf9160dk_nrf9160_ns <path_to_your_project_folder> -- -DCONFIG_SECURE_BOOT=y

    With  MCUboot, option -DCONFIG_BOOTLOADER_MCUBOOT=y  is also required.

    Best regards,

  • So I'm currently using the vscode plugin and tried to run west through the terminal commands... went all through setting up zephyr and west to try that way as I would prefer to have command line control but it was turning into a massive headache. So I went back to the vscode plugin (which runs west itself). 

    I was adding CONFIG_SECURE_BOOT=y to the prj.conf file which was leading to the linker error. I instead added it as an "Extra CMake argument" as -DCONFIG_SECURE_BOOT=y and it worked after running a new build with no errors.

    So I think I was confusing the kernel options with cmake options? Should I be able to include this in prj.conf?

    Thanks for the help

  • Hi,

    You should be able to include CONFIG_SECURE_BOOT=y to the prj.conf file which is located in your application's directory. However, you should have this option specified only in one place (not in both prj.conf and in west).
    In order to avoid linker error, you could try performing pristine build (or manually removing build folder) to build your target.

    Best regards,