Skip to content

Serial push: split flash firmware/overwrite, opt-in --overwrite in flasher - #441

Open
konsumer wants to merge 2 commits into
bmorcelli:mainfrom
konsumer:serial-push-reuse-slot
Open

konsumer wants to merge 2 commits into
bmorcelli:mainfrom
konsumer:serial-push-reuse-slot

Conversation

@konsumer

@konsumer konsumer commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Serial flash firmware now overwrites the previous slot for the same app name and fails with an ERR instead of opening the on-device menu, plus a PlatformIO extra script so pio run -t upload pushes into Launcher.

This helps facilitate pio-workflow for firmware-dev, since you can automate pushing current firmware, without wiping Launcher. We both had similar usecase in #184

- serial_console: keep "flash firmware <name> <size>" on the original
  launcherSelectInstallLayout path; add "flash overwrite <name> <size>"
  which reuses the slot a name already owns (grow/move it) instead of
  prompting, so a host on the other end of a serial link never hangs.
  Both share one streaming body; no extra flash cost beyond the branch.
- serial_flasher.py: opt-in --overwrite (sends "flash overwrite" and uses
  windowed ACK streaming). Default stays byte-for-byte the main behavior
  ("flash firmware" + one-chunk-per-ack). Also survive USB-CDC
  re-enumeration on reset.
- remove tools/pio_launcher_upload.py: serial_flasher covers the push.

Verified on Cardputer ADV: --overwrite creates a slot then reuses it on
re-push (single alpha0); default reproduces main's behavior.
@konsumer

konsumer commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor Author

As per conversation with @bmorcelli on discord, I added a bit more to PR to make flash overwrite <slot name> <size> work, to maintain backward-compatability with existing firmware upload (new command) and reuse existing python script.

size-wise, on cardputerADV, main: 1362720 → this: 1363120 = +400 B

the first commit was 192 B less.

Not nothing, but still within limits. I think we could shave off other things, like offloading USB stuff to a separate firmware, and it would give us a lot more room. For comparison, here are numbers I got on CarputerADV:

MSC on  (baseline) : 1363120 B   test partition 99.0% used   12.8 KB free
MSC off (-DDISABLE_MASS_STORAGE) : 1306592 B   94.9% used   68.0 KB free
saved  : 56528 B (55.2 KB) = 4.1% of the app

@konsumer konsumer changed the title Serial push reuses slot, PIO upload script Serial push: split flash firmware/overwrite, opt-in --overwrite in flasher Oct 2, 2026

This branch has not been deployed

No deployments
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