-
Notifications
You must be signed in to change notification settings - Fork 98
feat(hil): debug-board: list & read/write eeprom to set config #839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
configure ftdi by writing into eeprom on debug board v1.1 this allows setting a serial number for debug board identification
There was a problem hiding this 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/writecommands 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.
92210c4 to
c767ec7
Compare
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
c767ec7 to
5c074b8
Compare
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
1eca248 to
60b3311
Compare
There was a problem hiding this 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
group channels by debug board (& usb serial) when multiple debug boards are connected
cb940a4 to
9dd403e
Compare
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 listcommand to enumerate all FTDI devices/channelsFixed serial comparison in destroy_helper() to strip channel suffix
when comparing with USB serial