nRF52840 mcuboot application configuration issues.

Hello!

I am having issues configuring a signed application, is there any way to build a signed application for the mcuboot bootloader without building the mcuboot alongside the application? 

Building an application takes ages and the build process includes building a version of mcuboot, is there a way to build the application without the bootloader and sign it, or would I have to build the application and use a separate signing process? Or is building the bootloader a mandatory part of building a signed/bootloadable application?

These are the options I have tried to build the application with, I have tried all of them separately and together:

CONFIG_BOOTLOADER_MCUBOOT=y

CONFIG_MCUBOOT_BUILD_STRATEGY_SKIP_BUILD=y

CONFIG_MCUBOOT_BUILD_STRATEGY_FROM_SOURCE=n

CONFIG_BOOT_SIGNATURE_KEY_FILE="C:\root-rsa-2048.pem"

CONFIG_SIGN_IMAGES=y

CONFIG_MCUBOOT_GENERATE_CONFIRMED_IMAGE=y

CONFIG_BUILD_OUTPUT_HEX=y

Building an app with these options results in a "app_signed.hex" file which is expected, however it also builds a combined hex file with both bootloader and app.

Parents
  • Hello,

    I am looking into it. What NCS version are you using btw?

    Regards,

    Elfving

  • Hello again, hope you've had a good week-end!

    Building an application takes ages and the build process includes building a version of mcuboot, is there a way to build the application without the bootloader and sign it, or would I have to build the application and use a separate signing process? Or is building the bootloader a mandatory part of building a signed/bootloadable application?

    Is the main issue that it takes too long to build everything? In that case have you also considered making an antivirus exception for the folder you are building in. I hear that the antivirus is typically checking every file that is being created there, which means that you can get huge reductions in buildtime if you make an exception for it there.

    Though when it comes to how to build without the bootloader alongside the application, you can do this, though I do not think there is a config for it.

    If you try building a sample with CONFIG_BOOTLOADER_MCUBOOT along with a lot of logging (ie. west -vvv build -p -b nrf52840dk_nrf52840) you'll find the last steps in the build procedure, related to signing etc. You can have a look at the steps and commands being run, and do that manually instead.

    Regards,

    Elfving

Reply
  • Hello again, hope you've had a good week-end!

    Building an application takes ages and the build process includes building a version of mcuboot, is there a way to build the application without the bootloader and sign it, or would I have to build the application and use a separate signing process? Or is building the bootloader a mandatory part of building a signed/bootloadable application?

    Is the main issue that it takes too long to build everything? In that case have you also considered making an antivirus exception for the folder you are building in. I hear that the antivirus is typically checking every file that is being created there, which means that you can get huge reductions in buildtime if you make an exception for it there.

    Though when it comes to how to build without the bootloader alongside the application, you can do this, though I do not think there is a config for it.

    If you try building a sample with CONFIG_BOOTLOADER_MCUBOOT along with a lot of logging (ie. west -vvv build -p -b nrf52840dk_nrf52840) you'll find the last steps in the build procedure, related to signing etc. You can have a look at the steps and commands being run, and do that manually instead.

    Regards,

    Elfving

Children
  • Hi.

    I'm building a custom board that would have to be programmable by other people who are not as comfortable with nRF, the whole process would have to be "plug and play".

    The issue is that when building programs for the device as it is currently, you have to modify the prj.conf file of mcuboot in "C:\ncs\v2.6.1\bootloader\mcuboot\boot\zephyr" to match the prj.conf file of the current project because mcuboot gets built with the application.

    I need the build process to be as simple as possible so I would like to skip building the mcuboot entirely so you wouldn't have to modify anything except the current project file.

    Alternatively, the option to specify the mcuboot folder location could be enough as I could have a ready-made mcuboot configuration to use with the project. However, it seems the build process automatically looks for mcuboot in the ncs directory.

    BR

    Lassdi

  • Hello again,

    I see. Maybe the most functional would then be to make a script that modifies mcuboots conf file somewhat automatically? Though maybe the easiest would be to change the path to MCUBoot here.

    Regards,

    Elfving

Related