Questions of DFU over BLE example

Dear all

I following the example here , over the air one, and get it basically working, thanks for the tutorial.

Now I have a few questions:

1. It looks like it always keep 2 images at Slot 0 and slot 1, one active at a time, after I Uploaded successfully, It running with new updated image, however when I go to BASIC menu on the the Device Manger Mobile app, and hit SEND RESET COMMAND , it back to previous image, I wonder why and is there a reliable way  to choose which slot it runs?

2.  I am thinking of use it for production, and I got a warning message like below:

CMake Warning at D:\WORK\ncs\v1.9.1\nrf\modules\mcuboot\CMakeLists.txt:262 (message):

---------------------------------------------------------
--- WARNING: Using default MCUBoot key, it should not ---
--- be used for production. ---
---------------------------------------------------------

I wonder what more procedures are needed to make it suitable for production use. 

3. Also the option for CONFIG_MCUMGR_SMP_BT_AUTHEN, if I choose y for it, what is the rest of procedure ? do I still choose app_update.bin for upgrade?

Regard

Thank you!

Ping

Parents
  • Hello,

    1. The bootloader will only boot images from slot 0 unless you enable direct-xip (not enabled by default). Also, after DFU, you need to confirm the image in slot 0. Otherwise, the bootloader will end up restoring the old image from slot 1 on next boot. 

    Have you tried to select "Confirm Only" when initiating DFU from the basic menu? This should make the phone confirm the image right after the DFU is finished, rather than waiting for the new app to boot up and confirm it then.

    2. For production builds, you should always use your own secret private key to sign the image. First step is to create a key pair, which you can do by following the instructions here: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/readme-zephyr.html#generating-a-new-keypair.  The final step is to pass this private key to the build.

    Steps to change the private key used by MCUboot (see the Image-specific variables section of the SDK documentation for details on how this works)

    a. In your project directory, create a folder named "child_image" with a sub-directory named mcuboot

    b. In 'mcuboot', create a file named "prj.conf" which will override the default mcuboot configuration. This file should include CONFIG_BOOT_SIGNATURE_KEY_FILE="keys/<filename>.pem" along with the other default mcuboot configurations. You may use the child_image.zip folder attached below as a reference.

    c. adjacent to the the prj.conf file, make a new "key" folder where you will keep your key.

    d. Now the folder structure should look like this:

    ├── child_image
    │   └── mcuboot
    │       ├── keys
    │       │   └── mcuboot_private.pem
    │       └── prj.conf

    3. CONFIG_MCUMGR_SMP_BT_AUTHEN means the phone must be paired with MITM protection before it can initiate DFU (i.e. pairing with passkey, nummeric comparison, or OOB with NFC). It does not affect the DFU process itself. You can still use the same update images as when the authentication requirement is disabled.

    Attachment

    2134.child_image.zip

    Best regards,

    Vidar

Reply
  • Hello,

    1. The bootloader will only boot images from slot 0 unless you enable direct-xip (not enabled by default). Also, after DFU, you need to confirm the image in slot 0. Otherwise, the bootloader will end up restoring the old image from slot 1 on next boot. 

    Have you tried to select "Confirm Only" when initiating DFU from the basic menu? This should make the phone confirm the image right after the DFU is finished, rather than waiting for the new app to boot up and confirm it then.

    2. For production builds, you should always use your own secret private key to sign the image. First step is to create a key pair, which you can do by following the instructions here: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/readme-zephyr.html#generating-a-new-keypair.  The final step is to pass this private key to the build.

    Steps to change the private key used by MCUboot (see the Image-specific variables section of the SDK documentation for details on how this works)

    a. In your project directory, create a folder named "child_image" with a sub-directory named mcuboot

    b. In 'mcuboot', create a file named "prj.conf" which will override the default mcuboot configuration. This file should include CONFIG_BOOT_SIGNATURE_KEY_FILE="keys/<filename>.pem" along with the other default mcuboot configurations. You may use the child_image.zip folder attached below as a reference.

    c. adjacent to the the prj.conf file, make a new "key" folder where you will keep your key.

    d. Now the folder structure should look like this:

    ├── child_image
    │   └── mcuboot
    │       ├── keys
    │       │   └── mcuboot_private.pem
    │       └── prj.conf

    3. CONFIG_MCUMGR_SMP_BT_AUTHEN means the phone must be paired with MITM protection before it can initiate DFU (i.e. pairing with passkey, nummeric comparison, or OOB with NFC). It does not affect the DFU process itself. You can still use the same update images as when the authentication requirement is disabled.

    Attachment

    2134.child_image.zip

    Best regards,

    Vidar

Children
No Data
Related