Skip to content

Upload to the SD card the device has, not to /mnt/dmsdio0_0p1 - #127

Merged
JohnAmadis merged 3 commits into
masterfrom
feature/upload-finds-the-card
Oct 12, 2026
Merged

JohnAmadis merged 3 commits into
masterfrom
feature/upload-finds-the-card

Conversation

@JaxCalder

@JaxCalder JaxCalder commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

upload-files / install-all sent the files to /mnt/dmsdio0_0p1, which is where automount mounts a card without a label. A card with a label is mounted at /mnt/<label>, for example /mnt/bootfs on another board, so the files never reached it.

Now scripts/ymodem_send.py finds the card:

  • A relative or empty --dest is on the SD card. The script types ls /mnt into the console and uses the one card mounted there. It then types ymodem recv -d /mnt/<card>/<dest>.
  • --card NAME picks one of several cards. --card none keeps the old meaning: under the shell's current directory.
  • With --wait (as install-all uses it after the flash), it asks again until automount has mounted the card.
  • With several cards, or none, it stops and lists what it found.
  • An absolute --dest is used as before.

In CMake, DMBOOT_UPLOAD_DEST is now empty by default (the card's root), and the new DMBOOT_UPLOAD_CARD (default auto) names the card. The README documents both.

Also: upload-files and install-all now depend on download_sdcard_modules. build/sdcard was made only by all, so after building just the firmware (--target install-firmware / dmboot.elf) there was nothing to send, and install-all failed after it had already flashed the board.

Also: when the device reports files it did not write (they were in use, e.g. the MP3 being played; see choco-technologies/dmell#63), the script lists them, suggests stopping what uses them, and exits with an error:

ymodem_send: some files were not written - in use on the device? Stop what uses them (e.g. `service stop carhmi`) and send them again: Alexander.mp3

Note on existing build directories: they keep the cached DMBOOT_UPLOAD_DEST=/mnt/dmsdio0_0p1. Reconfigure with -DDMBOOT_UPLOAD_DEST= to get the detection.

Test plan

  • STM32F746G-DISCO (card at /mnt/dmsdio0_0p1): --dest yt goes to /mnt/dmsdio0_0p1/yt. --card bootfs stops with no card bootfs in /mnt (found: dmsdio0_0p1). An absolute --dest works as before.
  • Reset, then --wait 90: the script waits for the card (about 15 s) and sends the file
  • A fresh configure: upload-files and install-all depend on download_sdcard_modules, which makes build/sdcard (carhmi_view)
  • The MP3 being played plus a small file (with dmell#63): the small file is written, the MP3 is listed, exit 1
  • Parsing the ls output: an echo running into the output, the coloured prompt, a missing /mnt, several cards, boot noise and the CANs of a failed transfer left on the shell's line (only what follows the echo counts, and only printable names)
  • Reset, then the whole build/sdcard (46 files) with --wait 90: through, twice. With libdmview_open: read the view whole, close it, then make the view dmview#20 the board's view no longer blocks carhmi.dmv.

🤖 Generated with Claude Code

The files went to /mnt/dmsdio0_0p1 - where automount mounts a card
without a label. A card with one is mounted at /mnt/<label> (e.g.
/mnt/bootfs on another board), and the files went nowhere useful.

ymodem_send.py finds the card: a --dest that is not absolute is on it -
the script types `ls /mnt` and takes the one card there (--card NAME
picks one of several, --card none keeps the shell's current directory);
with --wait it asks again until the card is mounted after a start. An
absolute --dest is used as before. DMBOOT_UPLOAD_DEST is empty by default
(the card's root), DMBOOT_UPLOAD_CARD names a card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JohnAmadis and others added 2 commits October 12, 2026 14:29
build/sdcard is made by download_sdcard_modules, a target of `all` only:
after a build of the firmware alone (install-firmware, dmboot.elf) there
was none, and the upload failed - after install-all had flashed the board.
Both targets depend on it now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Right after a start - before the card is mounted - what came back for
`ls /mnt` was what the console had then (bytes of the boot), and it was
taken for a card: the files were sent to /mnt/<noise>, which no receiver
answered. A failed transfer's CANs, left on the shell's line, were one
too. What follows the command's echo is read only, and names of printable
characters are kept.

Co-Authored-By: Claude Opus 5.5 <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.

2 participants