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

How to use fs_erase and fs_store in nRF5_SDK_12.1.0_0d23e2a

Hi, I use fstorage fun in nRF5_SDK_12.1.0_0d23e2a. and the same code can run SDK11 but It seems different now.

So how to use fstorage fun in SDK12 and I list the different with sdk11 below

static void sys_evt_dispatch(uint32_t sys_evt) { fs_sys_event_handler(sys_evt); pstorage_sys_event_handler(sys_evt);//<--Does SDK12 dont need this anymore ble_advertising_on_sys_evt(sys_evt); }

SDK12

fs_ret_t fs_erase(fs_config_t const * const p_config,
              uint32_t    const * const p_page_addr,
              uint16_t    const         num_pages,
              void *                    p_context)

SDK11

fs_ret_t fs_erase(fs_config_t const * const p_config,
              uint32_t    const * const p_page_addr,
              uint16_t    const         num_pages)

The fs_store also different with fstorage in SDK11. I have the fs_init() does work only now. So where has right example code can take a look or Nordic guys can give me. Because the your web site still is old fs fun document

Vincent

Parents
  • Hi,

    1: pstorage_sys_event_handler(sys_evt); You don't need to call that function anymore. It was a) a function of another library called 'pstorage' and b) said library was removed from the SDK.

    2: You can simply pass NULL as parameter for p_context in both fs_store() and fs_erase(). That extra parameter that got added is passed as parameter to the event handler when the operation has completed.

Reply
  • Hi,

    1: pstorage_sys_event_handler(sys_evt); You don't need to call that function anymore. It was a) a function of another library called 'pstorage' and b) said library was removed from the SDK.

    2: You can simply pass NULL as parameter for p_context in both fs_store() and fs_erase(). That extra parameter that got added is passed as parameter to the event handler when the operation has completed.

Children
Related