nrf_desktop application can't off the b0 bootloader

Dear Nordic Engineers

Our customers use the nrf_desktop  application to develop their product.

 They use the NCS 2.0.0\nrf\applications\nrf_desktop and build project on the nrf52840dk_nrf52840.

It looks normal. The program can run.

They would like off the b0 bootloader. So I went to their company to help them.

I read this link:https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrf/applications/nrf_desktop/README.html

The bo bootloader can set the following configs to open/off the b0 bootloader.
CONFIG_SECURE_BOOT
CONFIG_BUILD_S1_VARIANT
CONFIG_FW_INFO
CONFIG_FW_INFO_FIRMWARE_VERSION
CONFIG_SB_SIGNING_KEY_FILE

So I off this config on nrf\applications\nrf_desktop\configuration\nrf52840dk_nrf52840\prj.conf.

I rebuilt the project and it reports some errors. I found that it needs off "CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE".

Then the project can be built.I downloaded the program to PCA10056(V1.0.0). The program can't run. 

I review nrf_desktop\configuration\nrf52840dk_nrf52840\prj.conf of NCS V1.9.1 and NCS V2.0.0. Their difference is the following configs.

CONFIG_SECURE_BOOT
CONFIG_BUILD_S1_VARIANT
CONFIG_FW_INFO
CONFIG_FW_INFO_FIRMWARE_VERSION
CONFIG_SB_SIGNING_KEY_FILE

CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE

Do I need off other config? Please give me some good suggestions.

Best regards.

Parents
  • Hi,

    It should be possible to disable b0 bootloader by setting CONFIG_SECURE_BOOT=n. 

    I rebuilt the project and it reports some errors.

    Could you please show the error which you observed?

    Best regards,
    Dejan

  • Dear Dejans

    The following log is  only setting CONFIG_SECURE_BOOT=n 

    -- Found partition manager static configuration: E:/NCS/v2.0.0/nrf/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/pm_static.yml
    Partition 'settings_storage' is not included in the dynamic resolving since it is statically defined.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: E:/NCS/v2.0.0/nrf/applications/nrf_desktop/build_NRF52840
    -- west build: building application
    [1/302] Generating include/generated/version.h
    -- Zephyr version: 3.0.99 (E:/NCS/v2.0.0/zephyr), build: v3.0.99-ncs1
    [2/302] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json
    [3/302] Generating include/generated/kobj-types-enum.h, include/generated/otype-to-str.h, include/generated/otype-to-size.h
    [4/302] Generating include/generated/driver-validation.h
    [5/302] Generating include/generated/syscall_dispatch.c, include/generated/syscall_list.h
    [6/302] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
    [7/302] Generating include/generated/offsets.h
    [8/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32c_sw.c.obj
    [9/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf.c.obj
    [10/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32_sw.c.obj
    [11/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc8_sw.c.obj
    [12/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc7_sw.c.obj
    [13/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc16_sw.c.obj
    [14/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/hex.c.obj
    [15/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/dec.c.obj
    [16/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj
    [17/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_packaged.c.obj
    [18/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/notify.c.obj
    [19/302] Building C object CMakeFiles/app.dir/src/util/config_channel_transport.c.obj
    [20/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/sem.c.obj
    [21/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/thread_entry.c.obj
    [22/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj
    [23/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/timeutil.c.obj
    [24/302] Building ASM object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/common/soc_nrf_common.S.obj
    [25/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/rb.c.obj
    [26/302] Building C object zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj
    [27/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/onoff.c.obj
    [28/302] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_base_addresses.c.obj
    [29/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/reboot.c.obj
    [30/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/mpsc_pbuf.c.obj
    [31/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/multi_heap.c.obj
    [32/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/assert.c.obj
    [33/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap.c.obj
    [34/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/bitarray.c.obj
    [35/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/device/usb_descriptor.c.obj
    [36/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap-validate.c.obj
    [37/302] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_complete.c.obj
    [38/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_list.c.obj
    [39/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/net/lib/utils/addr_utils.c.obj
    [40/302] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_enabled_instances.c.obj
    [41/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_msg.c.obj
    [42/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_mgmt.c.obj
    [43/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_output.c.obj
    [44/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/bluetooth/services/dis.c.obj
    [45/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_core.c.obj
    [46/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_backend_rtt.c.obj
    [47/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_msg2.c.obj
    [48/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/state.c.obj
    [49/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings_nvs.c.obj
    [50/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/policy.c.obj
    [51/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings_init.c.obj
    [52/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings_line.c.obj
    [53/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/storage/flash_map/flash_map_layout.c.obj
    [54/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/pm.c.obj
    [55/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/storage/flash_map/flash_map_default.c.obj
    [56/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings_store.c.obj
    [57/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/storage/flash_map/flash_map.c.obj
    [58/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/fs/nvs/nvs.c.obj
    [59/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/device/usb_transfer.c.obj
    [60/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/settings/src/settings.c.obj
    [61/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/tracing/tracing_none.c.obj
    [62/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/nrf/subsys/caf/events/power_event.c.obj
    [63/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/device.c.obj
    [64/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/nrf/subsys/bluetooth/conn_ctx.c.obj
    [65/302] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/usb/device/usb_device.c.obj
    [66/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/nrf/subsys/bluetooth/gatt_pool.c.obj
    [67/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/nrf/subsys/app_event_manager/app_event_manager.c.obj
    [68/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/nrf/subsys/caf/events/button_event.c.obj
    [69/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/nrf/subsys/caf/events/force_power_down_event.c.obj
    [70/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/nrf/subsys/caf/events/module_state_event.c.obj
    [71/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/nrf/subsys/caf/events/click_event.c.obj
    [72/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/nrf/subsys/caf/events/ble_common_event.c.obj
    [73/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/nrf/subsys/caf/events/keep_alive_event.c.obj
    [74/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/modules/crypto/tinycrypt/lib/source/cmac_mode.c.obj
    [75/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/nrf/subsys/caf/events/led_event.c.obj
    [76/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/modules/crypto/tinycrypt/lib/source/utils.c.obj
    [77/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/modules/crypto/tinycrypt/lib/source/aes_decrypt.c.obj
    [78/302] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/vector_table.S.obj
    [79/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/modules/crypto/tinycrypt/lib/source/aes_encrypt.c.obj
    [80/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/nrf/subsys/bluetooth/services/hids.c.obj
    [81/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/nrf/subsys/caf/events/power_manager_event.c.obj
    [82/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/nrfxlib/crypto/nrf_cc310_platform/src/nrf_cc3xx_platform_mutex_zephyr.c.obj
    [83/302] Building C object zephyr/CMakeFiles/zephyr.dir/E_/NCS/v2.0.0/nrfxlib/crypto/nrf_cc310_platform/src/nrf_cc3xx_platform_abort_zephyr.c.obj
    [84/302] Building C object modules/nrf/drivers/mpsl/clock_control/CMakeFiles/..__nrf__drivers__mpsl__clock_control.dir/nrfx_clock_mpsl.c.obj
    [85/302] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/scb.c.obj
    [86/302] Generating linker_zephyr_pre1.cmd
    [87/302] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/thread_abort.c.obj
    [88/302] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/E_/NCS/v2.0.0/modules/hal/nordic/nrfx/mdk/system_nrf52840.c.obj
    [89/302] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/E_/NCS/v2.0.0/modules/hal/nordic/nrfx/helpers/nrfx_flag32_allocator.c.obj
    [90/302] Building C object modules/nrf/drivers/hw_cc310/CMakeFiles/..__nrf__drivers__hw_cc310.dir/hw_cc310.c.obj
    [91/302] Linking C static library zephyr\libzephyr.a
    [92/302] Linking C static library modules\nrf\drivers\mpsl\clock_control\lib..__nrf__drivers__mpsl__clock_control.a
    [93/302] Building C object modules/nrf/drivers/mpsl/flash_sync/CMakeFiles/..__nrf__drivers__mpsl__flash_sync.dir/flash_sync_mpsl.c.obj
    [94/302] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/nrfx_glue.c.obj
    [95/302] Building C object modules/segger/CMakeFiles/modules__segger.dir/SEGGER_RTT_zephyr.c.obj
    [96/302] Linking C static library modules\nrf\drivers\hw_cc310\lib..__nrf__drivers__hw_cc310.a
    [97/302] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/E_/NCS/v2.0.0/modules/hal/nordic/nrfx/drivers/src/nrfx_nvmc.c.obj
    [98/302] Linking C static library modules\nrf\drivers\mpsl\flash_sync\lib..__nrf__drivers__mpsl__flash_sync.a
    [99/302] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/E_/NCS/v2.0.0/modules/hal/nordic/nrfx/drivers/src/nrfx_power.c.obj
    [100/302] Building C object zephyr/kernel/CMakeFiles/kernel.dir/main_weak.c.obj
    [101/302] Building C object CMakeFiles/app.dir/configuration/common/hid_report_desc.c.obj
    [102/302] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/E_/NCS/v2.0.0/modules/hal/nordic/nrfx/drivers/src/nrfx_pwm.c.obj
    [103/302] Building C object modules/segger/CMakeFiles/modules__segger.dir/E_/NCS/v2.0.0/modules/debug/segger/SEGGER/SEGGER_RTT.c.obj
    [104/302] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/E_/NCS/v2.0.0/modules/hal/nordic/nrfx/drivers/src/nrfx_gpiote.c.obj
    [105/302] Building C object CMakeFiles/app.dir/src/main.c.obj
    [106/302] Building C object CMakeFiles/app.dir/src/events/ble_event.c.obj
    [107/302] Building C object CMakeFiles/app.dir/src/events/battery_event.c.obj
    [108/302] Building C object CMakeFiles/app.dir/src/events/motion_event.c.obj
    [109/302] Linking C static library modules\segger\libmodules__segger.a
    [110/302] Building C object CMakeFiles/app.dir/src/events/selector_event.c.obj
    [111/302] Building C object CMakeFiles/app.dir/src/events/passkey_event.c.obj
    [112/302] Building C object CMakeFiles/app.dir/src/events/wheel_event.c.obj
    [113/302] Building C object CMakeFiles/app.dir/src/events/config_event.c.obj
    [114/302] Building C object CMakeFiles/app.dir/src/events/usb_event.c.obj
    [115/302] Building C object CMakeFiles/app.dir/src/events/hid_event.c.obj
    [116/302] Building C object CMakeFiles/app.dir/src/hw_interface/board.c.obj
    [117/302] Building C object CMakeFiles/app.dir/src/hw_interface/motion_buttons.c.obj
    [118/302] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/E_/NCS/v2.0.0/modules/hal/nordic/nrfx/drivers/src/nrfx_usbd.c.obj
    [119/302] Building C object CMakeFiles/app.dir/src/events/hids_event.c.obj
    [120/302] Building C object CMakeFiles/app.dir/src/modules/info.c.obj
    [121/302] Building C object CMakeFiles/app.dir/src/modules/ble_latency.c.obj
    [122/302] Building C object CMakeFiles/app.dir/src/modules/hid_state_pm.c.obj
    [123/302] Linking C static library modules\hal_nordic\nrfx\libmodules__hal_nordic__nrfx.a
    [124/302] Building C object CMakeFiles/app.dir/src/modules/usb_state_pm.c.obj
    [125/302] Building C object CMakeFiles/app.dir/src/modules/led_state.c.obj
    [126/302] Building C object CMakeFiles/app.dir/src/modules/dev_descr.c.obj
    [127/302] Building C object CMakeFiles/app.dir/src/modules/hfclk_lock.c.obj
    [128/302] Building C object CMakeFiles/app.dir/src/modules/usb_state.c.obj
    [129/302] Building C object CMakeFiles/app.dir/src/util/hwid.c.obj
    [130/302] Building C object CMakeFiles/app.dir/src/modules/ble_bond.c.obj
    [131/302] Building C object CMakeFiles/app.dir/src/modules/bas.c.obj
    [132/302] Building C object zephyr/kernel/CMakeFiles/kernel.dir/banner.c.obj
    [133/302] Building C object zephyr/kernel/CMakeFiles/kernel.dir/errno.c.obj
    [134/302] Building C object zephyr/kernel/CMakeFiles/kernel.dir/device.c.obj
    [135/302] Building C object CMakeFiles/app.dir/src/modules/hids.c.obj
    [136/302] Building C object CMakeFiles/app.dir/src/modules/hid_state.c.obj
    [137/302] Building C object CMakeFiles/app.dir/src/modules/dfu.c.obj
    FAILED: CMakeFiles/app.dir/src/modules/dfu.c.obj
    E:\NCS\toolchains\v2.0.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DEXT_API_MAGIC=0x281ee6de,0xb845acea,13314 -DFIRMWARE_INFO_MAGIC=0x281ee6de,0x8fcebb4c,13314 -DKERNEL -DNRF52840_XXAA -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -I../src/events -I../src/util -IE:/NCS/v2.0.0/nrf/drivers/mpsl/clock_control -IE:/NCS/v2.0.0/zephyr/include/zephyr -IE:/NCS/v2.0.0/zephyr/include -Izephyr/include/generated -IE:/NCS/v2.0.0/zephyr/soc/arm/nordic_nrf/nrf52 -IE:/NCS/v2.0.0/zephyr/soc/arm/nordic_nrf/common/. -IE:/NCS/v2.0.0/zephyr/subsys/bluetooth -IE:/NCS/v2.0.0/zephyr/subsys/usb/device -IE:/NCS/v2.0.0/zephyr/subsys/settings/include -IE:/NCS/v2.0.0/nrf/include -IE:/NCS/v2.0.0/nrf/lib/multithreading_lock/. -IE:/NCS/v2.0.0/nrf/subsys/bluetooth/controller/. -IE:/NCS/v2.0.0/nrf/subsys/app_event_manager/. -IE:/NCS/v2.0.0/nrf/subsys/app_event_manager_profiler_tracer/. -IE:/NCS/v2.0.0/zephyr/drivers/flash -IE:/NCS/v2.0.0/modules/hal/cmsis/CMSIS/Core/Include -IE:/NCS/v2.0.0/modules/hal/nordic/nrfx -IE:/NCS/v2.0.0/modules/hal/nordic/nrfx/drivers/include -IE:/NCS/v2.0.0/modules/hal/nordic/nrfx/mdk -IE:/NCS/v2.0.0/zephyr/modules/hal_nordic/nrfx/. -IE:/NCS/v2.0.0/modules/debug/segger/SEGGER -IE:/NCS/v2.0.0/modules/debug/segger/Config -IE:/NCS/v2.0.0/zephyr/modules/segger/. -IE:/NCS/v2.0.0/modules/crypto/tinycrypt/lib/include -IE:/NCS/v2.0.0/nrfxlib/mpsl/include -IE:/NCS/v2.0.0/nrfxlib/mpsl/include/protocol -I../configuration/common -I../configuration/nrf52840dk_nrf52840 -IE:/NCS/v2.0.0/nrfxlib/softdevice_controller/include -isystem E:/NCS/v2.0.0/zephyr/lib/libc/minimal/include -isystem e:/ncs/toolchains/v2.0.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/include -isystem e:/ncs/toolchains/v2.0.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/include-fixed -isystem E:/NCS/v2.0.0/nrfxlib/crypto/nrf_cc310_platform/include -O2 -imacros E:/NCS/v2.0.0/nrf/applications/nrf_desktop/build_NRF52840/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -imacros E:/NCS/v2.0.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=E:/NCS/v2.0.0/nrf/applications/nrf_desktop=CMAKE_SOURCE_DIR -fmacro-prefix-map=E:/NCS/v2.0.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=E:/NCS/v2.0.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/src/modules/dfu.c.obj -MF CMakeFiles\app.dir\src\modules\dfu.c.obj.d -o CMakeFiles/app.dir/src/modules/dfu.c.obj -c ../src/modules/dfu.c
    e:\NCS\v2.0.0\nrf\applications\nrf_desktop\src\modules\dfu.c:67:3: error: #error Bootloader not supported.
    67 | #error Bootloader not supported.
    | ^~~~~
    In file included from E:\NCS\v2.0.0\zephyr\include\zephyr\toolchain.h:50,
    from E:\NCS\v2.0.0\zephyr\include\zephyr\sys\__assert.h:11,
    from E:\NCS\v2.0.0\zephyr\include\zephyr\sys\byteorder.h:16,
    from e:\NCS\v2.0.0\nrf\applications\nrf_desktop\src\modules\dfu.c:10:
    ../src/modules/dfu.c: In function 'dfu_slot_id':
    e:\NCS\v2.0.0\nrf\applications\nrf_desktop\src\modules\dfu.c:113:15: error: 'IMAGE0_ADDRESS' undeclared (first use in this function); did you mean 'PM_B0_ADDRESS'?
    113 | BUILD_ASSERT(IMAGE0_ADDRESS < IMAGE1_ADDRESS);
    | ^~~~~~~~~~~~~~
    E:\NCS\v2.0.0\zephyr\include\zephyr\toolchain\gcc.h:77:51: note: in definition of macro 'BUILD_ASSERT'
    77 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert(EXPR, "" MSG)
    | ^~~~
    e:\NCS\v2.0.0\nrf\applications\nrf_desktop\src\modules\dfu.c:113:15: note: each undeclared identifier is reported only once for each function it appears in
    113 | BUILD_ASSERT(IMAGE0_ADDRESS < IMAGE1_ADDRESS);
    | ^~~~~~~~~~~~~~
    E:\NCS\v2.0.0\zephyr\include\zephyr\toolchain\gcc.h:77:51: note: in definition of macro 'BUILD_ASSERT'
    77 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert(EXPR, "" MSG)
    | ^~~~
    e:\NCS\v2.0.0\nrf\applications\nrf_desktop\src\modules\dfu.c:113:32: error: 'IMAGE1_ADDRESS' undeclared (first use in this function); did you mean 'PM_S1_ADDRESS'?
    113 | BUILD_ASSERT(IMAGE0_ADDRESS < IMAGE1_ADDRESS);
    | ^~~~~~~~~~~~~~
    E:\NCS\v2.0.0\zephyr\include\zephyr\toolchain\gcc.h:77:51: note: in definition of macro 'BUILD_ASSERT'
    77 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert(EXPR, "" MSG)
    | ^~~~
    e:\NCS\v2.0.0\nrf\applications\nrf_desktop\src\modules\dfu.c:113:15: error: expression in static assertion is not an integer
    113 | BUILD_ASSERT(IMAGE0_ADDRESS < IMAGE1_ADDRESS);
    | ^~~~~~~~~~~~~~
    E:\NCS\v2.0.0\zephyr\include\zephyr\toolchain\gcc.h:77:51: note: in definition of macro 'BUILD_ASSERT'
    77 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert(EXPR, "" MSG)
    | ^~~~
    e:\NCS\v2.0.0\nrf\applications\nrf_desktop\src\modules\dfu.c:115:10: error: 'IMAGE1_ID' undeclared (first use in this function)
    115 | return IMAGE1_ID;
    | ^~~~~~~~~
    e:\NCS\v2.0.0\nrf\applications\nrf_desktop\src\modules\dfu.c:118:9: error: 'IMAGE0_ID' undeclared (first use in this function)
    118 | return IMAGE0_ID;
    | ^~~~~~~~~
    ../src/modules/dfu.c: In function 'handle_dfu_bootloader_variant':
    e:\NCS\v2.0.0\nrf\applications\nrf_desktop\src\modules\dfu.c:502:17: error: 'BOOTLOADER_NAME' undeclared (first use in this function)
    502 | *size = strlen(BOOTLOADER_NAME);
    | ^~~~~~~~~~~~~~~
    ../src/modules/dfu.c: In function 'fetch_config':
    e:\NCS\v2.0.0\nrf\applications\nrf_desktop\src\modules\dfu.c:663:3: warning: implicit declaration of function 'handle_image_info_request'; did you mean 'handle_reboot_request'? [-Wimplicit-function-declaration]
    663 | handle_image_info_request(data, size);
    | ^~~~~~~~~~~~~~~~~~~~~~~~~
    | handle_reboot_request
    ../src/modules/dfu.c: In function 'dfu_slot_id':
    e:\NCS\v2.0.0\nrf\applications\nrf_desktop\src\modules\dfu.c:120:1: warning: control reaches end of non-void function [-Wreturn-type]
    120 | }
    | ^
    [138/302] Building C object zephyr/kernel/CMakeFiles/kernel.dir/version.c.obj
    [139/302] Building C object zephyr/kernel/CMakeFiles/kernel.dir/kheap.c.obj
    [140/302] Building C object zephyr/kernel/CMakeFiles/kernel.dir/init.c.obj
    [141/302] Building C object zephyr/kernel/CMakeFiles/kernel.dir/fatal.c.obj
    [142/302] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mem_slab.c.obj
    [143/302] Building C object zephyr/kernel/CMakeFiles/kernel.dir/idle.c.obj
    [144/302] Building C object zephyr/kernel/CMakeFiles/kernel.dir/thread.c.obj
    [145/302] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mailbox.c.obj
    [146/302] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mutex.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'e:\NCS\toolchains\v2.0.0\opt\bin\cmake.EXE' --build 'e:\NCS\v2.0.0\nrf\applications\nrf_desktop\build_NRF52840'
    终端进程已终止,退出代码: 1。
    The following code is my prj.conf setting.

    #
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    ################################################################################
    # Application Configuration
    
    CONFIG_DESKTOP_INIT_LOG_MOTION_EVENT=n
    CONFIG_DESKTOP_INIT_LOG_HID_REPORT_EVENT=n
    CONFIG_DESKTOP_INIT_LOG_HID_REPORT_SENT_EVENT=n
    CONFIG_CAF_INIT_LOG_KEEP_ALIVE_EVENTS=n
    
    CONFIG_DESKTOP_HID_REPORT_DESC="configuration/common/hid_report_desc.c"
    
    CONFIG_DESKTOP_HID_MOUSE=y
    CONFIG_DESKTOP_HID_STATE_ENABLE=y
    CONFIG_DESKTOP_HID_BOOT_INTERFACE_MOUSE=y
    
    CONFIG_DESKTOP_MOTION_BUTTONS_ENABLE=y
    CONFIG_DESKTOP_MOTION_UP_KEY_ID=0
    CONFIG_DESKTOP_MOTION_DOWN_KEY_ID=3
    CONFIG_DESKTOP_MOTION_LEFT_KEY_ID=2
    CONFIG_DESKTOP_MOTION_RIGHT_KEY_ID=1
    
    CONFIG_CAF=y
    CONFIG_CAF_PM_EVENTS=y
    CONFIG_CAF_POWER_MANAGER=y
    
    CONFIG_CAF_BUTTONS=y
    CONFIG_CAF_BUTTONS_POLARITY_INVERSED=y
    CONFIG_CAF_BUTTONS_PM_KEEP_ALIVE=n
    
    CONFIG_CAF_CLICK_DETECTOR=y
    
    CONFIG_CAF_LEDS=y
    
    CONFIG_CAF_BLE_STATE=y
    CONFIG_DESKTOP_BLE_BOND_ENABLE=y
    
    CONFIG_CAF_BLE_ADV=y
    CONFIG_CAF_BLE_ADV_DIRECT_ADV=n
    CONFIG_CAF_BLE_ADV_FAST_ADV=y
    CONFIG_CAF_BLE_ADV_SWIFT_PAIR=y
    
    CONFIG_CAF_SETTINGS_LOADER=y
    
    CONFIG_DESKTOP_USB_ENABLE=y
    
    CONFIG_DESKTOP_BLE_USE_DEFAULT_ID=y
    
    CONFIG_DESKTOP_BLE_PEER_CONTROL=y
    CONFIG_DESKTOP_BLE_PEER_CONTROL_BUTTON=0x0000
    CONFIG_DESKTOP_BLE_PEER_ERASE_ON_START=y
    
    CONFIG_DESKTOP_BLE_SECURITY_FAIL_TIMEOUT_S=10
    CONFIG_DESKTOP_BLE_LOW_LATENCY_LOCK=y
    
    CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y
    CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=y
    
    CONFIG_DESKTOP_HFCLK_LOCK_ENABLE=y
    
    ################################################################################
    # Zephyr Configuration
    
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536
    CONFIG_ISR_STACK_SIZE=1536
    CONFIG_MAIN_STACK_SIZE=768
    CONFIG_BT_RX_STACK_SIZE=2048
    CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y
    CONFIG_BT_HCI_TX_STACK_SIZE=1536
    
    CONFIG_BOOT_BANNER=n
    
    CONFIG_NUM_COOP_PRIORITIES=10
    CONFIG_NUM_PREEMPT_PRIORITIES=11
    
    CONFIG_HEAP_MEM_POOL_SIZE=512
    
    CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000
    CONFIG_SYSTEM_CLOCK_NO_WAIT=y
    
    CONFIG_PM_POLICY_CUSTOM=y
    
    CONFIG_HW_STACK_PROTECTION=y
    CONFIG_RESET_ON_FATAL_ERROR=n
    
    CONFIG_GPIO=y
    
    CONFIG_SERIAL=n
    CONFIG_CONSOLE=n
    CONFIG_UART_CONSOLE=n
    
    CONFIG_HWINFO=y
    
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_NVS=y
    
    CONFIG_SETTINGS=y
    CONFIG_SETTINGS_NVS=y
    
    CONFIG_REBOOT=y
    
    CONFIG_SPEED_OPTIMIZATIONS=y
    
    CONFIG_PWM=y
    
    CONFIG_LED=y
    CONFIG_LED_PWM=y
    
    CONFIG_USB_NRFX=y
    CONFIG_USB_DEVICE_STACK=y
    CONFIG_USB_DEVICE_MANUFACTURER="Nordic Semiconductor ASA"
    CONFIG_USB_DEVICE_PRODUCT="Mouse nRF52 Desktop"
    CONFIG_USB_DEVICE_VID=0x1915
    CONFIG_USB_DEVICE_PID=0x52DE
    CONFIG_USB_DEVICE_REMOTE_WAKEUP=y
    CONFIG_USB_DEVICE_HID=y
    CONFIG_USB_DEVICE_LOG_LEVEL_OFF=y
    CONFIG_USB_DRIVER_LOG_LEVEL_OFF=y
    CONFIG_USB_HID_POLL_INTERVAL_MS=1
    CONFIG_USB_HID_BOOT_PROTOCOL=y
    CONFIG_USB_HID_PROTOCOL_CODE=2
    
    CONFIG_BT=y
    CONFIG_BT_SETTINGS=y
    CONFIG_BT_SMP=y
    CONFIG_BT_SIGNING=y
    CONFIG_BT_MAX_PAIRED=2
    CONFIG_BT_ID_MAX=3
    CONFIG_BT_LL_SOFTDEVICE=y
    
    CONFIG_BT_DEVICE_NAME="Mouse nRF52 Desktop"
    CONFIG_BT_DEVICE_APPEARANCE=962
    
    CONFIG_BT_CTLR=y
    CONFIG_BT_CTLR_CONN_PARAM_REQ=n
    CONFIG_BT_CTLR_SDC_LLPM=y
    CONFIG_BT_CTLR_TX_PWR_0=y
    CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y
    CONFIG_BT_CONN_TX_MAX=4
    
    CONFIG_BT_DATA_LEN_UPDATE=n
    CONFIG_BT_AUTO_PHY_UPDATE=n
    
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_PERIPHERAL_PREF_MIN_INT=6
    CONFIG_BT_PERIPHERAL_PREF_MAX_INT=6
    CONFIG_BT_PERIPHERAL_PREF_LATENCY=99
    CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=400
    
    CONFIG_BT_CONN_PARAM_UPDATE_TIMEOUT=1000
    
    CONFIG_BT_FILTER_ACCEPT_LIST=y
    
    CONFIG_BT_GATT_UUID16_POOL_SIZE=27
    CONFIG_BT_GATT_CHRC_POOL_SIZE=7
    CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE=y
    CONFIG_BT_SETTINGS_CCC_LAZY_LOADING=n
    
    CONFIG_BT_DIS=y
    CONFIG_BT_DIS_MANUF="Nordic Semiconductor ASA"
    CONFIG_BT_DIS_MODEL="Mouse nRF52 Desktop"
    CONFIG_BT_DIS_PNP=y
    CONFIG_BT_DIS_PNP_VID_SRC=2
    CONFIG_BT_DIS_PNP_VID=0x1915
    CONFIG_BT_DIS_PNP_PID=0x52DE
    CONFIG_BT_DIS_PNP_VER=0x0100
    
    CONFIG_BT_HIDS_INPUT_REP_MAX=1
    CONFIG_BT_HIDS_OUTPUT_REP_MAX=0
    CONFIG_BT_HIDS_FEATURE_REP_MAX=1
    CONFIG_BT_HIDS_ATTR_MAX=19
    CONFIG_BT_HIDS_DEFAULT_PERM_RW_ENCRYPT=y
    CONFIG_BT_CONN_CTX=y
    
    CONFIG_ENTROPY_CC3XX=n
    
    CONFIG_APP_EVENT_MANAGER=y
    
    ################################################################################
    
    CONFIG_ASSERT=y
    CONFIG_ASSERT_LEVEL=2
    
    CONFIG_LOG=y
    CONFIG_LOG_DEFAULT_LEVEL=2
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_BACKEND_RTT_MODE_DROP=y
    CONFIG_LOG_MODE_OVERFLOW=y
    CONFIG_LOG_PRINTK=y
    CONFIG_LOG_BUFFER_SIZE=4096
    CONFIG_LOG_BACKEND_RTT_MESSAGE_SIZE=256
    CONFIG_LOG_BACKEND_SHOW_COLOR=n
    CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n
    CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1024
    
    CONFIG_CONSOLE=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=4096
    CONFIG_RTT_CONSOLE=y
    CONFIG_UART_CONSOLE=n
    
    ################################################################################
    # Bootloader Configuration
    
    CONFIG_SECURE_BOOT=n
    CONFIG_BUILD_S1_VARIANT=y
    CONFIG_FW_INFO=y
    CONFIG_FW_INFO_FIRMWARE_VERSION=1
    CONFIG_SB_SIGNING_KEY_FILE="configuration/nrf52840dk_nrf52840/b0_private.pem"

  • Dear Dejans

    This file is my nrf_deskop.

    I only change two config,they are CONFIG_SECURE_BOOT=n” and “CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=n

    You can review nrf_desktop\build_nrf52840\zephyr\.config and nrf_desktop\configuration\nrf52840dk_nrf52840\prj.conf.

    Best regards.

  • Hi,

    I have tried your provided sample nrf_desktop.zip. I have noticed the presence of -DBOARD_ROOT:STRING="e:/NCS/my_samples/serial_lte_modem" and app.overlay. In addition, your prj.conf has had CONFIG_SECURE_BOOT=n, but does not have CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=n. Is there any reason for this?
    When I flashed your project, LEDs were not turned on.

    I have also tried your merged1.hex and merged2.hex. Merged1.hex does turn LED1 ON and LED2 ON/OFF, but merged2.hex does not turn ON any LEDs.

    Best regards,
    Dejan

  • Dear Dejans

    1. You can delete my build files and rebuild a new build project for nrf52840dk.

    2. "CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE" is a default config of nrf_desktop.

    Its default config is "CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=y".

    So you should look for it to prj.conf's line 60.

    3. Yes, merged2.hex does not turn ON any LEDs and you can't use phone or PC's bluetooth scan advertising of DK.

    I tried to three PCs to build and test nrf_desktop for this problem. This problem reappears every time.

    So I think this problem is a bug of NCS 2.0.0.

    4. You can use your PC and PCA10056(v1.0.0) to copy this way.

    You only close "CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE" and "CONFIG_SECURE_BOOT" in your prj.conf of nrf_desktop.

    Then build the project and download program to PCA10056(v1.0.0).

    This problem will recurrence.

    Best regards.

  • Hi,

    I have tested the nrf_desktop sample again. I observed as well the LEDs behavior and I could reproduce the sttus of the LEDs. With relevant two options (CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE and CONFIG_SECURE_BOOT) enabled, LEDs are turned ON, but with two options disabled LEDs are not turned ON. This is expected as shown in the LED stream module configuration. CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=n disables LEDs.

    Best regards,
    Dejan

  • Dear Dejans

    If set  "CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=n" and "CONFIG_SECURE_BOOT=y",the project will not be build.

    And close "CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE",the program will not have advertising.

    So how to close b0 bootloader?

    Best regards.

Reply Children
Related