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

FDS and bootloader

Hello,

I try to use fds with bootloader but function wait_for_fds_ready() never returns. Do someone have an idea please ?

static void power_manage(void)
{
#ifdef SOFTDEVICE_PRESENT
    (void) sd_app_evt_wait();
#else
    __WFE();
#endif
}

static void wait_for_fds_ready(void)
{
    while (!m_fds_initialized)
    {
        power_manage();
    }
}


int my init:

    ret_code_t ret = fds_register(my_fds_evt_handler);
    if (ret != FDS_SUCCESS)
    {
        NRF_LOG_INFO("Error: fds_register failed");
        return ret;    
    }
    ret = fds_init();
    if (ret != FDS_SUCCESS)
    {
        NRF_LOG_INFO("Error: fds_init failed");
        return ret;
    }
       
    wait_for_fds_ready(); <- never returns

Parents
  • How have you implemented my_fds_evt_handler()? It should set the m_fds_initialized variable to true. It should look something like this: 

    void fds_evt_handler(fds_evt_t const * const p_fds_evt) {
        switch (p_fds_evt->id) {
            case FDS_EVT_INIT:
                if (p_fds_evt->result == FDS_SUCCESS) fds_initialised = true;
                break;
            case FDS_EVT_WRITE:
            case FDS_EVT_UPDATE:
            	if (p_fds_evt->result == FDS_SUCCESS) fds_write_done = true;
            	break;
            case FDS_EVT_GC: 
            	if (p_fds_evt->result == FDS_SUCCESS) fds_garbage_collected = true;
            	break;
        }
    }

Reply
  • How have you implemented my_fds_evt_handler()? It should set the m_fds_initialized variable to true. It should look something like this: 

    void fds_evt_handler(fds_evt_t const * const p_fds_evt) {
        switch (p_fds_evt->id) {
            case FDS_EVT_INIT:
                if (p_fds_evt->result == FDS_SUCCESS) fds_initialised = true;
                break;
            case FDS_EVT_WRITE:
            case FDS_EVT_UPDATE:
            	if (p_fds_evt->result == FDS_SUCCESS) fds_write_done = true;
            	break;
            case FDS_EVT_GC: 
            	if (p_fds_evt->result == FDS_SUCCESS) fds_garbage_collected = true;
            	break;
        }
    }

Children
Related