Bookmarks
Tag cloud
Picture wall
Daily
RSS Feed
  • RSS Feed
  • Daily Feed
  • Weekly Feed
  • Monthly Feed
Filters

Links per page

  • 20 links
  • 50 links
  • 100 links

Filters

Untagged links
bixb922/freezeFS https://github.com/bixb922/freezeFS
Fri 22 Sep 2023 12:14:27 PM PDT archive.org

freezeFS.py is a utility program that runs on a PC and converts an arbitrary folder, subfolder and file structure into a Python source file. The generated Python file can then be frozen as bytecode into a MicroPython image together with the Virtual File System driver vfsfrozen.py.

When the generated Python file is imported, the file structure is mounted with os.mount() as a read only Virtual File System, which can be accessed on the microcontroller with regular file operations such as open in "r" or "rb" mode, read, readinto, readline, seek, tell, close, listdir, ilistidr, stat.

If the deploy option is used, the files and folders of the frozen files are copied to the standard flash file system. This enables installing configuration and data files when booting the MicroPython image the first time.

An important topic is that opening files in "r" mode requires to buffer the file in RAM. However, many libraries such as web servers and json support reading text modes in "rb" mode, and no overhead is incurred.

micropython python modules filesystems embedded firmware files packaging
6420 links, including 414 private
Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Theme by kalvn