From 5c4a9c40d04c495b8016c17e80dec71488d7155a Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Wed, 18 Nov 2026 22:48:58 -0600 Subject: [PATCH 1/5] Digital board v3r4: la voltage 5V and pin 21; la pull help `la voltage` takes 5V (5.0, 5000): the pod with the digital board v3r4 keeps the bank at 3.3 V and moves J1 pin 21 (the pull-up rail) to 5 V; other pods refuse 5000 themselves, as before. On v3r4 the output shows pin 21 and warns when it is above its setting (a DUT signal lifting it: select 5V or remove the signal), low, or shorted. No mismatch warning for the 3.3 V bank in 5 V mode. `la pull` help says every pin pulls up or down on v3r4 with a strength the pod picks; the reply's strength shows it. Features table and error catalog synced from benchpod-firmware#178 (revision 7, BP0028, BP0029). Co-Authored-By: Claude Opus 5.5 --- README.md | 3 +- cmd/benchpod-cli/commands_tcp.go | 6 +++- cmd/benchpod-cli/lavoltage.go | 51 +++++++++++++++++++++++++++--- cmd/benchpod-cli/lavoltage_test.go | 41 +++++++++++++++++++++++- cmd/benchpod-cli/units.go | 11 ++++--- cmd/benchpod-cli/units_test.go | 5 +-- 6 files changed, 103 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index f877f65..625f7fd 100644 --- a/README.md +++ b/README.md @@ -337,12 +337,13 @@ benchpod status --json # the pod's raw status reply # Hardware (network): benchpod la voltage 3.3V # the DUT's I/O voltage for now (it normally comes from the wiring profile) +benchpod la voltage 5V # digital board v3r4: 5 V I/O (pin 21 goes to 5 V; also shows pin 21) benchpod generate --waveform sine --freq 1kHz --duration 2s # DAC waveform benchpod measure --waveform sine --samples 1024 # DAC + ADC loopback benchpod capture --samples 1024 --output csv # ADC snapshot benchpod stream ... benchpod test ... -benchpod la pull 3 up # LA pin pull resistor: up, down or off +benchpod la pull 3 up # LA pin pull resistor: up, down or off (digital v3r4: every pin, strength picked by the pod) benchpod la status benchpod la step --la 6 --steps 200 --delay 500us --dir-la 7 --direction 1 benchpod la pins # every LA pin: function, level, pull-up, direction, warnings diff --git a/cmd/benchpod-cli/commands_tcp.go b/cmd/benchpod-cli/commands_tcp.go index de3b153..869a79a 100644 --- a/cmd/benchpod-cli/commands_tcp.go +++ b/cmd/benchpod-cli/commands_tcp.go @@ -372,7 +372,11 @@ func newLAPullCmd(g *globalFlags) *cobra.Command { "and reports its value (ohms). Which pins have one and which way each can pull depends on the\n" + "board: today LA1-LA6 pull up, LA7/LA8 pull down and LA9-LA14 have none; the reply's dirs\n" + "lists them. Another direction is refused (BP0024), and up or down on a pin without a resistor\n" + - "(BP0023); off works on every pin. The resistors go to 3.3 V, so the LA bank must be at 3.3 V.", + "(BP0023); off works on every pin. The resistors go to the LA bank voltage.\n\n" + + "Digital board v3r4: every pin, LA1-LA14, pulls up or down with a 10k, a 2.2k or both (about\n" + + "1.8k). The pod picks the strength from the pin's function (2.2k for I2C, one-wire UART, open\n" + + "drain and outputs in 5 V mode, else 10k); the reply's strength says which. The pull-ups go to\n" + + "J1 pin 21, so they work at 1.8, 3.3 and 5 V; while pin 21 is down they are off (BP0029).", Example: " benchpod la pull 1 up\n benchpod la pull 7 down\n benchpod la pull 7 off", Args: cobra.ExactArgs(2), RunE: func(_ *cobra.Command, args []string) error { diff --git a/cmd/benchpod-cli/lavoltage.go b/cmd/benchpod-cli/lavoltage.go index 9b41fce..e59d8df 100644 --- a/cmd/benchpod-cli/lavoltage.go +++ b/cmd/benchpod-cli/lavoltage.go @@ -26,13 +26,18 @@ const laVoltageMissing = "this firmware has no LA voltage selection; update the func newLAVoltageCmd(g *globalFlags) *cobra.Command { return &cobra.Command{ Use: "voltage [VOLTAGE]", - Short: "Show or set the LA bank I/O voltage (1.8V or 3.3V, the DUT's logic level)", + Short: "Show or set the LA bank I/O voltage (1.8V or 3.3V, 5V on digital v3r4: the DUT's logic level)", Long: "Show or set the voltage of the pod's LA bank (LA1-LA14), which must match the\n" + "DUT's I/O voltage. The pod refuses LA capture, UART, SWD flash, pull-ups and\n" + "sensor emulation until it is set. 1.8V needs a v3 pod, and the pod refuses a\n" + "change while any LA pin is in use.\n\n" + - "VOLTAGE is 1.8V or 3.3V (also 1800mV, 3.3, or 3300). Omit it to show the\n" + - "current setting. Works over the network, over USB (--connection usb) and through\n" + + "VOLTAGE is 1.8V or 3.3V (also 1800mV, 3.3, or 3300).\n\n" + + "5V (5.0, 5000) works on a pod with the digital board v3r4: the bank stays at 3.3V and\n" + + "J1 pin 21, the rail the pull-ups pull to, goes to 5V. The pod reads 5V signals at full\n" + + "speed; its outputs reach 5V only through their pull-ups (benchpod la pull PIN up). The\n" + + "pod refuses with BP0028 when 5V did not come up, and other pods refuse 5000. On v3r4 the\n" + + "output also shows pin 21 and warns when it sits above its setting.\n\n" + + "Omit VOLTAGE to show the current setting. Works over the network, over USB (--connection usb) and through\n" + "embeddedci.com (--connection embeddedci:).\n\n" + "The pod forgets the voltage on a restart. Firmware 3.10.8 and later keeps wiring\n" + "profiles on the pod: the profile's I/O voltage is applied when the DUT powers on and\n" + @@ -80,6 +85,36 @@ var openLAVoltageConsole = func(g *globalFlags, device string, timeout time.Dura type laVoltageReply struct { MV int `json:"mv"` ReadbackMV int `json:"readback_mv"` + // VrefOut is J1 pin 21 on the digital board v3r4 (nil on other boards). + VrefOut *vrefOut `json:"vref_out,omitempty"` +} + +// vrefOut is pin 21 in the la_voltage reply (digital board v3r4). +type vrefOut struct { + Source string `json:"source"` // "bank" or "5v" + SetMV int `json:"set_mv"` + MV int `json:"mv"` // -1 without a reading + State string `json:"state"` + Up bool `json:"up"` +} + +// pin21Text is pin 21's line and, when it is not ok, a warning ("" when there is none). +func pin21Text(v *vrefOut) (line, warning string) { + measured := "no reading" + if v.MV >= 0 { + measured = formatMV(v.MV) + } + line = fmt.Sprintf("J1 pin 21 (pull-up rail): %s, set to %s (%s)", measured, formatMV(v.SetMV), v.State) + switch v.State { + case "high": + warning = "pin 21 is above its setting: a DUT signal above the I/O voltage lifts it through the pull " + + "resistors. Select 5V (benchpod la voltage 5.0) or remove the signal." + case "low": + warning = "pin 21 is below its setting: something on it draws too much current." + case "short": + warning = "pin 21 is shorted or held down: the pull resistors are off until it is back." + } + return line, warning } func runLAVoltage(g *globalFlags, mv int, out, warn io.Writer) error { @@ -96,9 +131,17 @@ func runLAVoltage(g *globalFlags, mv int, out, warn io.Writer) error { return nil } fmt.Fprintf(out, "LA voltage of %s%s %s\n", label, verb, formatMV(rep.MV)) - if rep.ReadbackMV != 0 && rep.ReadbackMV != rep.MV { + // In 5 V mode the bank stays at 3.3 V while the I/O voltage is 5 V. + if rep.ReadbackMV != 0 && rep.ReadbackMV != rep.MV && !(rep.MV == 5000 && rep.ReadbackMV == 3300) { fmt.Fprintf(warn, "Warning: the bank's power mux reports %s, not %s\n", formatMV(rep.ReadbackMV), formatMV(rep.MV)) } + if rep.VrefOut != nil { + line, w := pin21Text(rep.VrefOut) + fmt.Fprintln(out, line) + if w != "" { + fmt.Fprintln(warn, "Warning: "+w) + } + } if mv != 0 && podStoresWiring(g) { fmt.Fprintln(out, "Not saved: the pod uses the I/O voltage in its wiring profile after a restart (change it there with `benchpod wiring save`, or in the Pins pane).") return nil diff --git a/cmd/benchpod-cli/lavoltage_test.go b/cmd/benchpod-cli/lavoltage_test.go index c99cbf0..231ee91 100644 --- a/cmd/benchpod-cli/lavoltage_test.go +++ b/cmd/benchpod-cli/lavoltage_test.go @@ -166,7 +166,7 @@ func TestLAVoltageUSB(t *testing.T) { func TestLAVoltageArgIsAUsageError(t *testing.T) { t.Setenv("BENCHPOD_CONNECTION", "") - if code := run([]string{"la", "voltage", "5V", "--connection", "127.0.0.1:1"}); code != exitUsage { + if code := run([]string{"la", "voltage", "2.5V", "--connection", "127.0.0.1:1"}); code != exitUsage { t.Fatalf("exit %d", code) } } @@ -187,3 +187,42 @@ func TestLAVoltageSavesNothingWhenThePodStoresProfiles(t *testing.T) { t.Fatalf("saves %v out %q", *saves, out.String()) } } + +// Digital board v3r4: 5 V mode shows pin 21, does not warn that the bank (3.3 V) differs, and +// warns when pin 21 sits above its setting. Older boards send no vref_out and print as before. +func TestLAVoltagePin21(t *testing.T) { + stubLAVoltageProfile(t, "", false, nil) + addr, _ := fakeLANPod(t, `{"status":"ok","data":{"mv":5000,"st":1,"readback_mv":3300,`+ + `"vref_out":{"source":"5v","set_mv":5000,"mv":4920,"state":"ok","up":true}}}`) + var out, warn strings.Builder + if err := runLAVoltage(&globalFlags{connection: addr}, 5000, &out, &warn); err != nil { + t.Fatal(err) + } + if !strings.Contains(out.String(), "is now 5 V") || !strings.Contains(out.String(), "J1 pin 21 (pull-up rail): 4.92 V, set to 5 V (ok)") { + t.Errorf("out = %q", out.String()) + } + if warn.String() != "" { + t.Errorf("warn = %q", warn.String()) + } + + addr, _ = fakeLANPod(t, `{"status":"ok","data":{"mv":3300,"st":1,"readback_mv":3300,`+ + `"vref_out":{"source":"bank","set_mv":3300,"mv":4700,"state":"high","up":true}}}`) + out.Reset() + warn.Reset() + if err := runLAVoltage(&globalFlags{connection: addr}, 0, &out, &warn); err != nil { + t.Fatal(err) + } + if !strings.Contains(warn.String(), "above its setting") || !strings.Contains(warn.String(), "la voltage 5.0") { + t.Errorf("warn = %q", warn.String()) + } + + addr, _ = fakeLANPod(t, `{"status":"ok","data":{"mv":3300,"st":1,"readback_mv":3300}}`) + out.Reset() + warn.Reset() + if err := runLAVoltage(&globalFlags{connection: addr}, 0, &out, &warn); err != nil { + t.Fatal(err) + } + if strings.Contains(out.String(), "pin 21") || warn.String() != "" { + t.Errorf("older board: out %q warn %q", out.String(), warn.String()) + } +} diff --git a/cmd/benchpod-cli/units.go b/cmd/benchpod-cli/units.go index d855099..5e24bf5 100644 --- a/cmd/benchpod-cli/units.go +++ b/cmd/benchpod-cli/units.go @@ -99,9 +99,10 @@ func formatSI(v float64, unit string) string { return strconv.FormatFloat(v, 'g', -1, 64) + unit } -// parseLAVoltage reads the LA bank voltage as the pod takes it, in millivolts (1800 or 3300). -// It accepts "3.3V", "1800mV", "3.3" (volts) or "3300" (a bare number above 5 is millivolts, as -// the pod's own commands take it). +// parseLAVoltage reads the LA bank voltage as the pod takes it, in millivolts (1800, 3300, or 5000 +// for 5 V I/O on the digital board v3r4; other pods refuse 5000 themselves). It accepts "3.3V", +// "1800mV", "3.3" (volts) or "3300" (a bare number above 5 is millivolts, as the pod's own commands +// take it). func parseLAVoltage(s string) (int, error) { in := strings.TrimSpace(s) v, err := parseSI(in, "V") @@ -112,8 +113,8 @@ func parseLAVoltage(s string) (int, error) { v /= 1000 // a bare 1800 or 3300 } mv := int(math.Round(v * 1000)) - if mv != 1800 && mv != 3300 { - return 0, fmt.Errorf("LA voltage %q: the pod takes 1.8V or 3.3V", in) + if mv != 1800 && mv != 3300 && mv != 5000 { + return 0, fmt.Errorf("LA voltage %q: the pod takes 1.8V or 3.3V (5V on the digital board v3r4)", in) } return mv, nil } diff --git a/cmd/benchpod-cli/units_test.go b/cmd/benchpod-cli/units_test.go index d5edb42..70dfad2 100644 --- a/cmd/benchpod-cli/units_test.go +++ b/cmd/benchpod-cli/units_test.go @@ -43,12 +43,13 @@ func near(a, b float64) bool { } func TestParseLAVoltage(t *testing.T) { - for in, want := range map[string]int{"3.3V": 3300, "3.3v": 3300, "1.8V": 1800, "1800mV": 1800, "3.3": 3300, "1.8": 1800, "3300": 3300, "1800": 1800} { + for in, want := range map[string]int{"3.3V": 3300, "3.3v": 3300, "1.8V": 1800, "1800mV": 1800, "3.3": 3300, "1.8": 1800, "3300": 3300, "1800": 1800, + "5V": 5000, "5.0": 5000, "5000": 5000, "5000mV": 5000} { // 5 V: digital v3r4 (other pods refuse it) if got, err := parseLAVoltage(in); err != nil || got != want { t.Errorf("parseLAVoltage(%q) = %d, %v; want %d", in, got, err, want) } } - for _, in := range []string{"5V", "2.5", "1234", "x", ""} { + for _, in := range []string{"2.5", "1234", "4.9", "x", ""} { if _, err := parseLAVoltage(in); err == nil { t.Errorf("parseLAVoltage(%q) accepted", in) } From 3f1bdc3895b427339d35dfe41bbf64d1ac975365 Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Thu, 19 Nov 2026 09:16:42 -0600 Subject: [PATCH 2/5] la pins [PINS]: only those pins; a too-large list is read in two parts benchpod la pins 1-4 asks la_pins for those pins (firmware after 3.10.12; older firmware sends all 14 and the CLI keeps the ones asked for). A full listing the pod answers with "reply too large" is read as LA1-7 and LA8-14 and joined (benchpod-firmware#180). README updated. Co-Authored-By: Claude Opus 5.5 --- README.md | 10 ++- cmd/benchpod-cli/busmaster.go | 89 ++++++++++++++++++++++-- cmd/benchpod-cli/lapins_subset_test.go | 93 ++++++++++++++++++++++++++ 3 files changed, 185 insertions(+), 7 deletions(-) create mode 100644 cmd/benchpod-cli/lapins_subset_test.go diff --git a/README.md b/README.md index 625f7fd..d073f2f 100644 --- a/README.md +++ b/README.md @@ -347,6 +347,7 @@ benchpod la pull 3 up # LA pin pull resistor: up, do benchpod la status benchpod la step --la 6 --steps 200 --delay 500us --dir-la 7 --direction 1 benchpod la pins # every LA pin: function, level, pull-up, direction, warnings +benchpod la pins 1-4 # only LA1-LA4 benchpod la dir 9,10 dut_output # the pod refuses push-pull drivers on these pins benchpod i2c start --sda 1 --scl 2 --hz 400000 # the pod as an I2C master (gateware v55+) benchpod i2c xfer 0x48 --write 0d --read 2 # hex in, hex out @@ -1530,15 +1531,18 @@ Pulse an LA pin N times, for step/dir stepper drivers. The FPGA times the train. | `--dir-la` | (none) | Direction pin, driven before stepping. | | `--direction` | `0` | Level for `--dir-la`: `0` or `1`. | -### `benchpod la pins` +### `benchpod la pins [PINS]` -List all 14 LA pins: what each one is used for (and by whom), its GPIO mode and +List all 14 LA pins, or only PINS (a pin, a list or a range: `9`, `9,10`, `9-12`, +`la9`, or a name from the pod's wiring profile): what each one is used for (and by whom), its GPIO mode and level, its live level, its pull resistor, its direction (see `la dir`) and its warnings. A warning line follows the table for each pin that has one: a pull-up on under a push-pull output (it only costs current), or a pin driven high or pulled up while the pod's target power is off (that powers an unpowered DUT through its pins; ignore it when the DUT has its own supply). Directions and warnings need gateware v55 -or later; older pods show every pin as `unknown`. +or later; older pods show every pin as `unknown`. A list too large for one cloud reply +(a long sensor instance name on every pin) is read in two parts by itself (firmware after +3.10.12; older firmware answers "reply too large" then). | Flag | Default | Purpose | |----------|---------|----------------------------------| diff --git a/cmd/benchpod-cli/busmaster.go b/cmd/benchpod-cli/busmaster.go index 43b0be0..c405b6b 100644 --- a/cmd/benchpod-cli/busmaster.go +++ b/cmd/benchpod-cli/busmaster.go @@ -562,19 +562,100 @@ func printLAPins(w io.Writer, rep laPinsReply) { } } +// laPinsCommander is the one call laPinsFetch needs (the pod client). +type laPinsCommander interface { + Command(ctx context.Context, req map[string]any) (json.RawMessage, error) +} + +// laPinsFetch reads la_pins: every pin (pins nil) or only those pins. Firmware after 3.10.12 sends +// only the pins asked for; older firmware sends all 14 and they are filtered here. A full listing +// the pod answers with "reply too large" (a long sensor instance name on every pin) is read in two +// parts, LA1-7 and LA8-14, and joined. +func laPinsFetch(ctx context.Context, c laPinsCommander, pins []int) (json.RawMessage, error) { + if pins == nil { + raw, err := c.Command(ctx, map[string]any{"cmd": "la_pins"}) + if err == nil || !strings.Contains(err.Error(), "reply too large") { + return raw, err + } + first, err1 := laPinsQuery(ctx, c, []int{1, 2, 3, 4, 5, 6, 7}) + if err1 != nil { + return nil, err + } + if n, _ := first["pins"].([]any); len(n) > 7 { + return nil, err // firmware without the pin subset: it sent everything again + } + second, err2 := laPinsQuery(ctx, c, []int{8, 9, 10, 11, 12, 13, 14}) + if err2 != nil { + return nil, err2 + } + a, _ := first["pins"].([]any) + b, _ := second["pins"].([]any) + first["pins"] = append(a, b...) + return json.Marshal(first) + } + m, err := laPinsQuery(ctx, c, pins) + if err != nil { + return nil, err + } + return json.Marshal(m) +} + +// laPinsQuery sends la_pins with "la" and keeps only the entries of those pins. +func laPinsQuery(ctx context.Context, c laPinsCommander, pins []int) (map[string]any, error) { + raw, err := c.Command(ctx, map[string]any{"cmd": "la_pins", "la": pins}) + if err != nil { + return nil, err + } + var m map[string]any + if err := json.Unmarshal(raw, &m); err != nil { + return nil, fmt.Errorf("unexpected reply %s", strings.TrimSpace(string(raw))) + } + want := map[int]bool{} + for _, p := range pins { + want[p] = true + } + var keep []any + entries, _ := m["pins"].([]any) + for _, e := range entries { + if em, ok := e.(map[string]any); ok { + if la, ok := em["la"].(float64); ok && want[int(la)] { + keep = append(keep, e) + } + } + } + if keep == nil { + keep = []any{} + } + m["pins"] = keep + return m, nil +} + func newLAPinsCmd(g *globalFlags) *cobra.Command { var asJSON bool cmd := &cobra.Command{ - Use: "pins", + Use: "pins [PINS]", Short: "List every LA pin: function, GPIO state, live level, pull-up, direction and warnings", - Args: cobra.NoArgs, - RunE: func(_ *cobra.Command, _ []string) error { + Long: "List every LA pin, or only PINS (a pin, a list or a range: 9, 9,10, 9-12, la9, or a\n" + + "name from the pod's wiring profile). A list too large for one cloud reply is read\n" + + "in two parts by itself (firmware after 3.10.12).", + Example: " benchpod la pins\n benchpod la pins 1-4\n benchpod la pins uart_rx --json", + Args: cobra.MaximumNArgs(1), + RunE: func(_ *cobra.Command, args []string) error { + var pins []int + if len(args) == 1 && !strings.EqualFold(strings.TrimSpace(args[0]), "all") { + r := &pinResolver{g: g} + p, err := r.pins("PINS", args[0]) + if err != nil { + return usageErrorf("%v", err) + } + pins = p + } ctx, cancel, t, err := g.podClient("la pins", i2cTimeout) if err != nil { return err } defer cancel() - raw, err := t.client.Command(ctx, map[string]any{"cmd": "la_pins"}) + raw, err := laPinsFetch(ctx, t.client, pins) if err != nil { return fmt.Errorf("la pins: %w", err) } diff --git a/cmd/benchpod-cli/lapins_subset_test.go b/cmd/benchpod-cli/lapins_subset_test.go new file mode 100644 index 0000000..ca0fd26 --- /dev/null +++ b/cmd/benchpod-cli/lapins_subset_test.go @@ -0,0 +1,93 @@ +package main + +import ( + "context" + "encoding/json" + "errors" + "reflect" + "testing" +) + +// fakeLAPins answers la_pins like the firmware: "la" selects pins when subset is true (firmware +// after 3.10.12), the full listing fails with "reply too large" when tooLarge is true. +type fakeLAPins struct { + subset, tooLarge bool + sent []map[string]any +} + +func (f *fakeLAPins) Command(_ context.Context, req map[string]any) (json.RawMessage, error) { + f.sent = append(f.sent, req) + want, has := req["la"].([]int) + if !f.subset { + has = false + } + if !has && f.tooLarge { + return nil, errors.New("pod error: reply too large") + } + var pins []map[string]any + for la := 1; la <= 14; la++ { + ok := !has + for _, w := range want { + ok = ok || w == la + } + if ok { + pins = append(pins, map[string]any{"la": la, "function": "none"}) + } + } + return json.Marshal(map[string]any{"pins": pins, "pull_dirs": []string{"up", "down"}, "levels": nil}) +} + +func pinNumbers(t *testing.T, raw json.RawMessage) []int { + t.Helper() + var rep laPinsReply + if err := json.Unmarshal(raw, &rep); err != nil { + t.Fatal(err) + } + var out []int + for _, p := range rep.Pins { + out = append(out, p.LA) + } + return out +} + +func TestLAPinsSubset(t *testing.T) { + f := &fakeLAPins{subset: true} + raw, err := laPinsFetch(context.Background(), f, []int{9, 3}) + if err != nil { + t.Fatal(err) + } + if got := pinNumbers(t, raw); !reflect.DeepEqual(got, []int{3, 9}) { + t.Fatalf("pins %v", got) + } + // Older firmware ignores "la": the CLI keeps the pins asked for. + f = &fakeLAPins{} + raw, _ = laPinsFetch(context.Background(), f, []int{5}) + if got := pinNumbers(t, raw); !reflect.DeepEqual(got, []int{5}) { + t.Fatalf("old firmware pins %v", got) + } + // Without PINS the request is as before. + _, _ = laPinsFetch(context.Background(), f, nil) + if last := f.sent[len(f.sent)-1]; !reflect.DeepEqual(last, map[string]any{"cmd": "la_pins"}) { + t.Fatalf("plain request %v", last) + } +} + +func TestLAPinsTooLargeReadsInTwoParts(t *testing.T) { + f := &fakeLAPins{subset: true, tooLarge: true} + raw, err := laPinsFetch(context.Background(), f, nil) + if err != nil { + t.Fatal(err) + } + want := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14} + if got := pinNumbers(t, raw); !reflect.DeepEqual(got, want) { + t.Fatalf("pins %v", got) + } + if len(f.sent) != 3 { + t.Fatalf("requests %v", f.sent) + } + // Firmware without the subset cannot help: the error stands. + f = &fakeLAPins{tooLarge: true} + if _, err := laPinsFetch(context.Background(), f, nil); err == nil { + t.Fatal("want the too-large error") + } +} From 84abf7866636634fa54ecff31c420660a7da0ea3 Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Thu, 19 Nov 2026 09:28:23 -0600 Subject: [PATCH 3/5] la pins too large on older firmware: say to update the pod Older firmware has no la subset, so a list it answers with "reply too large" cannot be read in parts. The error now says that firmware after 3.10.12 can, how to update, and to ask for fewer pins meanwhile. Co-Authored-By: Claude Opus 5.5 --- cmd/benchpod-cli/busmaster.go | 11 +++++++++-- cmd/benchpod-cli/lapins_subset_test.go | 7 +++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cmd/benchpod-cli/busmaster.go b/cmd/benchpod-cli/busmaster.go index c405b6b..605f787 100644 --- a/cmd/benchpod-cli/busmaster.go +++ b/cmd/benchpod-cli/busmaster.go @@ -579,10 +579,10 @@ func laPinsFetch(ctx context.Context, c laPinsCommander, pins []int) (json.RawMe } first, err1 := laPinsQuery(ctx, c, []int{1, 2, 3, 4, 5, 6, 7}) if err1 != nil { - return nil, err + return nil, laPinsUpdateHint(err) } if n, _ := first["pins"].([]any); len(n) > 7 { - return nil, err // firmware without the pin subset: it sent everything again + return nil, laPinsUpdateHint(err) // firmware without the pin subset: it sent everything again } second, err2 := laPinsQuery(ctx, c, []int{8, 9, 10, 11, 12, 13, 14}) if err2 != nil { @@ -600,6 +600,13 @@ func laPinsFetch(ctx context.Context, c laPinsCommander, pins []int) (json.RawMe return json.Marshal(m) } +// laPinsUpdateHint says what to do when older firmware (no pin subset) cannot send the whole list. +func laPinsUpdateHint(err error) error { + return fmt.Errorf("%w; firmware after 3.10.12 reads this list in parts: update the pod "+ + "(benchpod flash-self, or the firmware update in the web app), or ask for fewer pins "+ + "(benchpod la pins 1-7)", err) +} + // laPinsQuery sends la_pins with "la" and keeps only the entries of those pins. func laPinsQuery(ctx context.Context, c laPinsCommander, pins []int) (map[string]any, error) { raw, err := c.Command(ctx, map[string]any{"cmd": "la_pins", "la": pins}) diff --git a/cmd/benchpod-cli/lapins_subset_test.go b/cmd/benchpod-cli/lapins_subset_test.go index ca0fd26..49999fe 100644 --- a/cmd/benchpod-cli/lapins_subset_test.go +++ b/cmd/benchpod-cli/lapins_subset_test.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "reflect" + "strings" "testing" ) @@ -87,7 +88,9 @@ func TestLAPinsTooLargeReadsInTwoParts(t *testing.T) { } // Firmware without the subset cannot help: the error stands. f = &fakeLAPins{tooLarge: true} - if _, err := laPinsFetch(context.Background(), f, nil); err == nil { - t.Fatal("want the too-large error") + _, err = laPinsFetch(context.Background(), f, nil) + if err == nil || !strings.Contains(err.Error(), "reply too large") || + !strings.Contains(err.Error(), "firmware after 3.10.12 reads this list in parts") { + t.Fatalf("want the too-large error with the update hint, got %v", err) } } From 8db74eab82449151a18350b267d83bcb0092e952 Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Thu, 19 Nov 2026 09:37:11 -0600 Subject: [PATCH 4/5] la voltage: 5 V I/O links to the one 5 V page The la voltage help and README name 5V and point to embeddedci.com/docs/benchpod-targets/5v-rs485#5v-io instead of explaining 5 V I/O again (the help also said the pod reads 5 V signals at full speed, which is not measured yet). Co-Authored-By: Claude Opus 5.5 --- README.md | 6 ++++-- cmd/benchpod-cli/lavoltage.go | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d073f2f..c92f6ea 100644 --- a/README.md +++ b/README.md @@ -337,7 +337,7 @@ benchpod status --json # the pod's raw status reply # Hardware (network): benchpod la voltage 3.3V # the DUT's I/O voltage for now (it normally comes from the wiring profile) -benchpod la voltage 5V # digital board v3r4: 5 V I/O (pin 21 goes to 5 V; also shows pin 21) +benchpod la voltage 5V # digital board v3r4: 5 V I/O (see the 5 V page linked under la voltage) benchpod generate --waveform sine --freq 1kHz --duration 2s # DAC waveform benchpod measure --waveform sine --samples 1024 # DAC + ADC loopback benchpod capture --samples 1024 --output csv # ADC snapshot @@ -1478,7 +1478,9 @@ embeddedci.com; `la voltage` also works over USB. ### `benchpod la voltage [VOLTAGE]` Show or set the LA bank's I/O voltage, which must match the DUT's: `1.8V` or `3.3V` -(also `1800mV`, `3.3` or `3300`). Leave it out to show the setting. The pod refuses +(also `1800mV`, `3.3` or `3300`), or `5V` on a pod with the digital board v3r4 +([5 V I/O](https://embeddedci.com/docs/benchpod-targets/5v-rs485#5v-io): pin 21 goes to 5 V, +and the output then shows pin 21). Leave it out to show the setting. The pod refuses LA capture, UART, SWD flash, pull-ups and sensor emulation until it is set; 1.8 V needs a v3 pod, and the pod refuses a change while an LA pin is in use. Works over the network, over USB and through embeddedci.com. No flags. diff --git a/cmd/benchpod-cli/lavoltage.go b/cmd/benchpod-cli/lavoltage.go index e59d8df..463b396 100644 --- a/cmd/benchpod-cli/lavoltage.go +++ b/cmd/benchpod-cli/lavoltage.go @@ -32,11 +32,10 @@ func newLAVoltageCmd(g *globalFlags) *cobra.Command { "sensor emulation until it is set. 1.8V needs a v3 pod, and the pod refuses a\n" + "change while any LA pin is in use.\n\n" + "VOLTAGE is 1.8V or 3.3V (also 1800mV, 3.3, or 3300).\n\n" + - "5V (5.0, 5000) works on a pod with the digital board v3r4: the bank stays at 3.3V and\n" + - "J1 pin 21, the rail the pull-ups pull to, goes to 5V. The pod reads 5V signals at full\n" + - "speed; its outputs reach 5V only through their pull-ups (benchpod la pull PIN up). The\n" + - "pod refuses with BP0028 when 5V did not come up, and other pods refuse 5000. On v3r4 the\n" + - "output also shows pin 21 and warns when it sits above its setting.\n\n" + + "5V (5.0, 5000) works on a pod with the digital board v3r4: pin 21, the pull-up rail,\n" + + "goes to 5V and outputs reach 5V through their pull-ups (benchpod la pull PIN up). The\n" + + "output then shows pin 21. BP0028: 5V did not come up. Other pods refuse 5000. Details:\n" + + "https://embeddedci.com/docs/benchpod-targets/5v-rs485#5v-io\n\n" + "Omit VOLTAGE to show the current setting. Works over the network, over USB (--connection usb) and through\n" + "embeddedci.com (--connection embeddedci:).\n\n" + "The pod forgets the voltage on a restart. Firmware 3.10.8 and later keeps wiring\n" + From bfa67518a33dd224bae57c14c4d2452df5359496 Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Thu, 19 Nov 2026 11:35:17 -0600 Subject: [PATCH 5/5] Features table from firmware 3.10.13 (revision 7, release row) Co-Authored-By: Claude Opus 5.5 --- internal/features/features.json | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/internal/features/features.json b/internal/features/features.json index c934805..7d42158 100644 --- a/internal/features/features.json +++ b/internal/features/features.json @@ -2,7 +2,7 @@ "_generated": "GENERATED by tools/gen_features.py from features/features.toml. DO NOT EDIT: edit the table.", "schema": 1, "revision": 7, - "table_sha256": "3bd0fc08c174b11ddb71f9ae24f4fa9cd790470ac0b116a95b5823a572e829fd", + "table_sha256": "a6a88ef88c0925212fcfa41f87409572bc0210a9fd02f2f418fc2a50b86eba64", "floor": "3.9.2", "docs_base": "https://github.com/embeddedci-com/benchpod-firmware/blob/main/docs/", "facts": { @@ -127,6 +127,11 @@ "firmware": "3.10.12", "gateware": 58, "date": "2026-11-18" + }, + { + "firmware": "3.10.13", + "gateware": 59, + "date": "2026-11-19" } ], "features": { @@ -658,25 +663,25 @@ }, "la_pull_1v8": { "rev": 4, - "firmware": "next", + "firmware": "3.10.13", "board": "any", "docs": "API.md#switch-or-query-an-la-pin-pull-resistor" }, "log_level": { "rev": 4, - "firmware": "next", + "firmware": "3.10.13", "board": "any", "docs": "usb-serial-interface.md#log-levels" }, "lease": { "rev": 5, - "firmware": "next", + "firmware": "3.10.13", "board": "any", "docs": "API.md#pod-lease" }, "la_5v": { "rev": 6, - "firmware": "next", + "firmware": "3.10.13", "board": "any", "requires": [ "vref_out" @@ -685,7 +690,7 @@ }, "la_pull_strength": { "rev": 7, - "firmware": "next", + "firmware": "3.10.13", "board": "any", "requires": [ "vref_out"