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

nrf_dfu_flash_wait never return

hello,

I use nrf51822 + S130 + SDK12.2 in my product, nrf51822 work at central + peripheral mode,and i use nrf_duf_flash module for my dfu funtion.

The problem is, i use my dongle(as central role) connect my product(as peripheral role) and send dfu commands to it, when my product do not connect a peripheral as central role, it looks like work well, the dfu process is ok, but when my product do connect a peripheral as central role(that means my product has to connection both as central and peripheral), some times the dfu is ok, but some times, program will dead in nrf_flash_wait function,in the loop

while ((m_flags & FLASH_FLAG_OPER) != 0)
{
        (void)sd_app_evt_wait();
}

and never out.

my dfu code like this:

if (nrf_dfu_flash_store((uint32_t *)(IAP_STORE_ADDR + s_tIAPState.write_ptr), (uint32_t  *)data_buf, (data_len >> 2), NULL) != FS_SUCCESS)
{
    tCmdPar.index = IAPERROR_WRITEFLASH;
}
else                                    
{
    if (nrf_dfu_flash_wait() != FS_SUCCESS)
    {
        tCmdPar.index = IAPERROR_WRITEFLASH;
        break;
    }
  
    //other code
}

I also try SDK12.3, the problem is same.

Is this a bug of SDK? How can i fix it, or, if do not use nrf_dfu_flash module, what can i do?

Related