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

pstorage is always pending and advertisement does not resume

Hello Guys,

Everything was working fine with my nRF51822 device but all of the sudden the hardware started not to resume advertisements upon disconnecting from the host.

I debugged the issue down to the following function:

static void advertising_start(void)
{
    uint32_t err_code;
    uint32_t count;

    // Verify if there is any flash access pending, if yes delay starting advertising until 
    // it's complete.
    err_code = pstorage_access_status_get(&count);
    APP_ERROR_CHECK(err_code);
    
    if (count != 0)                <==== COUNT IS ALWAYS RETURNING NON-ZERO
    {
        m_memory_access_in_progress = true;
        return;
    }
    
    start_advertisement_timeout = false;
    err_code = sd_ble_gap_adv_start(&m_adv_params);
    APP_ERROR_CHECK(err_code);

}

So the code starts fine I see advertisements then I pair with the host as a mouse. I tell the host to disconnect and the nRF51822 should resume advertisements but something is causing Flash Access to be in a pending state because count is returning non-zero. why? what could it be?

pstorage_sys_event_handler(uint32_t sys_evt) is getting triggered but m_cmd_queue.flash_access is false. m_cmd_queue.count is equals 4.

Trying to understand this so I can fix the problem.

Thanks,

Parents Reply Children
No Data
Related