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

Parents
  • As I understand program doesn't return any fds event handler because I try to set breakpoints on different raws inside fds_evt_handler function but the program doesn't stop there. Also I've tried to add SEGGER function for detecting no works too.

    void fds_evt_handler(fds_evt_t const * const p_fds_evt)
    {
        switch (p_fds_evt->id)
        {
    			SEGGER_RTT_printf(0, "handler\n\r");
            case FDS_EVT_INIT:
                if (p_fds_evt->result != FDS_SUCCESS)
                {
    							 SEGGER_RTT_printf(0, "failed\n\r");
                    // Initialization failed.
                }
                break;
    				case FDS_EVT_WRITE:
    						if (p_fds_evt->result == FDS_SUCCESS)
    						{
    							write_flag=1;
    						}
    						break;
    						
    				case FDS_EVT_DEL_RECORD:
    						if (p_fds_evt->result == FDS_SUCCESS)
    						{
    							delete_flag=1;
    						//	SEGGER_RTT_printf(0, "del\n\r");
    						}
    						break;
            default:
                break;
        }
    }
    
Reply
  • As I understand program doesn't return any fds event handler because I try to set breakpoints on different raws inside fds_evt_handler function but the program doesn't stop there. Also I've tried to add SEGGER function for detecting no works too.

    void fds_evt_handler(fds_evt_t const * const p_fds_evt)
    {
        switch (p_fds_evt->id)
        {
    			SEGGER_RTT_printf(0, "handler\n\r");
            case FDS_EVT_INIT:
                if (p_fds_evt->result != FDS_SUCCESS)
                {
    							 SEGGER_RTT_printf(0, "failed\n\r");
                    // Initialization failed.
                }
                break;
    				case FDS_EVT_WRITE:
    						if (p_fds_evt->result == FDS_SUCCESS)
    						{
    							write_flag=1;
    						}
    						break;
    						
    				case FDS_EVT_DEL_RECORD:
    						if (p_fds_evt->result == FDS_SUCCESS)
    						{
    							delete_flag=1;
    						//	SEGGER_RTT_printf(0, "del\n\r");
    						}
    						break;
            default:
                break;
        }
    }
    
Children
No Data
Related