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

FDS module not working while migrating from sdk13 to sdk 15.2

Hi everyone,

I am using SDK 15.2 with keil microvision and softdevice132 nrf52_6.1.

In version 13, system dispatch event was regestired with Softdevice handler as below

static void sys_evt_dispatch(uint32_t sys_evt)
{
    fs_sys_event_handler(sys_evt);
}

//Register with the SoftDevice handler module for SYS events.
    err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);

In 15.2, I replaced this part with

NRF_SDH_SOC_OBSERVER(m_sys_obs, 0, nrf_fstorage_sys_evt_handler, NULL);

I get an implicit declaration error even with correct header nrf_storage_sd.h included in the file. I even defined nrf_storage_sys_evt_handler in the same file, but its like writing most of the part which is already in nrf_storage_sd.c. Even then its not working, when the fds intialising is done and if its true again the my_flash_evt_handler should be called to reset it. Its not called and my program hangs in a infinite while loop.  The fds event handler is as below

// register event handler
    err_code = fds_register(my_flash_evt_handler);

void locid_flash_evt_handler(fds_evt_t const * const p_fds_evt){
    switch (p_fds_evt->id){
    case FDS_EVT_INIT:
        {
   //handle error
        }
        break;
    case FDS_EVT_WRITE: {
   //handle error
        }

Am I doing it right ? I also went through the available fds example in pheripheral folder and even usage part in nordic info center, it has no OBSERVER macro defined. I am confused. Please help me find the solution.

Thanks in advance

Parents
  • Hi,

    extern nrf_fstorage_api_t nrf_fstorage_sd is the appropriate backend used to access flash when Softdevice is enabled. 

    I'm not sure I understand the necessity of changing the backend module fstorage module when you want to migrate a project that use FDS. The proper way to migrate a project that use Flash Data Storage module is to update the functions that are used from FDS in your application. Backend modules such as fstorage shouldn't be necessary to modify as they can be included directly from the newest SDK. 

    You can try including your project into the flash fds example in the newest SDK and replace the updated API functions with the appropriate function call in your application.  

    Best regards

    Jared 

Reply
  • Hi,

    extern nrf_fstorage_api_t nrf_fstorage_sd is the appropriate backend used to access flash when Softdevice is enabled. 

    I'm not sure I understand the necessity of changing the backend module fstorage module when you want to migrate a project that use FDS. The proper way to migrate a project that use Flash Data Storage module is to update the functions that are used from FDS in your application. Backend modules such as fstorage shouldn't be necessary to modify as they can be included directly from the newest SDK. 

    You can try including your project into the flash fds example in the newest SDK and replace the updated API functions with the appropriate function call in your application.  

    Best regards

    Jared 

Children
Related