Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DFU via UART using a custom desktop application

Hi. I would like to know how to do a DFU over UART using a custom desktop application (without using nrfutil command nor nRF Connect app). What would be the UART protocol for sending a new image via UART and what would I have to do to tell the NRF to enter in DFU mode (without using an external button)?
Also, I was wondering if it would be possible to do a DFU from an external flash memory that will communicate via SPI with the nRF (with the desktop application, I would send the image via UART to the nRF, the nRF would put the image in the external memory and then it would enter in DFU mode to update its firmware from the external memory).

I'm using the DK nRF52840, SDK v.17.0.2. Any help would be appreciated!

Parents
  • You can enable NRF_BL_DFU_ENTER_METHOD_GPREGRET in the sdk_config.h, and write the special value in the retention register GPREGRET register a flag (BOOTLOADER_DFU_START = 0xB1)  in the application and then do a soft reset (NVIC_SystemReset) to switch. 

    So, If I understand well, when I want the nRF to go into DFU mode, I have to set the GPREGRET register in the nRF application (NRF_POWER->GPREGRET = 0x01) and then call the function NVIC_SystemReset?

Reply
  • You can enable NRF_BL_DFU_ENTER_METHOD_GPREGRET in the sdk_config.h, and write the special value in the retention register GPREGRET register a flag (BOOTLOADER_DFU_START = 0xB1)  in the application and then do a soft reset (NVIC_SystemReset) to switch. 

    So, If I understand well, when I want the nRF to go into DFU mode, I have to set the GPREGRET register in the nRF application (NRF_POWER->GPREGRET = 0x01) and then call the function NVIC_SystemReset?

Children
Related