This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Softdevice - NVS non volatile storage implementation.

Hello,

I am new to Nordic. I was trying to find a sample code that has implemented NVS / EEPROM (I don't want to use external EEPROM). But I did not find any example that has this. I had implemented NVS earlier in Zephyr but in softdevice I am seeking help.

Please help. Thanks in advance.

Thanks and regards,

Neeraj Dhekale

Parents
  • Hi Neeraj, 

    I assume you are working on nRF5 SDK ? Please note that for new development we recommend  to use nRF Connect SDK (Zephyr) instead of nRF5SDK. 

    If you need to use nRF5 SDK, the libraries you should use are fstorage and fds

    You can find their examples in \examples\peripheral.

    I also attached here a test I made to combine fstorage in a ble application. It's based on ble_app_hrs in SDK v17.1

  • Hello Hung Bui,

    I have tried to implement fstorage but I am facing issue with in ble_stack_init () function for nrf_sdh_enable_request() function returns 8. Did you face this issue? If yes, What did you do for that?

    Also I tried to comment BLE related all function then it is showing below error:

    nrf_fstorage: addr_is_within_bounds(p_fs, dest, len) check failed in nrf_fstorage_write() with value 0x10.

    Thanks and regards,

    Neeraj Dhekale

  • Hi, If you have a look at the description of the function you can find this: 

    /**@brief   Function for requesting to enable the SoftDevice.
     *
     * This function issues a @ref NRF_SDH_EVT_ENABLE_REQUEST request to all observers that
     * were registered using the @ref NRF_SDH_REQUEST_OBSERVER macro. The observers may or
     * may not acknowledge the request. If all observers acknowledge the request, the
     * SoftDevice will be enabled. Otherwise, the process will be stopped and the observers
     * that did not acknowledge have the responsibility to restart it by calling
     * @ref nrf_sdh_request_continue when they are ready for the SoftDevice to change state.
     *
     * @retval  NRF_SUCCESS                 The process is started.
     * @retval  NRF_ERROR_INVALID_STATE     The SoftDevice is already enabled.
     */
    ret_code_t nrf_sdh_enable_request(void);

    NRF_ERROR_INVALID_STATE (=8)  means that the softdevice may have already enabled. (you called nrf_sdh_enable_request() earlier)


    Have you tried to look at my example  ?

Reply
  • Hi, If you have a look at the description of the function you can find this: 

    /**@brief   Function for requesting to enable the SoftDevice.
     *
     * This function issues a @ref NRF_SDH_EVT_ENABLE_REQUEST request to all observers that
     * were registered using the @ref NRF_SDH_REQUEST_OBSERVER macro. The observers may or
     * may not acknowledge the request. If all observers acknowledge the request, the
     * SoftDevice will be enabled. Otherwise, the process will be stopped and the observers
     * that did not acknowledge have the responsibility to restart it by calling
     * @ref nrf_sdh_request_continue when they are ready for the SoftDevice to change state.
     *
     * @retval  NRF_SUCCESS                 The process is started.
     * @retval  NRF_ERROR_INVALID_STATE     The SoftDevice is already enabled.
     */
    ret_code_t nrf_sdh_enable_request(void);

    NRF_ERROR_INVALID_STATE (=8)  means that the softdevice may have already enabled. (you called nrf_sdh_enable_request() earlier)


    Have you tried to look at my example  ?

Children
Related