- I (36975) zzz_spiffs.c: Initializing SPIFFS
- Guru Meditation Error: Core 0 panic'ed (LoadStoreAlignment). Exception was unhandled.
- Core 0 register dump:
- PC : 0x400a5be6 PS : 0x00060230 A0 : 0x800a6287 A1 : 0x3ffdf5f0
- 0x400a5be6: spiffs_page_consistency_check_i at /home/xxx/esp/esp-idf.v5.0-dev-4770-gd622bcfd46/components/spiffs/spiffs/src/spiffs_check.c:598
- A2 : 0x3f50fd0d A3 : 0x00000000 A4 : 0x3f50fc7c A5 : 0x00000000
- A6 : 0x3f50fd0d A7 : 0x3fff053c A8 : 0x00000000 A9 : 0x00000037
- A10 : 0x00000000 A11 : 0x00000000 A12 : 0x3ffeffc0 A13 : 0x00000100
- A14 : 0x00000100 A15 : 0x3f50fc7c SAR : 0x00000010 EXCCAUSE: 0x00000009
- EXCVADDR: 0x3f50fd0d LBEG : 0x3ffeffc0 LEND : 0x00000100 LCOUNT : 0x40027000
- 0x40027000: _xt_user_exc at /home/xxx/esp/esp-idf.v5.0-dev-4770-gd622bcfd46/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vectors.S:643
- Backtrace: 0x400a5be3:0x3ffdf5f0 0x400a6284:0x3ffdf660 0x400a2127:0x3ffdf680 0x400a0da2:0x3ffdf6a0 0x4009dd27:0x3ffdf6d0 0x40095a5d:0x3ffdf710 0x400d3c87:0x3ffdf980 0x400d29e1:0x3ffdf9c0 0x400d2a7d:0x3ffdfa50 0x400d3170:0x3ffdfa70 0x400d1a7c:0x3ffdfa90 0x4012765f:0x3ffdfab0 0x400d1cef:0x3ffdfad0 0x400d1d5b:0x3ffdfb20 0x400325f1:0x3ffdfb40
- 0x400a5be3: spiffs_page_consistency_check_i at /home/xxx/esp/esp-idf.v5.0-dev-4770-gd622bcfd46/components/spiffs/spiffs/src/spiffs_check.c:598
- 0x400a6284: spiffs_page_consistency_check at /home/xxx/esp/esp-idf.v5.0-dev-4770-gd622bcfd46/components/spiffs/spiffs/src/spiffs_check.c:866 (discriminator 3)
- 0x400a2127: SPIFFS_check at /home/xxx/esp/esp-idf.v5.0-dev-4770-gd622bcfd46/components/spiffs/spiffs/src/spiffs_hydrogen.c:1155 (discriminator 2)
- 0x400a0da2: esp_spiffs_check at /home/xxx/esp/esp-idf.v5.0-dev-4770-gd622bcfd46/components/spiffs/esp_spiffs.c:315
- 0x4009dd27: zzz_spiffs_init at /home/xxx/yyy/main/zzz_spiffs.c:218
- 0x40095a5d: ota_upload_post_handler at /home/xxx/yyy/main/zzz_http-server.c:2801 (discriminator 13)
- 0x400d3c87: httpd_uri at /home/xxx/esp/esp-idf.v5.0-dev-4770-gd622bcfd46/components/esp_http_server/src/httpd_uri.c:329
- 0x400d29e1: httpd_parse_req at /home/xxx/esp/esp-idf.v5.0-dev-4770-gd622bcfd46/components/esp_http_server/src/httpd_parse.c:659 (discriminator 15)
- 0x400d2a7d: httpd_req_new at /home/xxx/esp/esp-idf.v5.0-dev-4770-gd622bcfd46/components/esp_http_server/src/httpd_parse.c:787
- 0x400d3170: httpd_sess_process at /home/xxx/esp/esp-idf.v5.0-dev-4770-gd622bcfd46/components/esp_http_server/src/httpd_sess.c:412 (discriminator 15)
- 0x400d1a7c: httpd_process_session at /home/xxx/esp/esp-idf.v5.0-dev-4770-gd622bcfd46/components/esp_http_server/src/httpd_main.c:200 (discriminator 15)
- 0x4012765f: httpd_sess_enum at /home/xxx/esp/esp-idf.v5.0-dev-4770-gd622bcfd46/components/esp_http_server/src/httpd_sess.c:50 (discriminator 1)
- 0x400d1cef: httpd_server at /home/xxx/esp/esp-idf.v5.0-dev-4770-gd622bcfd46/components/esp_http_server/src/httpd_main.c:250
- 0x400d1d5b: httpd_thread at /home/xxx/esp/esp-idf.v5.0-dev-4770-gd622bcfd46/components/esp_http_server/src/httpd_main.c:272 (discriminator 15)
- 0x400325f1: vPortTaskWrapper at /home/xxx/esp/esp-idf.v5.0-dev-4770-gd622bcfd46/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:151
- ELF file SHA256: 720feae3db5ea198
- Rebooting...
Equipment: ESP32-S2-WROVER with SDK esp-idf.v5.0-dev-4770-gd622bcfd46
The Problem: SPIFFS register fails if it has been unregistered previously
Actions:
1) Mounting SPIFFS -> ok
2) Starting HTTPD-Server -> ok
3) Unmounting SPIFFS -> ok
4) Updating SPIFFS via OTA -> ok
5) reMounting SPIFFS -> fail
The code we use for (1) and (5):
- void zzz_spiffs_init(partition_check_t* s_pc)
- {
- ESP_LOGI(TAG, "Initializing SPIFFS");
- // Use settings defined above to initialize and mount SPIFFS filesystem.
- // Note: esp_vfs_spiffs_register is an all-in-one convenience function.
- esp_err_t ret = esp_vfs_spiffs_register(&s_spiffs_conf);
- if (ret != ESP_OK)
- {
- if (ret == ESP_FAIL) { ESP_LOGE(TAG, "Failed to mount or format filesystem"); }
- else if (ret == ESP_ERR_NOT_FOUND) { ESP_LOGE(TAG, "Failed to find SPIFFS partition"); }
- else { ESP_LOGE(TAG, "Failed to initialize SPIFFS (%s)", esp_err_to_name(ret)); }
- }
- else
- {
- ret = esp_spiffs_check(s_spiffs_conf.partition_label);
- if (ret != ESP_OK) { ESP_LOGE(TAG, "esp_spiffs_check failed (%s)", esp_err_to_name(ret)); }
- else
- {
- ESP_LOGI(TAG, "esp_spiffs_check succeeded");
- size_t total = 0, used = 0;
- ret = esp_spiffs_info(s_spiffs_conf.partition_label, &total, &used);
- if (ret != ESP_OK) { ESP_LOGE(TAG, "Failed to get SPIFFS partition information (%s)", esp_err_to_name(ret)); }
- else { ESP_LOGI(TAG, "Partition size: total: %d, used: %d", total, used);}
- }
- }
- }
The code we use for (3):
- void zzz_spiffs_deinit(partition_check_t* s_pc)
- {
- esp_err_t ret = esp_vfs_spiffs_unregister(s_spiffs_conf.partition_label);
- if (ret != ESP_OK) { ESP_LOGE(TAG, "SPIFFS unregister failed (%s)", esp_err_to_name(ret)); }
- else { ESP_LOGI(TAG, "SPIFFS unmounted"); }
- }
The following error occurs:
The mentioned line
refers to0x4009dd27: zzz_spiffs_init at /home/xxx/yyy/main/zzz_spiffs.c:218
.ret = esp_spiffs_check(s_spiffs_conf.partition_label);
I also have to mention that this error only occurs after remounting SPIFFS. This error doesn't occur after reboot. After reboot SPIFFS mounts without errors. Our current workaround is to reboot after SPIFFS OTA update.
Any idea? Thank you in advance!