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

Entering DFU mode via SPI and updating firmware

Hi,

My application needs to enter DFU mode based on a command from another device connected via SPI.

I see that I could use the following two statements once the application receives the SPI command. This resets the device but the device doesn't enter in DFU mode.

            NRF_POWER->GPREGRET = 0xB1;

            NVIC_SystemReset();

I also learned that I need to modify the bootloader code to enter the DFU mode. Which file do I need to update? Is it  \ncs\v1.4.0\bootloader\mcuboot\boot\zephyr\main.c?

On updating the application/MCUboot via SPI interface, 

1. Do I need to enable the SPI in my application prj.conf file to use the SPI functions to read data from the SPI bus?

2. Is it correct that I need to use nrf_target_   functions to initialize and write new application/MCUboot to the flash area?

Thanks,

Ram

Parents
  • Hi 

    Few more details on entering the DFU mode.

    My west build is not entering the DFU mode, but the SES build enters the bootloader. I put the above code in the application main() to be called every 20 seconds, and the device prints the DFU messages every 20 seconds. 

    I don't know why the difference between the two builds. 

    Any suggestion is well appreciated!

    Thanks,

    Ram

Reply
  • Hi 

    Few more details on entering the DFU mode.

    My west build is not entering the DFU mode, but the SES build enters the bootloader. I put the above code in the application main() to be called every 20 seconds, and the device prints the DFU messages every 20 seconds. 

    I don't know why the difference between the two builds. 

    Any suggestion is well appreciated!

    Thanks,

    Ram

Children
No Data
Related