Skip to content

AP_HAL_ESP32: enable flash scripting on StampFly - #33996

Open
muramura wants to merge 3 commits into
ArduPilot:masterfrom
muramura:stampfly-flashfs-lua-upstream
Open

AP_HAL_ESP32: enable flash scripting on StampFly#33996
muramura wants to merge 3 commits into
ArduPilot:masterfrom
muramura:stampfly-flashfs-lua-upstream

Conversation

@muramura

@muramura muramura commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Enable ESP32 internal flash FAT filesystem support on M5StampFly and use it as the Lua scripting filesystem at /APM/scripts.

スクリーンショット 2026-08-08 21 23 46 スクリーンショット 2026-08-09 15 57 39

Classification & Testing (check all that apply and add your own)

  • Checked by a human programmer
  • Non-functional change
  • No-binary change
  • Infrastructure change (e.g. unit tests, helper scripts)
  • Automated test(s) verify changes (e.g. unit test, autotest)
  • Tested manually, description below (e.g. SITL)
  • Tested on hardware
  • Logs attached
  • Logs available on request

Built and tested on M5StampFly / esp32s3m5stampfly.

Build:

  • ./waf copter -j1
  • ardupilot.bin size: 0x1de720
  • App partition free space: 0x1218e0 bytes, 38%

Hardware test:

  • Flashed the generated firmware to M5StampFly.
  • Verified the ESP32 flash filesystem mounted at /APM.
  • Verified MAVFTP access to /APM/scripts.
  • Uploaded hello.lua.
  • Confirmed Lua execution through repeated GCS messages: AP: StampFly Lua OK.

Description

This PR enables Lua scripting on the ESP32-S3 based M5StampFly board by adding an internal flash FAT filesystem partition and mounting it through the existing ESP32 filesystem backend.

Changes include:

  • Add a 1MB FAT partition named apm to the ESP32-S3 partition table.
  • Mount the internal flash FAT filesystem at /APM.
  • Create /APM/scripts automatically during mount.
  • Enable AP_FILESYSTEM_ESP32_ENABLED and AP_SCRIPTING_ENABLED for esp32s3m5stampfly.
  • Set the StampFly scripting directory to /APM/scripts.
  • Enable SCR_ENABLE by default for StampFly.
  • Link the ESP-IDF wear_levelling component required by FAT-on-flash.
  • Allow Lua script loading to accept uppercase .LUA filenames returned by FAT directory listings.

@muramura
muramura force-pushed the stampfly-flashfs-lua-upstream branch from 44000b6 to f93df1c Compare August 9, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant