Add FOTA over BLE to nrf9151+nrf52840

Hi,

I have a board which is nrf9151 with nrf52840 as BLE controller connected via hci_lpuart. This works fine so far, I am able to do simple AT commands as well as doing some BLE communication. I am using TF-M for nrf9151

Now I am trying to add FOTA over BLE and I just cannot get this to work. To not complicate it even more I am trying the old way - not using sysbuild, but it doesn't help.

So what I have tried:
1. Add child_image/mcu_boot.conf
2. Add configuration to proj.conf
```

CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_SECURE_BOOT=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
```

I am using ncs 2.7.0

Best regards,
Michal

Parents
  • Hi Michal,

    If you mean using BLE FOTA an nRF9151 with nRF52840, you can refer to a similar discussion here UART DFU of a nRF9160 in recovery mode via nRF5340. - Nordic Q&A - Nordic DevZone - Nordic DevZone

    Best regards,

    Charlie

  • Hi Charlie. Thank you for the reply. Please note that the mentioned case is different - there the custom UART protocol is used to communicate nrf53<->nrf91. In my case I use HCI with lp_uart variant.

    Anyway I was able to get it all to compile, but I am just getting an MCU boot compilation error:

    [22/29] Building C object CMakeFiles/app.dir/home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.c.obj
    FAILED: CMakeFiles/app.dir/home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.c.obj
    ccache /home/michal/ncs/toolchains/e9dba88316/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DMBEDTLS_CONFIG_FILE=\"/home/michal/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/include/mcuboot-mbedtls-cfg.h\" -DNCS_APPLICATION_BOOT_BANNER_GIT_REPO -DNRF9120_XXAA -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DUSE_PARTITION_MANAGER=1 -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/michal/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/include -I/home/michal/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/targets -I/home/michal/ncs/v2.7.0/bootloader/mcuboot/boot/bootutil/include -I/home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/mbedtls-asn1/include -I/home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf -I/home/michal/ncs/v2.7.0/zephyr/include -I/home/michal/repos/MG105/build/mcuboot/zephyr/include/generated -I/home/michal/ncs/v2.7.0/zephyr/soc/nordic -I/home/michal/ncs/v2.7.0/zephyr/soc/nordic/nrf91/. -I/home/michal/ncs/v2.7.0/zephyr/soc/nordic/common/. -I/home/michal/ncs/v2.7.0/nrf/include -I/home/michal/ncs/v2.7.0/nrf/tests/include -I/home/michal/ncs/v2.7.0/modules/hal/cmsis/CMSIS/Core/Include -I/home/michal/ncs/v2.7.0/zephyr/modules/cmsis/. -I/home/michal/ncs/v2.7.0/modules/hal/nordic/nrfx -I/home/michal/ncs/v2.7.0/modules/hal/nordic/nrfx/drivers/include -I/home/michal/ncs/v2.7.0/modules/hal/nordic/nrfx/mdk -I/home/michal/ncs/v2.7.0/zephyr/modules/hal_nordic/nrfx/. -I/home/michal/ncs/v2.7.0/bootloader/mcuboot/boot/bootutil/zephyr/.. -I/home/michal/ncs/v2.7.0/bootloader/mcuboot/boot/bootutil/zephyr/../include -I/home/michal/ncs/v2.7.0/bootloader/mcuboot/boot/bootutil/zephyr/../../zephyr/include -I/home/michal/ncs/v2.7.0/nrfxlib/crypto/nrf_cc310_bl/include -isystem /home/michal/ncs/v2.7.0/zephyr/lib/libc/minimal/include -isystem /home/michal/ncs/v2.7.0/zephyr/lib/libc/common/include -isystem /home/michal/ncs/toolchains/e9dba88316/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include -isystem /home/michal/ncs/toolchains/e9dba88316/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include-fixed -isystem /home/michal/ncs/v2.7.0/nrfxlib/crypto/nrf_cc310_platform/include -fno-strict-aliasing -Os -imacros /home/michal/repos/MG105/build/mcuboot/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mfp16-format=ieee --sysroot=/home/michal/ncs/toolchains/e9dba88316/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros /home/michal/ncs/v2.7.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/home/michal/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/michal/ncs/v2.7.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/michal/ncs/v2.7.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.c.obj -MF CMakeFiles/app.dir/home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.c.obj.d -o CMakeFiles/app.dir/home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.c.obj -c /home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.c
    In file included from /home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.c:18:
    /home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.h: In function 'nrf_cc310_enable':
    /home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.h:53:5: error: 'NRF_CRYPTOCELL' undeclared (first use in this function); did you mean 'NRF_CRYPTOCELL_S'?
    53 | NRF_CRYPTOCELL->ENABLE=1;
    | ^~~~~~~~~~~~~~
    | NRF_CRYPTOCELL_S
    /home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.h:53:5: note: each undeclared identifier is reported only once for each function it appears in
    /home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.h: In function 'nrf_cc310_disable':
    /home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.h:58:5: error: 'NRF_CRYPTOCELL' undeclared (first use in this function); did you mean 'NRF_CRYPTOCELL_S'?
    58 | NRF_CRYPTOCELL->ENABLE=0;
    | ^~~~~~~~~~~~~~
    | NRF_CRYPTOCELL_S
    ninja: build stopped: subcommand failed.
    FAILED: _sysbuild/sysbuild/images/bootloader/mcuboot-prefix/src/mcuboot-stamp/mcuboot-build /home/michal/repos/MG105/build/_sysbuild/sysbuild/images/bootloader/mcuboot-prefix/src/mcuboot-stamp/mcuboot-build
    cd /home/michal/repos/MG105/build/mcuboot && /home/michal/ncs/toolchains/e9dba88316/usr/local/bin/cmake --build .
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /home/michal/ncs/toolchains/e9dba88316/usr/local/bin/cmake --build /home/michal/repos/MG105/build


    I don't think I am including cc310 and MCU boot doesn't use it as far as I read, so how do I disable this?

    Best regards,

    Michal

Reply
  • Hi Charlie. Thank you for the reply. Please note that the mentioned case is different - there the custom UART protocol is used to communicate nrf53<->nrf91. In my case I use HCI with lp_uart variant.

    Anyway I was able to get it all to compile, but I am just getting an MCU boot compilation error:

    [22/29] Building C object CMakeFiles/app.dir/home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.c.obj
    FAILED: CMakeFiles/app.dir/home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.c.obj
    ccache /home/michal/ncs/toolchains/e9dba88316/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DMBEDTLS_CONFIG_FILE=\"/home/michal/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/include/mcuboot-mbedtls-cfg.h\" -DNCS_APPLICATION_BOOT_BANNER_GIT_REPO -DNRF9120_XXAA -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DUSE_PARTITION_MANAGER=1 -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/michal/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/include -I/home/michal/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/targets -I/home/michal/ncs/v2.7.0/bootloader/mcuboot/boot/bootutil/include -I/home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/mbedtls-asn1/include -I/home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf -I/home/michal/ncs/v2.7.0/zephyr/include -I/home/michal/repos/MG105/build/mcuboot/zephyr/include/generated -I/home/michal/ncs/v2.7.0/zephyr/soc/nordic -I/home/michal/ncs/v2.7.0/zephyr/soc/nordic/nrf91/. -I/home/michal/ncs/v2.7.0/zephyr/soc/nordic/common/. -I/home/michal/ncs/v2.7.0/nrf/include -I/home/michal/ncs/v2.7.0/nrf/tests/include -I/home/michal/ncs/v2.7.0/modules/hal/cmsis/CMSIS/Core/Include -I/home/michal/ncs/v2.7.0/zephyr/modules/cmsis/. -I/home/michal/ncs/v2.7.0/modules/hal/nordic/nrfx -I/home/michal/ncs/v2.7.0/modules/hal/nordic/nrfx/drivers/include -I/home/michal/ncs/v2.7.0/modules/hal/nordic/nrfx/mdk -I/home/michal/ncs/v2.7.0/zephyr/modules/hal_nordic/nrfx/. -I/home/michal/ncs/v2.7.0/bootloader/mcuboot/boot/bootutil/zephyr/.. -I/home/michal/ncs/v2.7.0/bootloader/mcuboot/boot/bootutil/zephyr/../include -I/home/michal/ncs/v2.7.0/bootloader/mcuboot/boot/bootutil/zephyr/../../zephyr/include -I/home/michal/ncs/v2.7.0/nrfxlib/crypto/nrf_cc310_bl/include -isystem /home/michal/ncs/v2.7.0/zephyr/lib/libc/minimal/include -isystem /home/michal/ncs/v2.7.0/zephyr/lib/libc/common/include -isystem /home/michal/ncs/toolchains/e9dba88316/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include -isystem /home/michal/ncs/toolchains/e9dba88316/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include-fixed -isystem /home/michal/ncs/v2.7.0/nrfxlib/crypto/nrf_cc310_platform/include -fno-strict-aliasing -Os -imacros /home/michal/repos/MG105/build/mcuboot/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mfp16-format=ieee --sysroot=/home/michal/ncs/toolchains/e9dba88316/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros /home/michal/ncs/v2.7.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/home/michal/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/michal/ncs/v2.7.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/michal/ncs/v2.7.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.c.obj -MF CMakeFiles/app.dir/home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.c.obj.d -o CMakeFiles/app.dir/home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.c.obj -c /home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.c
    In file included from /home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.c:18:
    /home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.h: In function 'nrf_cc310_enable':
    /home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.h:53:5: error: 'NRF_CRYPTOCELL' undeclared (first use in this function); did you mean 'NRF_CRYPTOCELL_S'?
    53 | NRF_CRYPTOCELL->ENABLE=1;
    | ^~~~~~~~~~~~~~
    | NRF_CRYPTOCELL_S
    /home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.h:53:5: note: each undeclared identifier is reported only once for each function it appears in
    /home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.h: In function 'nrf_cc310_disable':
    /home/michal/ncs/v2.7.0/bootloader/mcuboot/ext/nrf/cc310_glue.h:58:5: error: 'NRF_CRYPTOCELL' undeclared (first use in this function); did you mean 'NRF_CRYPTOCELL_S'?
    58 | NRF_CRYPTOCELL->ENABLE=0;
    | ^~~~~~~~~~~~~~
    | NRF_CRYPTOCELL_S
    ninja: build stopped: subcommand failed.
    FAILED: _sysbuild/sysbuild/images/bootloader/mcuboot-prefix/src/mcuboot-stamp/mcuboot-build /home/michal/repos/MG105/build/_sysbuild/sysbuild/images/bootloader/mcuboot-prefix/src/mcuboot-stamp/mcuboot-build
    cd /home/michal/repos/MG105/build/mcuboot && /home/michal/ncs/toolchains/e9dba88316/usr/local/bin/cmake --build .
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /home/michal/ncs/toolchains/e9dba88316/usr/local/bin/cmake --build /home/michal/repos/MG105/build


    I don't think I am including cc310 and MCU boot doesn't use it as far as I read, so how do I disable this?

    Best regards,

    Michal

Children
No Data
Related