@maxgerhardt Thank you for your plugin script. I’ve tried it on macOS & pio 5.0.4 (which embeds Python 3.9.1).
It doesn’t work due to the fact that subprocess.call
expects a list instead of string.
Here's an error
pio run -t downloadfs -v
[...]
command_download_fs(["downloadfs"], [])
Entrypoint
Retrieving filesystem info for ESP8266.
FS_START: 0x300000
FS_END: 0x3fa000
FS_PAGE: 0x100
FS_BLOCK: 0x2000
Recognized LittleFS filesystem.
Parsed FS info: FS type FSType.LITTLEFS Start 0x300000 Len 1024000 Page size 256 Block size 8192 Tool: /Users/max/.platformio/packages/tool-mklittlefs/mklittlefs
Executing flash download command.
"/usr/local/Cellar/platformio/5.0.4/libexec/bin/python" "/Users/max/.platformio/packages/tool-esptoolpy/esptool.py" --chip esp8266 --port "/dev/cu.SLAB_USBtoUART" --baud 115200 --before default_reset --after hard_reset read_flash 0x300000 0xfa000 "/Users/max/Documents/projects/foo/downloaded_fs_0x300000_0xfa000.bin"
scons: *** [downloadfs] "/usr/local/Cellar/platformio/5.0.4/libexec/bin/python" "/Users/max/.platformio/packages/tool-esptoolpy/esptool.py" --chip esp8266 --port "/dev/cu.SLAB_USBtoUART" --baud 115200 --before default_reset --after hard_reset read_flash 0x300000 0xfa000 "/Users/max/Documents/projects/foo/downloaded_fs_0x300000_0xfa000.bin": No such file or directory
I’ve fixed in in my fork (just for esp8266 & littlefs): Refactored from string to list · maxromanovsky/pio-esp32-esp8266-filesystem-downloader@c9d85ed · GitHub
However, even after that fix extraction fails
Read 1024000 bytes at 0x300000 in 92.4 seconds (88.7 kbit/s)...
Hard resetting via RTS pin...
Downloaded filesystem binary.
Download was okay: True. File at: /Users/max/Documents/projects/foo/downloaded_fs_0x300000_0xfa000.bin
Executing extraction command: ['/Users/max/.platformio/packages/tool-mklittlefs/mklittlefs', '-b', '8192', '-p', '256', '--unpack', 'unpacked_fs', '/Users/max/Documents/projects/foo/downloaded_fs_0x300000_0xfa000.bin']
Assertion failed: (block < lfs->cfg->block_count), function lfs_bd_read, file littlefs/lfs.c, line 84.
I’ve opened the file with hex editor and saw that there were leading bytes before magic string littlefs
: 01 00 00 00 F0 0F FF F7
. I’ve tried removing it, and mklittlefs
now fails with the other error:
lfs error:969: Corrupted dir pair at 0 1
Assertion failed: (block != 0xffffffff), function lfs_bd_read, file littlefs/lfs.c, line 41.
Anyway, I am able to see the contents of littlefs in the hex editor.
Thank you, and have a great New Year!