This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf9160: DFU of user application over serial

Hi

I am looking for a ways to perform DFU over serial, surprisingly i dont find any ways except this thread with no answers

https://devzone.nordicsemi.com/f/nordic-q-a/48154/9160---from-bootloader-updating-flashing-new-application-and-modem-firmware---how

This requirement is very critical for product where my device should be capable of performing firmware upgrade over serial.

Team NORDIC can you please elevate this case?

regards

KK

Parents
  • Hi again, Martin informed me you would like some more information on how to perform DFU over serial on the nRF9160 DK. 

    I just tried this and here's what I did. 

    Make a file called "nrf9160_pca10090.conf" and place it in /path_to-ncs/bootloader/mcuboot/boot/zephyr/boards/, and add the following lines to the file. 

    # Disable Zephyr console
    CONFIG_CONSOLE=n
    CONFIG_CONSOLE_HANDLER=n
    CONFIG_UART_CONSOLE=n
    
    # MCUBoot settings
    CONFIG_BOOT_MAX_IMG_SECTORS=256
    
    # MCUboot serial recovery
    CONFIG_MCUBOOT_SERIAL=y
    CONFIG_BOOT_SERIAL_DETECT_PORT="GPIO_0"
    CONFIG_BOOT_SERIAL_DETECT_PIN=6
    CONFIG_BOOT_SERIAL_DETECT_PIN_VAL=0
    

    Then to load the bootloader configurations to the nRF9160 flash any application with the following config enabled to the chip. 

    CONFIG_BOOTLOADER_MCUBOOT=y

    Now, to put the device in serial recovery mode push button 1 on the device, while turning it on. 

    It is the config BOOT_SERIAL_DETECT_PIN that determines which pin puts it in serial recovery mode and the default is pin 6 which corresponds to button 1 on the DK. This can be changed by changing the configurations in the "nrf9160_pca10090.conf" file.

    For prerequisites, make sure you have the following installed on your computer:

    1. Download, install and make sure Go Language (1.7 or later) is in your system path.
    2. Install mcumgr command-line tool by issuing the following go get command:
      go get github.com/apache/mynewt-mcumgr-cli/mcumgr

    Now to flash the application to the device, just follow the steps under Updating FW in this tutorial,

     

    For reference, here is what I ran: 

    mcumgr --conntype=serial --connstring=COM23 image upload nrf9160_asset_tracker_dfu.bin
    mcumgr --conntype=serial --connstring=COM23 reset

    One thing to note is that when you connect the nRF9160 DK, three COM ports will show up. Make sure to use the COM port that is connected to the nRF9160 DK. To find out which one that is, just open a terminal emulator and see which COM port spits out debug info for the application running on the nRF9160. 

    For what images to use: you can either download precompiled binaries here and use the files in images_dfu_bin. Or compile your own application (making sure CONFIG_BOOTLOADER_MCUBOOT=y is set) and find the file to use in /build_folder/zephyr/app_update.bin.

    Let me know if you have any further questions! 

    Best regards,

    Heidi

  • I tried to put "nrf9160dk_nrf9160.conf" in /path_to-ncs/bootloader/mcuboot/boot/zephyr/boards/ then DFU over UART works.

Reply Children
No Data
Related