Hello domko99,
There was reference code I uploaded in previous topic: https://community.bosch-sensortec.com/t5/MEMS-sensors-forum/NRF52840-with-BME680/td-p/49665/highlight/false You could refer this example code and correct you code on your platform.
For your error, it doesn't matter with functions state_load() and state_save(). You could refer to the code comments of the two functions:
/*! * @brief Load previous library state from non-volatile memory * * @param[in,out] state_buffer buffer to hold the loaded state string * @param[in] n_buffer size of the allocated state buffer * * @return number of bytes copied to state_buffer */ uint32_t state_load(uint8_t *state_buffer, uint32_t n_buffer) { // ... // Load a previous library state from non-volatile memory, if available. // // Return zero if loading was unsuccessful or no state was available, // otherwise return length of loaded state string. // ... return 0; }
/*! * @brief Save library state to non-volatile memory * * @param[in] state_buffer buffer holding the state to be stored * @param[in] length length of the state string to be stored * * @return none */ void state_save(const uint8_t *state_buffer, uint32_t length) { // ... // Save the string some form of non-volatile memory, if possible. // ... }
... View more