Skip to content

Added warning for long names in DeckCtrl config gen - #17

Merged
evoggy merged 1 commit into
mainfrom
evoggy/deckctrl-name-warning
Sep 24, 2026
Merged

evoggy merged 1 commit into
mainfrom
evoggy/deckctrl-name-warning

Conversation

@evoggy

@evoggy evoggy commented Sep 24, 2026

Copy link
Copy Markdown
Member

util deck-ctrl bingen and binflash silently truncated the product name when
it didn't fit the deck info page, so a config could be flashed with a name
nobody intended.

The info page stores the name in a 15 byte field, of which the last byte is the
null terminator — 14 usable characters (see the "Deck Information Format" table
in the crazyflie-firmware deckctrl protocol docs). examples/deckctrl/cam.yaml
has WiFi camera deck (16 characters), and the deck on my desk reads back as
WiFi camera de.

Both commands now warn:

$ cfcli util deck-ctrl bingen examples/deckctrl/cam.yaml
Warning: name "WiFi camera deck" is too long and will be stored as "WiFi camera de" - the info page name field holds 14 characters plus a null terminator

The warning goes to stderr so it doesn't corrupt the hex dump bingen writes to
stdout, and binflash prints it before touching the probe. The limit itself is
unchanged and nothing is rejected — a configuration that was already flashed
still works.

stored_name() is now the single source of truth for the truncation, used by
both to_bytes() and the warning, so the message can't drift from what actually
gets written. It also cuts on a character boundary, where the old code could
split a multi-byte character and write invalid UTF-8 to the deck. Generated
bytes are unchanged for ASCII names.

Worth a follow-up: the deck-ctrl-firmware README describes this field as 14
bytes ending at 0x14 and omits the production date and checksum rows entirely,
so it disagrees with the protocol spec and looks stale.

@evoggy
evoggy merged commit 5d365a2 into main Sep 24, 2026
1 check 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.

1 participant