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

  • one more please, 4 . after choose SELECT FILE, and hit UPLOAD button, some time it pops up with a Select Image interface with options - Application Core(0), Network core(1), Image(2) and Image (3).

    What does it mean and what option shall i choose if I just wan to upload the new image?

    Thanks 

    Ping

  • 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

  • These options are relevant when working on the 53 series which as multiple upgradable images. On the nRF52 series you only have one, so you can select the "application core" option.

  • Hello, Vidar

    Thanks for reply.

    1. I tried and it works with confirm only. Also read a bit more on image uploading procedure and know a bit more now.

    2. I am stuck in generating new key pair, it seems like I need to install the image tool first according to the link , I opened cmd window and tried following and got a error message below. Sorry, I am not familiar with python, and need more help here to install the tool. I am a windows user.

    Could you help further please?

    Ping

  • Hello Ping,

    The imgtool is included in the SDK toolchain. Try to open the terminal from the Toolchain manager app, then run 'imgtool' from the terminal to verify that it is installed.

Related