Skip to content

Conversation

@fouge
Copy link
Collaborator

@fouge fouge commented Nov 28, 2025

⚠️ this PR is only compatible with the debug board and breaks compatibility with a generic FTDI dongle

configure ftdi by writing into eeprom on debug board v1.1
this allows setting a serial number for debug board identification

Refactored FTDI serial terminology - Clear distinction between:

  • --usb-serial (physical USB device, e.g., FT7ABC12)
  • --ftdi-serial (channel-specific, e.g., FT7ABC12C)
  • --desc (e.g., FT4232H C)
    Added FtdiChannel enum with FromStr impl for parsing A/B/C/D
    Updated commands (button-ctrl, reboot, ftdi read/write) to use the new
    terminology
    Added ftdi list command to enumerate all FTDI devices/channels
    Fixed serial comparison in destroy_helper() to strip channel suffix
    when comparing with USB serial

configure ftdi by writing into eeprom on debug board v1.1
this allows setting a serial number for debug board identification
@fouge fouge requested a review from a team as a code owner November 28, 2025 14:02
@fouge fouge changed the title Fouge/orb hil ftdi eeprom feat(hil): ftdi: list devices & read/write eeprom to set serial & config Nov 28, 2025
@fouge fouge requested a review from Copilot November 28, 2025 14:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors FTDI device management to support multiple debug boards and adds EEPROM configuration capabilities for the FT4232H chip on debug board v1.1. The key changes introduce clearer terminology distinguishing USB serial numbers from FTDI channel-specific serials, and add new commands for device enumeration and EEPROM programming.

  • Refactored FTDI serial terminology with clear distinction between USB serial (physical device), FTDI serial (channel-specific), and description
  • Added ftdi list/read/write commands for device enumeration and EEPROM operations
  • Updated button control and reboot commands to support the new device selection options

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
hil/src/main.rs Added FtdiCmd to the command enum to expose new FTDI operations
hil/src/ftdi.rs Added FtdiChannel enum, refactored FtdiId (SerialNumber→FtdiSerial), added detach_all_ftdi_kernel_drivers() helper, updated pin constants (RTS_PIN→DTR_PIN), improved destroy_helper serial comparison logic
hil/src/commands/ftdi.rs New file implementing list, read, and write subcommands for FTDI device management and EEPROM operations
hil/src/commands/reboot.rs Updated to use new FTDI terminology with --usb-serial, --ftdi-serial, --desc, and --channel options
hil/src/commands/button_ctrl.rs Updated to use new FTDI terminology and added fallback logic for device selection
hil/src/commands/mod.rs Exported new FtdiCmd module
hil/src/boot.rs Updated pin constants (BUTTON_PIN→DTR_PIN, RECOVERY_PIN→CTS_PIN), added DEFAULT_CHANNEL constant, improved fallback logic
hil/README.md Added documentation for FTDI EEPROM configuration workflow with examples
hil/Cargo.toml Added serde dependency with derive feature for EEPROM data serialization
Cargo.lock Updated with serde dependency for hil crate

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fouge fouge changed the title feat(hil): ftdi: list devices & read/write eeprom to set serial & config feat(hil): ftdi: list & read/write eeprom to set config Nov 28, 2025
@fouge fouge force-pushed the fouge/orb-hil-ftdi-eeprom branch from 92210c4 to c767ec7 Compare November 28, 2025 14:12
Refactored FTDI serial terminology - Clear distinction between:
- `--usb-serial` (physical USB device, e.g., FT7ABC12)
- `--ftdi-serial` (channel-specific, e.g., FT7ABC12C)
- `--desc` (e.g., FT4232H C)
Added FtdiChannel enum with FromStr impl for parsing A/B/C/D
Updated commands (button-ctrl, reboot, ftdi read/write) to use the new
terminology
Added `ftdi list` command to enumerate all FTDI devices/channels
Fixed serial comparison in destroy_helper() to strip channel suffix
when comparing with USB serial
@fouge fouge force-pushed the fouge/orb-hil-ftdi-eeprom branch from c767ec7 to 5c074b8 Compare November 28, 2025 14:12
fouge added 2 commits December 1, 2025 14:52
take into account pr review from copilot + other small improvements
all the related code is about the debug board with a hardcoded ftdi
chip, so not generic enough to be called ftdi and work with all or most
ftdi chips
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

take into account pr review from copilot + other small improvements
@fouge fouge changed the title feat(hil): ftdi: list & read/write eeprom to set config feat(hil): debug-board: list & read/write eeprom to set config Dec 1, 2025
group channels by debug board (& usb serial) when multiple debug boards
are connected
@fouge fouge force-pushed the fouge/orb-hil-ftdi-eeprom branch from cb940a4 to 9dd403e Compare December 2, 2025 10:21
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