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 Dejan,

    You seem to think I am familiar with the details of your build system. I am not.  The build system works for the dk; why would it not work for the dongle?  If the bootloader is not supported on the dongle, then you should update your documentation, which clearly states that it is supported.  If it is supported as is described in your documentation then there is clearly a bug in the build system.   I don't understand why you can't see that.

    Your build system is the most complex build system I have ever seen; I even went to the Zephyr website and read their documentation; it does not match your build system; do you have detailed build system documentation that explains how the nRF_CONNECT_EXTENSION/nRF_CONNECT_SDK and the West BUILD system interact and how I might go about trouble shooting this problem?  Lacking instruction on how the build system works, there is very little I can do 

    From my point of view, I should be able to configure my application as per your documentation and click on "Build";  at least, that is what your documentation states, 

    I have already spent too much time on this problem and I, unlike you, don't get paid for working on the build system.

    Let me ask you this, do you consider this problem a bug in the build system  or do you consider this problem something that I should be able to handle and, if need be, dive into the internals of West, Cmake, ninja, partition_manager, nRF_CONNECT_EXTENSION, nRF_CONNECT_SDK and any number of build tools tools, with which, I am not currently aware?

    I look forward to your response.

    Regards,

    Jerry

  • Hi Jerry,

    You could start by reading introduction part of NCS documentation, getting started guide and beyond getting started. We have extensive documentation which describes build and configuration system and updating repositories and tools. Specifically related to the dongle, there are guides about programming nrf52840 dongle and progamming and debugging nrf52840 dongle. We have many samples which can help you in your development and for each sample you can see the requirements.
    nrf52840 dongle does not have debug support and it is mostly used for testing. I would recommend nrf52840-dk as a development platform which you could also later use for flashing the dongle when needed.

    Best regards,
    Dejan

  • Dejan, 

    I think you and I have a communication problem.  Your comments above are correct and your points are all well known to me.  I never intended to use the dongle as a code debugging platform.  Rather, my notion was to deploy, say 10 or more, to test my software, its interconnectivity , responses and the like.  Now as to your recommendation that I use s nRF52840-DK for debugging my code, I couldn't agree with you more and is the reason I use the dk for debugging and have been doing so all along.

    So to clarify things for you, debugging has nothing to do with a bootloader; I'm at a loss as to how you got that idea.

    All I want to do is include a bootloader with my application that runs on the donglle.

    Previously, you responded as follows:

    "

    I have tested myself when nRF Secure Immutable Bootloader (NSIB) as immutable bootloader is set to be used, with following configuration option

    Fullscreen
    1
    CONFIG_SECURE_BOOT=y



    and when adding mcuboot as upgradable bootloader is chosen with configuration options given below.

    Fullscreen
    1
    2
    CONFIG_SECURE_BOOT=y
    CONFIG_BOOTLOADER_MCUBOOT=y



    I could not reproduce your issue and did not see build error.

    You could try building your application from both VS Code and command line using "west build". In addition, you could try using NCS v2.4.0 instead of v2.3.0. Lastly, check if your build environment is working correctly.

    Best regards,"

    This proves beyond all cavil, that this configuration is the correct one, at least for the nRF52840-dk.  It is my understanding that you subsequently attempted the build  for a dongle and that the build failed, similar to my experience.

    So to recap where we are: 

    1) When i include a bootloader for the dongle, the build fails.

    2) When I include a bootloader for the dk the build works.

    3) From the above, I believe  that you too can include a bootloader for the dk and that build works.

    4) From the above I believe that when you include a bootloader, you too, experience a build fail.

    If this is not a fair description of our status quo, please clarify it for me..  On the other hand, If this is a fair description of our status quo, what am I to expect from you concerning this problem?  Is there anything I can provide that might make your task easier?  I can zip up my project files for you if you think it might help?

    Regards,

    Jerry

  • Hi Jerry,

    Configuration option CONFIG_SECURE_BOOT is used for nRF Secure Immutable Bootloader (NSIB). Building with this option for nrf52840 dongle was not successful for me. Since you want to build the hello_world application with bootloader, you could alternatively build it with MCUboot as immutable bootloader by adding this configuration line
    in prj.conf:

    CONFIG_BOOTLOADER_MCUBOOT=y


    and in child_image\mcuboot.conf:
    CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x7B800


    Best regards,
    Dejan

  • Ok, we seem to be going around in circles here.  We are just wasting each others time, so I'm done with this. There is no need to reply further.

    Regards,

    Jerry

Related