Skip to content

yahyayozo/MakeFSData

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

a python script to convert web files into C source files for LwIP HTTP server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors