Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 1.27 KB

File metadata and controls

33 lines (24 loc) · 1.27 KB

MakeFSData

A powerful Python script to generate fsdata.c for the LwIP HTTP server. It recursively processes a directory of web files (HTML, CSS, JS, images, etc.) and converts them into C source structures.

Features

  • Gzip Compression: Automatically compresses file content using gzip (level 9) for efficient storage on MCUs.
  • Recursive Processing: Handles subdirectories (e.g., css/, js/, img/) automatically.

Usage

Run the script by providing the source directory and the desired output path:

python makeFSdata.py --fs-dir "path/to/web_files" --out "path/to/output/dir"

Options

Flag Description Default
--fs-dir Required. Directory containing your web files. -
--out Required. Directory where fsdata.c will be created. -
--line-size Number of hex bytes per line in the C arrays. 16
--no-gzip Disable gzip compression (embed raw file bytes). False

Example

To generate data for the included test folder:

python makeFSdata.py --fs-dir "test_fs" --out "."

Reference

You can check the STM32H7_WebServer project for a complete example of how to integrate these generated files into an MCU-hosted web server.