aws transport for dfu

I currently have a board using  a nrf52840 that has a reliable connection to AWS via a Quectel BG95.

I have DFU implemented and working via Bluetooth with config settings 

CONFIG_BOOTLOADER_MCUBOOT=y

CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y

CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP
I'd like to replace the Bluetooth transport with my AWS connection.
I'm  using SDK v2.6.0.
Could you please point me to a starting place to research this?
Parents
  • Hi,

    I'm not certain how the module you refer to work, but here's a couple of resources that might get you started anyways: 

    https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/net/aws_iot/README.html#aws-iot with focus on the fota section.

    If this does not help, then in short terms: If you have set up your device with MCUboot, a primary application slot and a secondary application slot, you should be able to 

    1. Enter bootloader mode
    2. Receive the update image over AWS through the Quectel and write the image to the secondary application slot (on either external flash with communication to the nRF52840 for instance).
    3. When the image is received, MCUboot tests and verifies the image and confirms it for swap at first reset of the device

    Let me know if this is enough to get you started

    Kind regards,
    Andreas

  • I've made some progress.

    The firmware I want to install is app_update.bin (stored in build/zephyr after a successful build)

    I have built and fully tested firmware and associated server software that will reliably download the app_update.bin from the AWS cloud to my board

    It looks like the DFU Target library is perfect for what I want to do - which is

    1. initialize the target (dfu_target_init())

    2. Download my fiemware - using dfu_target_write() to move each block of downloaded data into the mcu_boot_secondary partition.

    3. finalize the download with dfu_target_done.

    4. Stage the update with dfu_target_schefule_update().

    5. Reboot

    I've modified my build to use static partitions (I copied build/partitions.yml to pm_static.yml)

    Currenty my prj.conf has 

    CONFIG_BOOT_SIGNATURE_KEY_FILE="C:\\Users\\kover\\HomeSmart\\VScod\\RSAKEYS\\privatekey.pem"
    CONFIG_FLASH=y
    CONFIG_IMG_MANAGER=y
    CONFIG_STREAM_FLASH=y
    CONFIG_STREAM_FLASH_ERASE=y
    CONFIG_FLASH_MAP=y
    CONFIG_IMG_ERASE_PROGRESSIVELY=y
    CONFIG_DFU_TARGET=y
    CONFIG_DFU_TARGET_MCUBOOT=y
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_MCUBOOT_IMG_MANAGER=y
    I currently have two issues.
    1. I want to properly sign the firmware/mcu boot with a private key using  CONFIG_BOOT_SIGNATURE_KEY_FILE
    When I do a pristine build i get
    CONFIG_BOOT_SIGNATURE_KEY_FILE couldn't be set. Missing dependencies:
    !MCUBOOT_BUILD_STRATEGY_FROM_SOURCE
    In the Build Problems.
    Note thaat I've tried adding 
    CONFIG_MCUBOOT_BUILD_STRATEGY_FROM_SOURCE=n
    to prj.conf, but I get the same warning.
    2. When my application tries to init the DFU target with
     i=dfu_target_init(DFU_TARGET_IMAGE_TYPE_ANY_APPLICATION,0,filesize,&target_cb);
    -19 (-NO SUCH DEVICE) is returned.
    Any help you can give me woud be greatly appreciatted.
Reply
  • I've made some progress.

    The firmware I want to install is app_update.bin (stored in build/zephyr after a successful build)

    I have built and fully tested firmware and associated server software that will reliably download the app_update.bin from the AWS cloud to my board

    It looks like the DFU Target library is perfect for what I want to do - which is

    1. initialize the target (dfu_target_init())

    2. Download my fiemware - using dfu_target_write() to move each block of downloaded data into the mcu_boot_secondary partition.

    3. finalize the download with dfu_target_done.

    4. Stage the update with dfu_target_schefule_update().

    5. Reboot

    I've modified my build to use static partitions (I copied build/partitions.yml to pm_static.yml)

    Currenty my prj.conf has 

    CONFIG_BOOT_SIGNATURE_KEY_FILE="C:\\Users\\kover\\HomeSmart\\VScod\\RSAKEYS\\privatekey.pem"
    CONFIG_FLASH=y
    CONFIG_IMG_MANAGER=y
    CONFIG_STREAM_FLASH=y
    CONFIG_STREAM_FLASH_ERASE=y
    CONFIG_FLASH_MAP=y
    CONFIG_IMG_ERASE_PROGRESSIVELY=y
    CONFIG_DFU_TARGET=y
    CONFIG_DFU_TARGET_MCUBOOT=y
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_MCUBOOT_IMG_MANAGER=y
    I currently have two issues.
    1. I want to properly sign the firmware/mcu boot with a private key using  CONFIG_BOOT_SIGNATURE_KEY_FILE
    When I do a pristine build i get
    CONFIG_BOOT_SIGNATURE_KEY_FILE couldn't be set. Missing dependencies:
    !MCUBOOT_BUILD_STRATEGY_FROM_SOURCE
    In the Build Problems.
    Note thaat I've tried adding 
    CONFIG_MCUBOOT_BUILD_STRATEGY_FROM_SOURCE=n
    to prj.conf, but I get the same warning.
    2. When my application tries to init the DFU target with
     i=dfu_target_init(DFU_TARGET_IMAGE_TYPE_ANY_APPLICATION,0,filesize,&target_cb);
    -19 (-NO SUCH DEVICE) is returned.
    Any help you can give me woud be greatly appreciatted.
Children
No Data
Related