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

Reset into USB bootloader

This is for the SDK nRF5_SDK_15.2.0_9412b96 and custom hardware.

I have a bootloader based off the example secure_bootloader_usb_mbr_pca10056 project. I want the application to reset and stay in bootloader mode, from a user command.

From another post, I tried this sequence:

#define BOOTLOADER_DFU_START 0xB1
NRF_POWER->GPREGRET = BOOTLOADER_DFU_START;
NVIC_SystemReset();

It resets into the application, not the bootloader.

Parents Reply
  • I added code to the bootloader in main(), before calling nrf_bootloader_init(),

    to blink LEDs in a certain pattern if 

    (nrf_power_gpregret_get() & BOOTLOADER_DFU_START) is true.

    This proves that my application is setting BOOTLOADER_DFU_START correctly. However, the bootloader still jumps to the application.

    Interestingly, if I add the line

    nrf_power_gpregret_set(BOOTLOADER_DFU_START) before calling nrf_bootloader_init(), the bootloader always stays in bootloader mode on reset.

    If it matters, I am using softdevice S140 for BLE functionality, and FSTORAGE_SD.

Children
No Data
Related