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

Update NRF52 Firmware (DFU) via External MCU STM32

Hi all,

I am new to NRF world & I have gone through Nordic's Tutorials about

  • Getting Started
  • custom Services / Characteristics
  • Bootloader, Softdevices
  • DFU via OTA / UART (PC)
  • creating/signing DFU packet etc..

So now in my case, main (Host) CPU is the STM32 and main Programme runs on this. nRF52832 is on the same PCB as BT connectivity provider. 
I want to update the firmware of the nRF not via Standard ways like OTA but via STM32. (reason: due to complete system update in one go).

So my Que.:

  1. nRF side: How this can be done on the  (while prev. firmare + softdevice is already running) via UART / SPI Bootloader?
    (Info: I know that to go again to Bootloader mode we need to impl. Buttonless DFU via PINRESET or GPREGRET register set)
  2. Which is the best interface to connect both ? SPI or UART?

  3. STM32 side: What type of implementation / Bootloader is required (with STM32 Host App Binary) so that DFU packet can be catched abd then can be send to nRF?

complete step by step explaination to acheive this will be a really helpfull for me.
(Info: I have already seen the posts of updating the STM32 via nRF but in my case its reverse.)

Dev-Setup:

  • nRF52832 Evalboard (PCA10040)
  • Nordic Tools (pc-nrfconnect, nrfutils, nrfconnect-App, etc...)
  • STM32F10xxx
Parents
  • Implementing the NRF DFU Host part in C language is a non-trivial but not too difficult task. BTDT (no, not open source). Waaay too much for a simple forum post, though.

    But that would need either a stupid amount of internal flash on the STM32 (think MB range) or some external memory to put the NRF firmware to.

    The other way would have the STM32 just "tunnel" the NRF DFU packets to the PC host somehow, and let the PC deal with the protocol.

    I recommend using UART, since I don't think there is an SPI implementation for NRF DFU protocol in the SDK.

    The STM32F10xxx are just 72 MHz Cortex-M3 MCUs. Sure that you need that at all? There is a 64MHz Cortex-M4F in the NRF52832. Maybe it would be enough to upgrade to the NRF52840 (unless you need a crapton of I/Os for example).

Reply
  • Implementing the NRF DFU Host part in C language is a non-trivial but not too difficult task. BTDT (no, not open source). Waaay too much for a simple forum post, though.

    But that would need either a stupid amount of internal flash on the STM32 (think MB range) or some external memory to put the NRF firmware to.

    The other way would have the STM32 just "tunnel" the NRF DFU packets to the PC host somehow, and let the PC deal with the protocol.

    I recommend using UART, since I don't think there is an SPI implementation for NRF DFU protocol in the SDK.

    The STM32F10xxx are just 72 MHz Cortex-M3 MCUs. Sure that you need that at all? There is a 64MHz Cortex-M4F in the NRF52832. Maybe it would be enough to upgrade to the NRF52840 (unless you need a crapton of I/Os for example).

Children
  • Hi ,

    First thank you very much for the reply.

    As you said NRF52 is powerful Cortex M4 but it's not possible to change completely to it that is fixed and that's d sad part.

    As you understood it right STM32 must act as Tunnel / DFU-controller to send Firmware to NRF, but not via PC or nrfutil.

    Now for info STM32 has Bootloader and updates itself via CAN communication from a Tool.
    In our case STM32 can also get Firmware for NRF via CAN and it should act as Tunnel and do DFU via UART. 

    SO Que. arises that do we still require external Flash to store the firmware first OR can we directly tunnel the data via UART without saving it on flash?

Related