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

Serial DFU with nRF9160 as DFU controller

I'm downloading a firmware image from AWS via cell onto the nRF9160. I want to perform a serial DFU over UART. The DFU target is the nRF52840. Are there any existing samples outlining this process?

Parents Reply Children
  • The strange thing is I get no error message. No I don't have a trace, but whenever I print the error messages from dfu_target_mcuboot library functions, I get 0s. Yes I'm calling boot_write_img_confirmed(). EDIT: Ok double checked and I am not getting any errors from dfu_target_mcuboot functions but I am getting -5 as an error from boot_write_img_confirmed() on reboot. EDIT 2: printed the value returned by boot_set_confirmed() and it is -4 which stands for BOOT_MAGIC_BAD

  • Hi,

     

    esisk said:
    I am not getting any errors from dfu_target_mcuboot functions but I am getting -5 as an error from boot_write_img_confirmed() on reboot

    This is on the nRF52840 side, right? Does this mean that it boots the image successfully, but is not able to verify itself, meaning that it will revert back after a reset?

     

    Could you please share the uart log?

     

    Kind regards,

    Håkon 

  • Yes, I'm actually using a nRF52820 but shouldn't make a significant difference. Anyway, I assume it means that it boots the image successfully and reverts but not entirely certain. Currently, I cannot enable UART logging for MCUBoot because it interferes with the UART communication between the 9160 and 820 during the DFU process which is strange. I assume it has something to do with the UART queue having data still in it from the MCUBoot log, not sure on this though. Maybe if I flushed the queue I could see the log and communicate between the two chips successfuly, but I can't find anything in the docs about flushing the queue using NCS EDIT: I actually don't think that it's trying to boot the new image at all. I set CONFIG_UART_CONSOLE=n on the current image, then changed that to y, reloaded the project in SES and rebuilt, and put the new app_update.bin on AWS. So if MCUBoot was actually trying to boot the new image it would show the MCUBoot header right? But it does not on boot and I actually just get a 0 error from boot_write_img_confirm() which is very confusing.

  • Is there maybe an issue with pm_static.yml not lining up with the flash partitions I defined in our board file? The partitions.yml file generated in the build directory (which is what I made pm_static) does not really make sense to me

  • Also, not sure if this makes a difference, but I'm using an overlay config for MCUBoot. Would that affect functionality somehow?

Related