• SupportSoftware
  • Firmware update over UART for nRF52840-dk using Zephyr OS environment

I am new to zephyr OS, and would like to Update firmware for nRF52840-dk over UART. Please can you suggest any SDK/examples if its already available or if not then what steps would be required in doing so. Looking forward for your inputs.

If you’re using NCS you can add CONFIG_BOOTLOADER_MCUBOOT=y and that will add the bootloader directly to your application. Depending on how the bootloader is configured for that target it will use the main serial interface or USB. You can look at bootloader/mcuboot/boot/zephyr for more details.

As long as it’s configured properly you can use mcumgr to load it. (similar to here: https://docs.circuitdojo.com/nrf9160-programming-and-debugging.html?highlight=newtmgr#using-newtmgr)

Hope that helps!

21 days later

I am using an example code from Simple Management Protocol (SMP) server (zephyr/samples/subsys/mgmt/mcumgr/smp_svr) and since it is not by default enabled to use UART, I am adding ‘CONFIG_MCUMGR_SMP_UART=y ’ in ‘Prj.conf’ file.

So can I use the above example for updating Firmware over UART?

By default if you’re using MCUboot with the configured default bootloader you should either be able to load over USB CDC or UART. Depends on how it’s configured in your prj.conf/overlay.

Thank you! It worked for me.
How to build a signed image file?
for example I have an application which blinks LED, how do I build this application to obtain a signed image file (.bin).
Which shall be used for updating firmware over UART.
Thanks in advance!

If you’re using NCS you’ll get an app_update.bin in your build/zephyr directory.

Yes, I tried with app_update.bin file and was able to update successfully.

1) But, Is it also possible to update an unsigned image files while using MCUboot?
2) If not how do I build a signed image file, (example I have an application of LED blinking, so I wand to build this application with a key)

    Loke

    1) But, Is it also possible to update an unsigned image files while using MCUboot?

    It may be possible but not without modification to MCUBoot.

    2) If not how do I build a signed image file, (example I have an application of LED blinking, so I wand to build this application with a key)

    By default when you have CONFIG_BOOTLOADER_MCUBOOT=y then you’ll be building and signing your application. You have to do this manually if using ‘Vanilla’ Zephyr

    Thank you @jaredwolff
    Any suggestions to implement the process where the “device enters bootloader mode by sending a command over UART
    What approach would be better?

    8 days later

    Resetting the device and then toggling a GPIO to put it in to DFU is the easiest IMHO. You’ll need two GPIOs for this along with the UART signals.

    @jaredwolff
    Please can you provide an example for “SMP Client” (to transfer over UART) or suggestions on how to implement this?
    I am planning to run SMP Client in my laptop itself.

    Any information on this is much appreciated.
    Thanks!

    6 days later
    Terms and Conditions | Privacy Policy