Integrate filesystem into image

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
carsten
Posts: 15
Joined: Wed Aug 16, 2017 3:08 pm

Integrate filesystem into image

Post by carsten » Thu May 03, 2018 3:19 pm

Hi,

is there an easy way to integrate files into the image (apart from frozen modules)? E.g. supplying my own filesystem image.


Thanks,
Carsten

loboris
Posts: 344
Joined: Fri Oct 02, 2015 6:19 pm

Re: Integrate filesystem into image

Post by loboris » Thu May 03, 2018 6:52 pm

In this MicroPython port you can prepare file system image and flash it to your board.

carsten
Posts: 15
Joined: Wed Aug 16, 2017 3:08 pm

Re: Integrate filesystem into image

Post by carsten » Thu May 03, 2018 10:07 pm

loboris wrote:
Thu May 03, 2018 6:52 pm
In this MicroPython port you can prepare file system image and flash it to your board.
Thanks!

Edit:
So. I ended up using my own fat image (macOS: brew install dosfstools, most likely included in most Linux distributions):

Code: Select all

$ dd if=/dev/zero of=test.img bs=1m count=2
$ mkfs.fat -S 4096 -f 1 -s 1 test.img
mount the image, copy files...
$ esptool.py (...) write_flash 0x200000 test.img
The offset is hardcoded in modesp.c, esp.user_flash_start().

User avatar
murilopolese
Posts: 3
Joined: Tue Apr 03, 2018 12:06 pm

Re: Integrate filesystem into image

Post by murilopolese » Fri Nov 16, 2018 8:38 pm

Code: Select all

$ dd if=/dev/zero of=test.img bs=1m count=2
$ mkfs.fat -S 4096 -f 1 -s 1 test.img
mount the image, copy files...
$ esptool.py (...) write_flash 0x200000 test.img
The offset is hardcoded in modesp.c, esp.user_flash_start().
Thank you! This worked like a charm!
Do you know how can I merge this generated image into a single '.bin'?
Ideally I'd like to merge this partition into one of the official MicroPython images.

I tried to use the esptool for that but no luck: https://github.com/espressif/esptool/issues/254

Post Reply