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

fds in sdk14

I'm trying to migrate my old app based on buttonless app sdk13 to buttonless app sdk14. I solved issuie according to migrate guide remove chunk things and etc. My app works well until I add fds_init function in my main.c file.
Here's my fds_test_init function

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

After I comment calling of that function in my main.c the app starts work. After comment again not working. I see nothing in RTT terminal

The same code works well with sdk13

  • I've tried to get ret_code using function SEGGER_RTT_printf(0, "%d", ret_code); but I get nothing in terminal if use fds_init function even if I to write any message before calling fds_init. Also I've tried to get err_code via debugging (keil), I set breakpoint next to ret_code_t ret = fds_register(fds_evt_handler); but in watch window most of the time err_code's value . screen is there any guide how to get ret_code?

  • I forgat to change optimization level of debugging to level 0. So now I can see that ret either returned by fds_register or fds_init functions is 0.

  • If it's returning 0 that means success, so this is not where your issue is. Be sure to fully erase the chip when re-programming since old FDS data is maintained and can cause issues if you changing your FDS implementation.

  • Yes. I do all the time by that way (eraseall, program softdevice, program app). There were not any problems with sdk13, but now... There's main function

    int main(void)
    {
        bool erase_bonds;
    		uint32_t err_code;
        // Initialize.
        log_init();
    		SEGGER_RTT_printf(0, "start app\n\r");
    
    		m_clock_timer_init();
    		pwm_init_corr();
    		pwm_init_rgb();
    	
    		HX711_init();
    		
    		err_code = fds_test_init();
    		APP_ERROR_CHECK(err_code);
    		
    	
    	//fds_init_values();
    	//fds_get_init_data();
    		//test_expired();
    		//fds_clear();  
    	//	rgb_set(50, 50, 50, 3, 1500);
        timers_init();
        power_management_init();
        buttons_leds_init(&erase_bonds);
        ble_stack_init();
        peer_manager_init();
        gap_params_init();
        gatt_init();
        advertising_init();
        services_init();
        conn_params_init();
    
        //NRF_LOG_INFO("Start scale driver app\n");
    
        // Start execution.
        application_timers_start();
        advertising_start(erase_bonds);
    
        // Enter main loop.
        for (;;)
        {
            if (NRF_LOG_PROCESS() == false)
            {
                nrf_pwr_mgmt_run();
            }
        }
    }
    

    If I comment these raws:

    //err_code = fds_test_init();
        //		APP_ERROR_CHECK(err_code);
    

    app starts work

  • Check your fds_evt_handler for error codes for "FDS_EVT_INIT".

Related