This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

After NVIC_SystemReset(), where program access?

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:

  1. what's wrong about my operation

  2. how can i do to Restart the program from softdevice after downloaded the new firmware.

expect your help! Thank you!

  • Are you using the standard bootloader in our SDK? If so, which SDK version and SoftDevice version are you using? Also if I understood your issue correctly, the application does not start after the DFU image (SD +APP) has replaced the old SD and app and a SoftReset is performed. However, after a Hard Reset, the new application starts?

  • Thank you for your answer.I'm sorry if I didn't explain clear.

    I'm not use the standard bootloader in the SDK. I made my own bootloader cause there are something need to be encrypted.

    The process is :

    1. Start from SD, mbr will find the bootloader address from uicr, if has bootloader, jump to my bootloader

    2. my bootloader is only to erase old sd+app, store new sd+app to old region and jump to the app region to excute( new sd+app data is downloaded by ble service in the app program)

    I have solved my problem and the reason is NVIC_SystemReset() didn't run actually.

Related