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

Unable to initialize the FDS module

Hello,

I wanna use FDS module and started with FDS example given in SDK 11.

I have used the exactly same functions for initialization but it seems like FDS module is not getting initialized.

I have searched the forum and found some people facing the same problem but there fixes did not work for me. That is why I raised this question, may be I am missing something else.

Here is the sequence in which I am initializing my modules.

I am posting this because this post FDS Initialization Failed reports that the wrong initialization sequence may result into FDS initialization error but I have taken this into consideration but to no avail for my case.

// Initialize.
    timers_init();			//It calls APP_TIMER_INIT which should be called once
		buttons_leds_init(&erase_bonds);
		ble_stack_init();
		
   
		//Step2 in DB discovery ::  Initialize the db_discovery module with ble_db_discovery_init() in main().
		db_discovery_init();
		os_c_init();				//Our Service Init STH
		
		gap_params_init();
    conn_params_init();
		services_init();
		advertising_init();
    
		//device_manager_init(erase_bonds);
    peer_manager_init(erase_bonds);
		

		/****************		TEST FDS		*****************/
		
		err_code =fds_test_init();
		APP_ERROR_CHECK(err_code);
		while(fds_init_done==0);												//Waiting for initialization event for FDS
		

Here is the code for the "fds_test_init" which is same as in example.

static ret_code_t fds_test_init (void)
{
	
		ret_code_t ret = fds_register(my_fds_evt_handler);
		if (ret != FDS_SUCCESS)
		{
					return ret;
		}
		ret = fds_init();
		if (ret != FDS_SUCCESS)
		{
				return ret;
		}
		
		return NRF_SUCCESS;
		
}

Can anyone help me identify why my flag "fds_init_done" is never set to 1.

while I am setting it the FDS event handler as follows:

 switch (p_fds_evt->id)
    {
        case FDS_EVT_INIT:
            if (p_fds_evt->result != FDS_SUCCESS)
            {
                // Initialization failed.
            }
						else if (p_fds_evt->result == FDS_SUCCESS)
            {
                // Initialization succeeded
								fds_init_done=1;
            }
            break;

Your help will really be appreciated.

Thanks

Related