Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ sudo cp packaging/linux/70-benchpod.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger
```

It sets `ENV{ID_MM_DEVICE_IGNORE}="1"` for the pod's USB IDs: `1209:0001` (firmware
3.9.0 and later) and `0483:5740` (older firmware), and `TAG+="uaccess"`, which lets the
It sets `ENV{ID_MM_DEVICE_IGNORE}="1"` for the pod's USB IDs: `0483:5740` (ST's stock CDC
ID, every STM32 firmware including 3.9.0; it also matches other ST CDC devices) and
`1209:0001` (pre-release 3.9.0 builds), and `TAG+="uaccess"`, which lets the
user signed in at the desktop open the console without joining the `dialout` group. Over
SSH, or without the rule, add yourself to `dialout` (`sudo usermod -aG dialout $USER`,
then log in again). On firmware 3.9.0 and later the network commands need neither: over
Expand Down Expand Up @@ -152,6 +153,12 @@ The USB network adapter works with the in-box drivers of macOS, Linux and Window
(tested). Windows 10 (1903 or newer) is supported but not tested: if the adapter shows
up without a driver there, open Device Manager, update its driver, and pick "UsbNcm
Host Device" from the list of network adapters.
The pod keeps ST's USB ID `0483:5740`: on a Windows computer with ST's Virtual COM Port
driver installed, that driver can claim the whole pod, which then shows up as one COM
port without the network adapter. Uninstall it for the pod (Device Manager, Ports,
"STMicroelectronics Virtual COM Port", Uninstall device, tick "Attempt to remove the
driver", then replug the pod); the steps are in the firmware's
[USB serial interface](https://github.com/embeddedci-com/benchpod-firmware/blob/main/docs/usb-serial-interface.md) docs.
WSL2 and Docker on Windows are not tested: Windows routes the pod's `10.237.x.y` address
itself, so a WSL2 distribution or a container on the host network should reach it with
`--connection <that address>`, but USB auto-detect and mDNS may not work from inside them.
Expand Down
10 changes: 5 additions & 5 deletions cmd/benchpod-cli/flash_self.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ func enterDfuViaConsole(g *globalFlags) error {
if err != nil {
return fmt.Errorf("enter-dfu: open USB console: %w", err)
}
// The USB serial number finds this pod again after the update, under its new USB ID.
// The USB serial number finds this pod again after the update, whatever its port is called then.
flashedPodSerial = serialconsole.PortSerialNumber(path)
defer cancel()
defer console.Close()
Expand Down Expand Up @@ -497,14 +497,14 @@ var flashedPodSerial string
// Seams for tests: how long installBlobsAfterFlash waits for the flashed pod's USB console,
// how often it tries, and how it opens it.
var (
// Generous: from 3.8.x to 3.9.0 the pod comes back under a new USB ID, and Windows installs
// drivers and assigns a new COM port before the console appears.
// Generous: from 3.8.x to 3.9.0 the pod comes back as a composite device (console + network
// adapter), and Windows installs drivers and may assign a new COM port before the console appears.
flashedConsoleWait = 150 * time.Second
flashedConsoleRetry = time.Second
openFlashedConsole = func(g *globalFlags) (*serialconsole.Console, error) {
device := g.serialDevice()
if flashedPodSerial != "" {
// The same pod, whatever its port is called now (0483:5740 -> 1209:xxxx renames it).
// The same pod, whatever its port is called now (a new COM port on Windows, for one).
device = serialconsole.FindPodPortBySerial(flashedPodSerial)
if device == "" {
return nil, fmt.Errorf("the pod (USB serial number %s) is not back on USB yet", flashedPodSerial)
Expand All @@ -523,7 +523,7 @@ var (
// versions as it came back and the blobs it installed (for the firmware report).
func installBlobsAfterFlash(g *globalFlags, src blobSource) (after podVersions, installed []blobEntry, err error) {
fmt.Fprintln(os.Stderr, "flash-self: waiting for the pod's USB console to install its blobs (after an update to 3.9.0 "+
"it comes back under a new USB ID: Windows gives it a new COM port and may install drivers first)...")
"Windows may install drivers for its new network adapter and give it a new COM port first)...")
var console *serialconsole.Console
deadline := time.Now().Add(flashedConsoleWait)
for {
Expand Down
4 changes: 2 additions & 2 deletions internal/serialconsole/portsn.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
)

// The pod's USB serial number (12 hex digits from the MCU's unique ID) is the same on every
// firmware, while its USB ID is not (0483:5740 up to 3.8, 1209:xxxx from 3.9.0) and the console's
// port name may change with it (a new COM port number on Windows). After a firmware update the
// firmware, while the console's port name may change (a new COM port number on Windows when 3.9.0
// adds the network adapter; pre-release 3.9.0 builds also had another USB ID, 1209:0001). After a firmware update the
// serial number is how the same pod is found again.

// PortSerialNumber is the USB serial number of the port at path ("" when the enumerator does not
Expand Down
5 changes: 3 additions & 2 deletions internal/serialconsole/serialconsole.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ import (
// 2E8A — Raspberry Pi, the RP2350 pod's native USB port.
// 0483 — STMicroelectronics, the STM32H563 pod up to firmware 3.8 (ST's
// stock CDC VID/PID 0483:5740, so the host binds its in-box CDC driver).
// 1209 — pid.codes, the STM32H563 pod from firmware 3.9.0 (1209:0001): a
// composite device with the console and a USB network adapter.
// 1209 — pid.codes, pre-release builds of firmware 3.9.0 (test ID 1209:0001). Released
// 3.9.0 keeps 0483:5740 (a composite device with the console and a USB network
// adapter); the pod's own pid.codes ID 1209:EC10 is for a later release.
//
// None of the IDs is exclusive to a bench pod — 2E8A is shared with the CMSIS-DAP
// probe's CDC, 0483:5740 with every ST Virtual COM Port on the bench and 1209
Expand Down
6 changes: 3 additions & 3 deletions packaging/linux/70-benchpod.rules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# BenchPod: keep ModemManager off the pod's USB console, and let the signed-in desktop user open it
# (uaccess) without joining the dialout group.
# Install: sudo cp 70-benchpod.rules /etc/udev/rules.d/ && sudo udevadm control --reload-rules && sudo udevadm trigger
# Firmware 3.9.0 and later (pid.codes VID 1209; PID 0001 is the test ID until ours is assigned).
ATTRS{idVendor}=="1209", ATTRS{idProduct}=="0001", ENV{ID_MM_DEVICE_IGNORE}="1", TAG+="uaccess"
# Older firmware (ST's stock CDC ID).
# Every STM32 firmware, 3.9.0 included: ST's stock CDC ID.
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", ENV{ID_MM_DEVICE_IGNORE}="1", TAG+="uaccess"
# Pre-release 3.9.0 builds (pid.codes test ID).
ATTRS{idVendor}=="1209", ATTRS{idProduct}=="0001", ENV{ID_MM_DEVICE_IGNORE}="1", TAG+="uaccess"
Loading