docs(mch2022): explain why a Hatchery app's binary must be main.bin - #255
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #95.
The issue asked whether an AppFS app really has to be called
main.bin, andnoted 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_fnconstant,"main.bin". Every other file isdownloaded into the app's folder as a data file. The comparison is a plain
strcmpinmain/app_management.cand
main/menus/hatchery.c.So an app whose binary is
myapp.bininstalls without an error and then hasnothing to run — which matches the IRC report in the issue.
FPGA apps work the same way: the launcher opens
bitstream.binin the appfolder 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 isirrelevant 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, withthe above, the
app_push.pyexample, and links to the three source files. TheFPGA paragraph gets the same one-line reason.
hugo --gc --minifyclean; all three source links return 200.🤖 Generated with Claude Code
https://claude.ai/code/session_0142DuVFXpWnjeQhZzT3N3nC