debugging - LittleFS causes ESP32 D1 Mini to crash - no idea why

when calling LittleFS.format() esp32 d1 mini crashes

```
assert failed: esp_littlefs_format esp_littlefs.c:474 (partition_label)

Backtrace: 0x40083571:0x3ffb2040 0x40088365:0x3ffb2060 0x4008d2bd:0x3ffb2080 0x400e1c83:0x3ffb21b0 0x400d2ba9:0x3ffb21f0 0x400d1a0a:0x3ffb2210 0x400d4d3a:0x3ffb2290
```
This commit is contained in:
Marcus 2024-10-17 15:28:16 +02:00
parent 04e8de0fde
commit a330268960
3 changed files with 18 additions and 7 deletions

View file

@ -59,10 +59,12 @@
#include <ArduinoJson.h>
// https://github.com/PaulStoffregen/Time
#include <TimeLib.h>
#include "FS.h"
// arduino-core for esp8266 and esp32
#include "LittleFS.h"
void setup() {
// define output for onboard LED/WIPE pin
pinMode(PinWIPE, OUTPUT);
@ -93,13 +95,26 @@ void setup() {
}
delay(333);
}
// set back to HIGH because thats the default
#ifdef ESP8266
// set back to HIGH because thats the default on esp8266
digitalWrite(PinWIPE, HIGH);
//delay(2000);
#endif
#ifdef ESP32
// set back to HIGH because thats the default esp32
digitalWrite(PinWIPE, LOW);
#endif
// read status from PinWIPE to WIPE
// when PinWIPE is set to LOW, format LittleFS
#ifdef ESP8266
if(digitalRead(PinWIPE) == LOW) {
#endif
#ifdef ESP32
if(digitalRead(PinWIPE) == HIGH) {
#endif
Serial.println("!! formatting LittleFS !!");
LittleFS.format();
Panic();

View file

@ -30,6 +30,7 @@
#include "CanGrow_Version.h"
//#define FORMAT_LITTLEFS_IF_FAILED false
const char* configfile = "config.json";
#ifdef ESP8266

View file

@ -1,5 +0,0 @@
/* CanGrow_Version.h gets generated from cangrow.sh */
const char* CanGrowVer = "0.2-dev";
const char* CanGrowBuild = "529bd7e-20241017010523";