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

SDK15.2 Bootloader does not timeout even though NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set

During a DFU on SDK15.2 the BLE connection is terminated. The NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set to 120000.

After 2 minutes, the device still has not reset and started running the application again.

This same test on SDK14.0.0 will restart the device after 2 minutes of inactivity.

Using the Keil Debugger, confirmed that inactivity_timeout() is being called after two minutes

but the call to bootloader_reset() does not recover the device.

Screenshot attached.

Parents Reply
  • Hi Mark, 

    To clarify, if the SD+BL is performed with dual bank update ,and if the size of the SD is not changed, the application will be retained. If not the application will be erased. If the SD+BL size is bigger than the swap area, the singe bank update will be performed automatically (unless you configured not to use singlebank). 

    In the case that the application is erased, the application is only put back if you do another DFU for the app. This either be done by the DFU master automatically if you do an APP+SD+BL update or done manually if you only do DFU for SD+BL. 

    To avoid the case being drag for long time without solving your issue. Please summarize with bullet points on the issue(s) you currently have. Please send us any code that we can reproduce the issue here. 

Children
  • These are the sizes of the BL, SD, and Apps for each of SDK 14.0 and SDK 15.2

    In both instances, the SD being updated is actually smaller in size than the loaded SD.

    The sum of BL+SD is greater for SDK 15.2 than for SDK 14.0

    Force Dual bank is disabled

    #define NRF_DFU_FORCE_DUAL_BANK_APP_UPDATES 0

    SDK14.0 App Segment Size

    340kB - 158784 = 189376 free

    SDK 15.2 App Segment Size

    328kB - 159608 = 176264 free

    SDK 14.0.0 Update
    BL 23280 23280
    SD 5.0.0/5.1.0 136360 123012
    Sum BL+SD 159640 146292
    App 158784
    SDK 15.2.0 Update
    BL 23040 23040
    SD 6.1.0/6.1.1 148332 147792
    sum BL+SD 171372 170832
    App 159608

    Looks like there is room for the DUAL Bank DFU to take place.

  • Hi Mark, 

    Each page of the nRF52 is 4kB so we need to count the size with page aligned. 


    The S132 v6.1/S132v6.2 will occupy 152kB (end address at 0x26000).


    You app is 159608byte => 156kB in size. 


    The bootloader I assume the start address is at 0x78000 by default => Occupies 32kB. This is required because there are some storage pages for bootloader setting and backup.


    So it's already occupied 152+156+32=340kB. 

    I assume you are using nRF52832 which has 512kB of flash. So we have 172kB left. 


    Even if you don't have any application data need to be reserved. It's still not enough to receive the Softdevice + BL = 152+22= 174kB (occupies 176kB). 

    You can do a quick check by reading the flash out using: nrfjprog --readcode and compare it with the previous hex dump before the update. 

    If you do a SD DFU only or BL DFU only, it should fit into the swap bank and the app should run after that. 

Related