Including a bootloader with an application

I want to include a dfu bootloader with an application.  I read here: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/bootloaders_and_dfu/bootloader_adding.htmlthat I should include "CONFIG_SECURE_BOOT=y" in the prj.conf file. However when I do I get this most enigmatic error message: "FATAL ERROR: command exited with status 1: 'c:\ncs\toolchains\v2.3.0\opt\bin\cmake.EXE' --build 'c:\Nordic\MyApps\blinky\build'" at build time.

If I remove the "CONFIG_SECURE_BOOT=y" from the prj.conf file, the application builds normally,

Regards,

Jerry

  • Hi Jerry,

    I am sorry for a delayed reply. It is vacation time and we have reduced staffing. Delays in replying should be expected. Thank you for your patience and understanding.

    I have done further testing. Since adding CONFIG_SECURE_BOOT was not working for me, I have had an internal discussion with our developers.

    When using CONFIG_SECURE_BOOT=y in prj.conf, you might get some errors with cdc_acm. For this, the suggestion is to disable USB CDC for b0. However, USB CDC is enabled on the dongle by default. Therefore, you would need to disable USB CDC with CONFIG_BOARD_SERIAL_BACKEND_CDC_ACM=n. The way how this is supposed to be done can be found in our nRF_Desktop application. Please have a look at the configuration files located in
    v2.4.0\nrf\applications\nrf_desktop\configuration\nrf52840dongle_nrf52840 and
    v2.4.0\nrf\applications\nrf_desktop\configuration\nrf52840dongle_nrf52840\child_image\b0
    You could try changing your prj.conf and b0.conf (or prj.conf in child_image\b0) files by looking at above-mentioned files from nRF Desktop application. Alternatively, b0 configuration file could also be specified with configuration option  -Db0_CONF_FILE=b0.conf.

    Best regards,
    Dejan

  • Unfortunately I am facing the same issue. I tried to include the b0.conf but no luck with that either. Once I enable CONFIG_SECURE_BOOT I am seeing this error. I modified the partition manager to dump the pool-variable right before it throws that StopIteration error, and at that point it looks like this:

    ['start', 'mcuboot', 'mcuboot_pad', 'app', 'nvs_storage', 'end', 'b0_container', 'app_image', 's0_image', 's0', 's1', 'mcuboot_primary_app', 'mcuboot_primary']

    To me it looks like it is trying to resolve some circular dependency there somehow, but I am not familiar with how it's supposed to work so I don't know if that's really the case. Maybe the developer/maintainer of that script can have a look and tell me what other variables I should dump to have a look at why it ends up in this state?

  • Hi  ,

    Could you provide more information about your application?

    Which NCS version do you use?

    Best regards,
    Dejan

  • What I need is the ability to update the firmware/application from the running application. That appears to require using mcuboot. When I only enable mcuboot it compiles. Additionally I want secureboot so I figured the best way would be to make mcuboot upgradable aswell so I enabled the first stage bootloader aswell.

    Another requirement is a config partition/nvs partition to store some data.

    I am using NCS 2.5.0. I think on the previous version I was at least able to compile it, but I've experienced other issues there.

  • Hi  ,

    For updating from application, you could look at SMP server sample, and unofficial central_smp_client_dfu or  smp_client_ble. You could also have a look at unofficial sample updatable bootloader. In addition, there is DevZone guide on how to add DFU support to your application.

    Best regards,
    Dejan

Related