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

FOTA DFU over UART

Hi guys,

I have a board with STM32 (mbed os) and NRF52832 connected using UART lines.

STM32 has a internet connection and NRF52832 has a bootloader and DFU service.

What do you think what would be best idea to make DFU for NRF52832 from STM32 using UART?

Should i use HEX or ZIP file (zip files are not supported on mbed os in this form)?

Is there something already implemented on the bootloader (i saw some post that use "nrfutil dfu usb_serial -pkg ble_hrs_combo.zip -p /dev/ttyACM0 -b 115200") so i guess there is some uart support in a way but there is a lot of code implemented in python?

Is there some C code that makes that process?

Is it possible to write to the flash from the application and then restart to bootloader the make the DFU using some kind of dual bank mode?

I use SDK14.2 and SDK15.2 and have NRF52832 and will be working on NRF52840

Any help would be appreciated.

Thanks

  • I have found bootloader_secure_serial in examples which is a DFU target software and have been able to flash DFU using nrfutil 4.0.0 (python2). Does anyone know about DFU controller software that could be used with the DFU target software?

    In the meanwhile i have sniffed the RX and TX lines and would try to make some sense of it.

  • Hi Schef, 

    You can do UART DFU from the STM32 to the nRF52832. We don't have the code to run on the STM32, but you can follow the documentation here to create your own DFU master, it's not too difficult to create a simple one. About 200 lines of code. I attached here a project I made for the SPI DFU , but the UART DFU should be pretty similar.  It's to be used with SDK v14.2

    SPI_DFU.zip

  • Thanks for the code. I will try to implement the UART part and add the SLIP encoding.

  • I was able to make it happen using your code. Thanks.