mcuboot secure boot hello world example

I followed this tutorial, the second example with hello world, added CONFIG_SECURE_BOOT and  CONFIG_SB_SIGNING_KEY_FILE="/path/to/ec-secp256k1-priv-key.pem" in prj.conf file according to this guide.

Now, when I flash the nrf52840dk board with this build, I get a timeout with the command: mcumgr --conntype serial --connstring "/dev/ttyACM0,baud=115200" echo hello. Also the board is not printing anyting in the RTT window.

When I leave out the above parameters (CONFIG_SECURE_BOOT and  CONFIG_SB_SIGNING_KEY_FILE), mcumgr just works fine, AND i get the hello world printing compile time as expected. The file flashed to the board is ../hello_world_dfu/build_dk/zephyr/merged.hex

How do I get this to work?

Parents
  • Hi Boris,

    I followed the same steps and was able to get the setup to work just fine. I also tested upgrading the application, enter test boot, reset. Everything worked as expected.

    Given that you stated the MCUboot only setup worked, I think you have the ports figure out right. However, can you just double check to be sure that the port is correct, and is not connected with any other programs while you perform the mcumgr test?

    Hieu

  • Got it to work.

    I misread, the above config_secure_boot is used for the nrf-bootloader, and not mcuboot.

    In my project directory, I had to make a directory child_image, add the file mcuboot.conf with the following content:

    CONFIG_BOOT_SIGNATURE_KEY_FILE="/home/bergm006/nrf-projects/hello_world/boris-key4.pem"
    CONFIG_DISABLE_FLASH_PATCH=y
    CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y

    Now I can upload using mcumgr. Confirming an image only works entering it's hash like with test, only this is not in the manual. And after a reset, the first mcumgr command is always ignored.

    For some reason, it only works when increasing the version number, although I haven't configured anything to do so.

    CONFIG_MCUBOOT_IMAGE_VERSION="0.1.2+3"

    Regards

Reply
  • Got it to work.

    I misread, the above config_secure_boot is used for the nrf-bootloader, and not mcuboot.

    In my project directory, I had to make a directory child_image, add the file mcuboot.conf with the following content:

    CONFIG_BOOT_SIGNATURE_KEY_FILE="/home/bergm006/nrf-projects/hello_world/boris-key4.pem"
    CONFIG_DISABLE_FLASH_PATCH=y
    CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y

    Now I can upload using mcumgr. Confirming an image only works entering it's hash like with test, only this is not in the manual. And after a reset, the first mcumgr command is always ignored.

    For some reason, it only works when increasing the version number, although I haven't configured anything to do so.

    CONFIG_MCUBOOT_IMAGE_VERSION="0.1.2+3"

    Regards

Children
Related