earlephilhower / arduino-littlefs-upload

Build and uploads LittleFS filesystems for the Arduino-Pico RP2040, RP2350, ESP8266, and ESP32 cores under Arduino IDE 2.2.1 or higher
MIT License
133 stars 12 forks source link

have error with custom csv #61

Open stef-ladefense opened 4 hours ago

stef-ladefense commented 4 hours ago

according to the Expressif doc, https://docs.espressif.com/projects/esp-idf/en/v5.3.1/esp32/api-guides/partition-tables.html#creating-custom-tables a csv can contain spaces and short expressions, like 3M instead of 0x300000. except that your extension no longer works in this case.

OK with : nvs, data, nvs, 0x9000, 0x5000, otadata, data, ota, 0xe000, 0x2000, app0, app, ota_0, 0x10000, 0x300000, app1, app, ota_1, 0x310000,0x300000, spiffs, data, spiffs, 0x610000,0x9E0000, coredump, data, coredump,0xFF0000,0x10000,

KO with : nvs, data, nvs, 0x9000, 0x5000, otadata, data, ota, 0xe000, 0x2000, app0, app, ota_0, 0x10000, 3M, app1, app, ota_1, ,3M, spiffs, data, spiffs, ,0x9E0000, coredump, data, coredump, ,0x10000,

earlephilhower commented 3 hours ago

Ah, interesting. TypeScript should handle spaces in parseInt just fine, but those magnitude modifiers definitely will go boom. https://github.com/earlephilhower/arduino-littlefs-upload/blob/24e2afdc60c22614c0261cf2a5f15809876dfd7b/src/extension.ts#L257-L261

earlephilhower commented 3 hours ago

And your example is even worse, it's skipping offsets.

Partitions with blank offsets in the CSV file will start after the previous partition, or after the partition table in the case of the first partition.

So you need an actual stateful FSM to parse and process the CSV. Joy! :sob: