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

wait_for_queue() hangs on re-init of DFU service

I have an app that requires BLE stack to be re-initialized, however it seems that if you run

ble_dfu_init();

more than once, it crashes

Upon further inspection is seems the source the of crash is here:

nrf_dfu_settings_init();

Drilling down, I discovered it seems to be hanging on:

wait_for_queue();

I'm using nRF5_SDK_12.2.0

I can prevent it hanging by increasing this constant:

FS_QUEUE_SIZE

However, it no longer advertises correctly because of:

// Delay starting advertising until the flash operations are complete.
if (flash_access_in_progress())
{
    m_advertising_start_pending = true;
    return NRF_SUCCESS;
}
Parents
  • @ypearson: In SDK v12.x.0 the DFU Service uses a rather inefficient approach(writing data to the bootloader settings page) to signal the bootloader to stay in bootloader mode after the application performs a soft-reset. This approach was abandoned in SDK v13.0.0 where we simply write to the GPREGRET register, perform a soft-reset and then check the GPREGRET register upon entering the bootloader. Thus, I recommend moving to SDK 13 or backporting this feature from SDK v13.

Reply
  • @ypearson: In SDK v12.x.0 the DFU Service uses a rather inefficient approach(writing data to the bootloader settings page) to signal the bootloader to stay in bootloader mode after the application performs a soft-reset. This approach was abandoned in SDK v13.0.0 where we simply write to the GPREGRET register, perform a soft-reset and then check the GPREGRET register upon entering the bootloader. Thus, I recommend moving to SDK 13 or backporting this feature from SDK v13.

Children
No Data
Related