Skip to content

docs(mch2022): explain why a Hatchery app's binary must be main.bin - #255

Merged
annejan merged 1 commit into
masterfrom
mch2022-main-bin
Aug 14, 2026
Merged

docs(mch2022): explain why a Hatchery app's binary must be main.bin#255
annejan merged 1 commit into
masterfrom
mch2022-main-bin

Conversation

@annejan

@annejan annejan commented Aug 14, 2026

Copy link
Copy Markdown
Member

Closes #95.

The issue asked whether an AppFS app really has to be called main.bin, and
noted that "if that turns out to be true it should be documented". It is true,
but not for the reason the issue guessed.

The answer

AppFS does not care about file names. It stores apps under a slug, and
keeps the file name only as a title.

The badge firmware does care. Installing an ESP32 app from the Hatchery
walks the app's file list and writes exactly one file into AppFS: the one whose
name equals the esp32_bin_fn constant, "main.bin". Every other file is
downloaded into the app's folder as a data file. The comparison is a plain
strcmp in
main/app_management.c
and
main/menus/hatchery.c.
So an app whose binary is myapp.bin installs without an error and then has
nothing to run — which matches the IRC report in the issue.

FPGA apps work the same way: the launcher opens bitstream.bin in the app
folder and looks nowhere else
(main/menus/launcher.c).

Pushing over USB is unaffected. app_push.py <file> <name> <title> <version> takes the AppFS name as an argument, so the local file name is
irrelevant and an update matches on the name, not the file. No change is needed
in the tools or the Hatchery, which is the other half of what the issue asked.

The change

A "Why it has to be called main.bin" subsection on the Hatchery page, with
the above, the app_push.py example, and links to the three source files. The
FPGA paragraph gets the same one-line reason.

hugo --gc --minify clean; all three source links return 200.

🤖 Generated with Claude Code

https://claude.ai/code/session_0142DuVFXpWnjeQhZzT3N3nC

Closes #95.

The page said to rename the binary to main.bin without saying why, which
left people guessing whether AppFS cares about file names. It does not.

The badge firmware does. Installing an ESP32 app from the Hatchery walks
the app's file list and writes exactly one file into AppFS: the one whose
name matches the esp32_bin_fn constant, "main.bin". Everything else lands
in the app folder as a data file, so an app whose binary is called
myapp.bin installs cleanly and then has nothing to run. The same holds for
FPGA apps, where the launcher opens bitstream.bin and looks nowhere else.

AppFS keys apps by slug and keeps the file name only as a title, so a push
over USB is free to use any file name: app_push.py takes the name as an
argument, and an update matches on that name. The page now says all of
this and links the three source files it comes from.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0142DuVFXpWnjeQhZzT3N3nC
@annejan
annejan merged commit 8e9a804 into master Aug 14, 2026
1 check passed
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.

appfs: requirements for filenames of *.bin ...

1 participant