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

boot from app to bootloader SDK12 and S132 V3.0

Hi,

I'm porting our project from sdk10 to sdk12 with SD S132 V3.0.0. I cannot find a way to reset the device in app and boot in bootloader in order to do a OTA update.

In sdk10 was as easy as to set the GPREGRET register and then perform the reset:

err_code = sd_power_gpregret_set(0xB1);       //#define BOOTLOADER_DFU_START 0xB1 
			APP_ERROR_CHECK(err_code);	        //GPREGRET register is responsible for DFU checking condition	
			NVIC_SystemReset();                 //this line perform restart

I tried searching in the experimental example dfu_buttonless but I couldn't find the proper way to do it.

Any help is welcome, thanks.

Parents
  • Hi

    The new signed DFU doesn't use the GPREGRET registers to decide if the bootloader should enter bootloader mode or not. The new mechanism is based on a bit in the bootloader settings that is manipulated by the application. I personally would have preferred the method with the GPREGRET because I don't like that fact that the application must write to the bootloader settings. In my opinion only the bootloader should write to the bootloader settings. Side question: Why did Nordic change the way to enter the bootloader?

    The new implemenation of Nordic is in the service implementation ble_dfu.c. This file is also used in there buttonless example.

    For my own projects modified there code to the old behavior with the GPREGRET registers. In the implementation of the function "nrf_dfu_enter_check" I've added the following code:

    if (NRF_POWER->GPREGRET == BOOTLOADER_DFU_START)
    {
      NRF_POWER->GPREGRET = 0;
      return true;
    }
    

    Additionally the define for BOOTLOADER_DFU_START must be added. With this modification you could enter the bootloader the same way as you did with the old basic DFU.

    Regards Adrian

  • Adrian,

    Are you willing to share your changes on using GPREGRET? I'm just about to do this on our design.

Reply Children
No Data
Related