You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are using Windows, please specify command line type.
None
Development Kit.
esp32c3
Power Supply used.
USB
What is the expected behavior?
Files in the directory in developer mode should not be lost
What is the actual behavior?
I started nvs encryption in developer mode. This is my file system. The files in the directory existed after the first encryption, but when I used idf.py encrypted-flash monitor again, the files in the directory were lost.
// 挂载 LittleFS 文件系统
esp_err_t ret = esp_vfs_littlefs_register(&conf);
if (ret != ESP_OK) {
printf("Failed to mount or format filesystem (%s)\n", esp_err_to_name(ret));
return;
}
printf("LittleFS mounted successfully!\n");
// 获取 LittleFS 分区信息
size_t total = 0, used = 0;
ret = esp_littlefs_info(conf.partition_label, &total, &used);
if (ret != ESP_OK) {
printf("Failed to get LittleFS partition information (%s)\n", esp_err_to_name(ret));
} else {
printf("LittleFS partition size: total: %d, used: %d\n", total, used);
// 列出文件
list_littlefs_files("/littlefs");
}
// 检查加密后的文件系统是否正常工作
FILE* file = fopen("/littlefs/index.html", "rb");
if (file == NULL) {
printf("Failed to open index.html for reading\n");
} else {
fclose(file);
printf("Successfully opened index.html\n");
}
}
When I decrypt the firmware, the code exists without modifying the files in the directory.
Below is my encrypted partition.This problem will not occur if you use spiffs
github-actionsbot
changed the title
Files in the encrypted directory of the esp_littlefs file system are lost
Files in the encrypted directory of the esp_littlefs file system are lost (IDFGH-14305)
Dec 26, 2024
Answers checklist.
IDF version.
commit e3e112e (HEAD -> release/v5.1, origin/release/v5.1) Merge: c1f26c
Espressif SoC revision.
esp32c3
Operating System used.
macOS
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
esp32c3
Power Supply used.
USB
What is the expected behavior?
Files in the directory in developer mode should not be lost
What is the actual behavior?
I started nvs encryption in developer mode. This is my file system. The files in the directory existed after the first encryption, but when I used idf.py encrypted-flash monitor again, the files in the directory were lost.
Below is my specific file code information
file system files
LittleFS Configuration:
Block Size: 4096 / 0x1000
Image Size: 425984 / 0x68000
Block Count: 104
Name Max: 64
Image: /Users/ko_hon/matter1-2/connectedhomeip/examples/bridge-app3-0/esp32/build/storage.bin
Adding File: channel11.txt
Adding File: channel2.txt
Adding File: index.html
Adding File: .DS_Store
Adding File: channel1.txt
Adding File: hot16.txt
Adding File: cool18.txt
Adding File: cool30.txt
Adding File: cool24.txt
Adding File: cool25.txt
Adding File: cool19.txt
Adding File: hot17.txt
Adding File: hot29.txt
Adding File: cool27.txt
Adding File: cool26.txt
Adding File: hot28.txt
Adding File: cool22.txt
Adding File: cool23.txt
Adding File: air.txt
Adding File: onoff.txt
Adding File: cool21.txt
Adding File: cool20.txt
Adding File: hot23.txt
Adding File: hot22.txt
Adding File: hot20.txt
Adding File: hot21.txt
Adding File: hot19.txt
Adding File: hot25.txt
Adding File: cool17.txt
Adding File: cool16.txt
Adding File: hot24.txt
Adding File: hot30.txt
Adding File: hot18.txt
Adding File: hot26.txt
Adding File: cool28.txt
Adding File: cool29.txt
Adding File: hot27.txt
Adding File: channel22.txt
code:
#include "ir_file_system.h"
#include <dirent.h> // 提供 opendir, readdir, closedir 函数
#define SPIFFS_BASE_PATH "/littlefs"
#define SPIFFS_PARTITION_LABEL "storage"
static const char *TAG = "ir-spiffs";
nvs_handle_t Web_s; //网页状态句柄
void list_littlefs_files(const char *base_path)
{
DIR *dir = opendir(base_path);
if (dir == NULL) {
printf("Failed to open directory: %s\n", base_path);
return;
}
}
// 初始化 LittleFS 文件系统
void ir_spiffs_init()
{
esp_vfs_littlefs_conf_t conf = {
.base_path = SPIFFS_BASE_PATH,
.partition_label = SPIFFS_PARTITION_LABEL, // 与分区表中的标签匹配
.format_if_mount_failed = false,
.dont_mount = false,
};
}
When I decrypt the firmware, the code exists without modifying the files in the directory.
Below is my encrypted partition.This problem will not occur if you use spiffs
Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, , 0x8000,
fctry1, data, nvs_keys,, 0x1000, encrypted
otadata, data, ota, , 0x2000,
phy_init, data, phy, , 0x2000,
ota_0, app, ota_0, , 0x1B2000,
ota_1, app, ota_1, , 0x1B2000,
storage, data, littlefs,, 0x68000,
fctry, data, nvs, , 0x6000,
meuconfig setup
Steps to reproduce.
1.Initialize the esp_littlefs file system
2.Encryption developer mode
Debug Logs.
More Information.
No response
The text was updated successfully, but these errors were encountered: