Hello,
Is this function non-blocking?
esp_err_t nvs_set_u32(nvs_handle_thandle, const char *key, uint32_t value)
Writing to flash usually takes a few milliseconds. Does this function block the current task x milliseconds? Or is there a background task that write to the flash memory?
BR
Jonas
Time executing NVS functions
Re: Time executing NVS functions
Hi Jonas,
the NVS functions are all blocking. There is no background thread going on. Since NVS may re-order data if one page is full, there's a potential erasure of flash which takes a "long" time, blocking the current thread.
If you want to do something during the time of writing, then please use a FreeRTOS task or alternatively std::async, if you're using C++.
Best,
Jakob
the NVS functions are all blocking. There is no background thread going on. Since NVS may re-order data if one page is full, there's a potential erasure of flash which takes a "long" time, blocking the current thread.
If you want to do something during the time of writing, then please use a FreeRTOS task or alternatively std::async, if you're using C++.
Best,
Jakob
Re: Time executing NVS functions
Thanks for the answer. I measured the time of
esp_err_t nvs_set_u32(nvs_handle_thandle, const char *key, uint32_t value)
and it took 500 uS to execute.
esp_err_t nvs_set_u32(nvs_handle_thandle, const char *key, uint32_t value)
and it took 500 uS to execute.
Who is online
Users browsing this forum: No registered users and 156 guests