Hi , Everyone! Now i have the board nrf52832 and i'm conducting my DFU.
My DFU is to update softdevice and application.
Here is detail about my problem:
softdevice: 0x0 -- 0x1efff
application: 0x1f000 -- 0x3bfff(is enough)
sd+app download: 0x3c000 -- 0x77fff
bootloader: 0x78000 -- end of rom(i have written the bootloader address to uicr and test succeed)
Process
After new sd+app have downloaded in above rigion, it will run NVIC_SystemReset()
to Reset the system. The Process i expect is that the program start at softdevice to find bootloader address, and jump to bootloader. Then bootloader jump to application.
bootloader
If there have new sd+app ,the bootloader will erase old sd+app and move new ad+app from downloader address and execute from application address. else the bootloader will execute from application address directly.
Application
Transmit sd+app data to the sd+app download address. And NVIC_SystemReset()
reset the system.
Problem
after downloaded sd+app and execute NVIC_SystemReset()
, it seems that the program can't start at the bootloader or softdevice(0x0),cause the program run is the old application.
However, if i turn off the power and turn on(hard Reset), the program run is the new application. Cause hard Reset will must start at softdevice, and jump to my bootloader.
So i wonder whether NVIC_SystemReset()
will jump to application, not softdevice(0x0)??
here is the vector_table_base setting from application:
uint32_t err_code;
err_code = nrf_dfu_mbr_init_sd();
if(err_code != NRF_SUCCESS)
{
NRF_LOG_INFO("Failed running nrf_dfu_mbr_init_sd\r\n");
return;
}
err_code = sd_softdevice_vector_table_base_set(0x0001F000);
Please tell me:
-
what's wrong about my operation
-
how can i do to Restart the program from softdevice after downloaded the new firmware.
expect your help! Thank you!