Flashing firmware with filesystem

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
Espin
Posts: 1
Joined: Sun Feb 26, 2017 7:46 pm

Flashing firmware with filesystem

Post by Espin » Sun Feb 26, 2017 7:50 pm

Hi I'm new and just managed to compile a tweaked firmware for the ESP8266.

I want to add certain files into the filesystem by default and have this flashed at the same time as the firmware.

Is there a way to add such a filesystem so that it is flashed with the firmware, or what is the best way to do this without having to have a second step of uploading files? Thanks.

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Flashing firmware with filesystem

Post by deshipu » Mon Feb 27, 2017 1:16 am

I think the easiest, even though a bit hacky, way is to simply flash your firmware, upload the files you need, and then dump the whole flash back with esptool.py.

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: Flashing firmware with filesystem

Post by SpotlightKid » Mon Feb 27, 2017 3:19 pm

The contents of the files that are created when the filesystem is initialized are directly included in the source as char arrays. I did a PR once for stmhal to create those arrays from actual files in the source tree, but there were some doubts about merging it and I never persued the issue.

https://github.com/micropython/micropython/pull/1891

Maybe you can use that as a starting point.

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: Flashing firmware with filesystem

Post by mcauser » Mon Feb 27, 2017 11:47 pm

It would be nice if there was a /flash folder in /esp8266 which, on make, would append each file to the flash filesystem.

Then we would have 3 methods for deploying scripts, /scripts, /modules and /flash.

Post Reply