Skip to content

No fs format nor file recreation and boot reason changes (updated for main) - #929

Open
tyeth wants to merge 18 commits into
mainfrom
update-656-merge-main
Open

No fs format nor file recreation and boot reason changes (updated for main)#929
tyeth wants to merge 18 commits into
mainfrom
update-656-merge-main

Conversation

@tyeth

@tyeth tyeth commented Jun 12, 2026

Copy link
Copy Markdown
Member

Updated/rebased-onto-main continuation of #656 by @tyeth.

This brings the work in #656 up to date with the current main branch (which has since merged the display-v2 refactor, the bootlog-version disambiguation, the espressif32 platform bump, and many new sensor drivers) and resolves the merge conflicts.

Original PR description (#656)

This resolves a couple of things.
Firstly we now reattach USB Mass Storage Device after recreating the filesystem, this means that the drive now shows up on first boot after an initial firmware installation (tested with erased device). Previously the first boot would not show a drive, but subsequent boots would.

Secondly, in relation to brown-out situations, we now avoid erasing files unnecessarily, and if we last reset due to brownout we do not attempt to write any files like boot log nor erase the circuitpython files. There turns out to be little reason to write to the filesystem every boot. Mostly a load of .exists guards to avoid unnecessary erases, and checking the boot reason for some operations.

There's a minor tweak to the print_reset_reason method as it was being used incorrectly. It was being passed CPU core number instead of passing in the result of rtc_get_reset_reason(cpuCore).
Finally the pico now has a boot reason adding in the latest Earle core, so included that too.

Conflict resolution notes

  • platformio.ini — took main's newer espressif32 platform (55.03.33).
  • Wippersnapper_FS::Wippersnapper_FS() — kept main's clang-format while preserving the PR's added delay(50) after the dependency dump.
  • initFilesystem() — kept the PR's brownout-aware init while folding in main's new TinyUSBDevice.attach() on the non-brownout error path (the brownout path deliberately avoids powering USB to save battery).
  • createBootFile() — kept the PR's build-then-compare / skip-if-unchanged design, and folded in main's "WipperSnapper Firmware Version" label and the new AirLift coprocessor firmware-version line.
  • createSecretsFile() — dropped the now-stale #ifdef USE_DISPLAY WS._ui_helper->show_scr_error() block. The display subsystem was rewritten on main (src/display removed, src/components/display added); USE_DISPLAY and WS._ui_helper no longer exist, so that block referenced removed APIs. Core behaviour (boot-out error, USB MSC re-init, fsHalt) is preserved.

Build verification

  • raspberypi_picow (RP2040, Earle core — exercises the new reset-reason path): full build SUCCESS (RAM 36.5%, Flash 54.6%).
  • adafruit_metro_esp32s2 (TinyUSB/QSPI path): all sources compiled cleanly; only the local esptool image-packaging step failed due to a known local toolchain limitation — CI will verify the full image.

Supersedes / continues #656.

🤖 Generated with Claude Code

tyeth and others added 16 commits November 20, 2024 00:31
Bring PR #656 up to date with main. Conflict resolutions:

- platformio.ini: take main's newer espressif32 platform (55.03.33).
- Wippersnapper_FS.cpp constructor: keep main's clang-format + the PR's
  added delay(50) after the dependency dump.
- initFilesystem(): keep the PR's brownout-aware init while folding in
  main's TinyUSBDevice.attach() on the non-brownout error path.
- createBootFile(): keep the PR's build-then-compare/skip-if-unchanged
  design, but adopt main's "WipperSnapper Firmware Version" label and the
  new AirLift coprocessor firmware-version line.
- createSecretsFile(): drop the stale #ifdef USE_DISPLAY show_scr_error()
  block. The display subsystem was rewritten on main (src/display removed,
  src/components/display added); USE_DISPLAY and WS._ui_helper no longer
  exist, so the block referenced removed APIs. Core behaviour (boot-out
  error, USB MSC re-init, fsHalt) is preserved.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
main now builds the espressif_esp32c5_devkitc_1_n8r4 target, which the
reset-reason include chain in print_reset_reason did not cover, tripping
the '#error Target CONFIG_IDF_TARGET is not supported' guard and leaving
rtc_get_reset_reason undeclared. Add the esp32c5/rom/rtc.h case.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bring #929 up to date with main, clearing the drift that regressed the
#926/#927 pixel-crash fix and the beta.130 version bump. Resolved in
main's favour for pixels/version while preserving #929's brownout and
reset-reason work.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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