Skip to content

Upload files over the console (YMODEM) - #123

Merged
JohnAmadis merged 1 commit into
masterfrom
feature/ymodem-upload
Oct 11, 2026
Merged

JohnAmadis merged 1 commit into
masterfrom
feature/ymodem-upload

Conversation

@JaxCalder

Copy link
Copy Markdown
Contributor

What

Uploads files the firmware does not hold (views, configurations, anything for the SD card) to the device over its UART console, using dmell's ymodem command (choco-technologies/dmell#60).

  • scripts/ymodem_send.py types ymodem recv -d DEST into the console, waits for the receiver's C and sends a YMODEM batch with 1024-byte blocks (--block 128 is also possible) and CRC-16.
    • A directory is sent with everything in it, and names keep their paths under DEST. SRC=NAME sends SRC as NAME.
    • Dotfiles are skipped.
    • It uses only the standard library (termios), so no pyserial is needed.
    • --wait SECONDS retries the command until a device that is still starting answers.
  • Targets:
    • upload-files sends DMBOOT_UPLOAD_SOURCES (default build/sdcard) to the running device.
    • install-all runs install-firmware, then uploads the files once the device has started.
    • Port, baud rate, destination, block size and wait time are cache variables (see the README).

Tested on STM32F746G-DISCO

8 × 300 KB to /mnt/dmsdio0_0p1: no block sent again, ~31 KiB/s. With every 7th packet deliberately broken (lost bytes, bad CRC, half a packet), every file still arrived complete.

Needs on the device: choco-technologies/dmell#60 (ymodem), choco-technologies/dmuart#8 (RX by DMA, a 4 KiB ring) and choco-technologies/dm_sw_ring#8.

🤖 Generated with Claude Code

scripts/ymodem_send.py sends files to the device over its UART console:
it types dmell's `ymodem recv -d DEST`, waits for the receiver and sends
a YMODEM batch (1024 / 128-byte blocks, CRC-16) - directories with
everything in them, names kept under DEST. Only the standard library.

The upload-files target sends DMBOOT_UPLOAD_SOURCES (build/sdcard by
default) to the running device, install-all flashes first and waits for
it to start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JohnAmadis
JohnAmadis self-requested a review October 11, 2026 08:44
@JohnAmadis
JohnAmadis merged commit 42bab22 into master Oct 11, 2026
5 checks 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.

2 participants