Repository navigation
PocketMage_SDK and ELF apps - #330
Merged
Merged
Conversation
Add the SDK as a gitlink at 45d6671 so clones fetch it via .gitmodules. Fresh checkouts no longer depend on an embedded lib copy.
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.
Description
Moves the PocketMage library out of the OS tree into its own SDK (
PocketMage_SDK) and replaces the OTA-app model with ELF apps. Apps are built against the SDK and loaded in-process from the SD card. Installing or running one doesn't need a reflash or a reboot.SDK split
lib/PocketMageis gone. The SDK now lives inTalismanDesign/PocketMage_SDKand is pulled in as a submodule atCode/PocketMageOS/lib/PocketMage_SDK.vspi/hspi/global_fs/prefs, settings,AppState/KBState,getBatteryVoltage) is now owned by the SDK.include/config.his removed andglobals.hpulls everything from the SDK header.OTA_APP/OTA_APP_FLAGswitch is replaced byPM_TARGET_HOST(the OS) andPM_TARGET_APP(an app). The oldOTA_APP:tags in the codebase are renamed to match.pocketmage_i18n/tools/gen_i18n.py). Catalogs merge in order: SDK base first, then the OS's ownsrc/i18n.ELF apps (
elf_runner.cpp,elf_app_manifest.cpp).app.elfpacked in a.tarwith a<name>_ICON.binand an optional.elfooverlay. The app loader installs it into one of 4 slots (/apps/slot1–/apps/slot4), tracked in NVS asELFINFO1–ELFINFO4.runElfApp()relocates the image withesp_elf_relocate_source()through a file-backedelf_source_t, so the whole.app.elfis never held in RAM. The app'smainruns in its own task, and the OS loop and E-Ink task stand down whileCurrentAppState == ELFAPP.returnfrommain. The image is unloaded and the OS goes back to HOME without rebooting..elfo, it's loaded throughelf_overlay, and the entry point is redirected through its stub block.app.propertiesfile setsname,version,authorandscope.scopelimits whichpm_*symbols the app can resolve. libc, libstdc++ and ESP-IDF stay reachable no matter the scope. A missing or unreadable manifest falls back to the ELF base name and doesn't block the app.src/ELF_SYMS/esp_all_symbol.cpp), includingpocketmage_sdk_version.OTAINFO*/OTA*NVS keys are cleared when a slot is cleared, so old bin-era installs disappear on upgrade.Submodules (
.gitmodules)lib/PocketMage_SDK→TalismanDesign/PocketMage_SDKlib/elf_loader/esp-iot-solution→TalismanDesign/esp-iot-solution, pinned topocketmage-pin-1.3.3(this carries the elf_loader streaming source API)lib/elf_overlay→TalismanDesign/elf_overlayCI
OTA_APPbuild env and its tar packaging step.example-appjob: installs the SDK and the Xtensa toolchain (pinned and checksummed), builds theelf_overlayhost tools, then builds and packs the SDK template app and runspm checkon it. It also checks that the ELF is little-endian and that the tar has the.app.elf,.elfoand icon.i18n-checknow regenerates from the stored catalogs and checks that the app catalog actually merged into the SDK tables.app0frompartitions.csvinstead ofpartitions_4APP.csv.submodules: recursive.Docs
Docs/docs/guides/elf-apps.mdcovering building, packaging, installing, and what an app can rely on.CONTRIBUTING.mdno longer mentionspio run -e OTA_APPand points to the ELF apps guide.Breaking changes
app.binin a tar) are no longer supported. Existing installs need to be rebuilt against the SDK as.app.elf.git submodule update --init --recursive. Nothing builds without the SDK.config.hor the oldlib/PocketMageheaders directly needs to go through the SDK now.Testing
55.03.311)app.propertiesrejects out-of-scopepm_*symbols: TODOAll 9 CI checks pass (firmware builds for both envs, example-app, i18n-check, docs-build, CodeQL).