-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move repeated NVS partition encryped to debug logs (IDFGH-14702) #15442
Comments
Hi @dizcza,
Are showing this information message in their respective log examples. Therefore the existence of the log Info message shouldn't be a surprise, rather confirmation of good flow. I would not consider emitting of this information using LOGI as a bug. |
I don't want to see the "NVS partition "%s" is encrypted" log each time I do a write operation. |
But I'm not insisting. |
Hi @dizcza, |
I don't use any frameworks for NVS operations - it's fully under my control. Except the cause that I'm using ESP-IDF + Arduino as a component. esp_err_t bsp_nvs_flash_init() {
esp_err_t err = nvs_flash_init();
if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND) {
// NVS partition was truncated and needs to be erased
// Retry nvs_flash_init
nvs_flash_erase();
err = nvs_flash_init();
}
return err;
}
...
nvs_handle_t nvs_handle = 0;
if (bsp_nvs_flash_init() == ESP_OK) {
if (nvs_open("gps", NVS_READWRITE, &nvs_handle) == ESP_OK) {
nvs_set_u16(nvs_handle, "accuracy", accuracy_cm);
nvs_close(nvs_handle);
}
} So I call Is my assumption incorrect? |
@dizcza - Yes, your assumption is correct. The secure init returns at the moment it detects already initialised partition (in your case the default one). While it, unfortunately, always emits the unwanted LOGI message. There is one fast solution for you - to keep track of initialisation at the function bsp_nvs_flash_init level i.e. in a static variable and omit the multiple call to the nvs_flash_init. |
All right, thanks for the clarification. I'll go with your first approach suggestion. |
This should be a debug log
esp-idf/components/nvs_flash/src/nvs_api.cpp
Line 157 in c71d74e
Firstly, I thought the log indicates there was an error to read/write from the enrypted nvs partition and the error was printed silently. I needed to find the source line to investigate whether it was just a notification or more.
The text was updated successfully, but these errors were encountered: