From 4f5834a46724563d7563be7327b42061b18ceab5 Mon Sep 17 00:00:00 2001 From: Scott Penrose Date: Sun, 25 Oct 2026 16:02:45 +1100 Subject: [PATCH] 0.2.0: USB-C and the header share a port, and a real 9704 on the Stamp-C3 The 9704's USB-C goes through an FTDI chip to the modem's UART, on the same lines as the header. With the cable plugged in, that chip drives the modem's RX: a board on the header hears the modem but cannot reach it, and the computer on USB gets no answer either. Unplug the USB-C and power the 9704 from the header. The README says so beside the overlay example, and docs/CLOUDLOOP.md lists it under "When begin fails". The M5Stamp-C3 is the first microcontroller to run against a real 9704: TX and RX only, the modem powered from the Stamp's 5 V pin. begin, info and signal all answer, with nothing dropped. docs/boards/stamp_c3.md has the power section and what has run. no-control-pins.overlay takes P_EN, I_EN and I_BTD out of any board's overlay at build time, for a modem on four wires. The modem node is labelled rb9704 in every overlay so it can. The module, the sample and the Python tools are 0.2.0. --- CHANGELOG.md | 11 +++++- README.md | 13 ++++++- docs/CLOUDLOOP.md | 9 ++++- docs/TESTING.md | 14 +++++-- docs/boards/stamp_c3.md | 37 +++++++++++++++++-- python/pyproject.toml | 2 +- python/rb9704tools/__init__.py | 2 +- .../boards/esp32_devkitc_esp32_procpu.overlay | 2 +- .../boards/esp32s3_devkitc_procpu.overlay | 2 +- .../boards/lilygo_t3s3_esp32s3_procpu.overlay | 2 +- samples/shell/boards/native_sim.overlay | 2 +- .../shell/boards/native_sim_native_64.overlay | 2 +- samples/shell/boards/nucleo_u575zi_q.overlay | 2 +- samples/shell/boards/stamp_c3.overlay | 2 +- .../shell/boards/xiao_esp32s3_procpu.overlay | 2 +- samples/shell/no-control-pins.overlay | 15 ++++++++ 16 files changed, 97 insertions(+), 22 deletions(-) create mode 100644 samples/shell/no-control-pins.overlay diff --git a/CHANGELOG.md b/CHANGELOG.md index 2919e20..a0ca350 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changes -## Unreleased +## 0.2.0, 2026-10-25 - The shell sample over WiFi: `overlay-wifi.conf` puts the shell on telnet on any ESP32, joining the network `wifi cred add` stored in @@ -11,7 +11,14 @@ has its pins, the WiFi commands and the LED's colours. - The sample's overlays for the M5Stamp-C3, ESP32-S3-DevKitC, ESP32 DevKitC and NUCLEO-U575ZI-Q wire P_EN, I_EN and I_BTD; the wiring table - is in `docs/TESTING.md`. + is in `docs/TESTING.md`. `no-control-pins.overlay` takes them out at + build time, for a modem on TX and RX alone; the modem node is labelled + `rb9704` in every overlay so it can. +- A real 9704 on a microcontroller for the first time: the M5Stamp-C3, + on TX and RX, powered from the Stamp's 5 V. The 9704's USB-C and its + header share the modem's UART, and with USB-C plugged in a board on the + header cannot reach the modem; the README, `docs/CLOUDLOOP.md` and + `docs/boards/stamp_c3.md` say so. - `rb9704_cancel()` and `rb9704 cancel`: ask the modem to abandon the message in flight; `mo_done` then reports `-ECANCELED`. The status snapshot carries the in-flight message's id and start time. The fake diff --git a/README.md b/README.md index 947dc96..b9cf019 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ library, pinned, at the path the module looks in, and nothing else: ```yaml - name: rockblock9704-zephyr url: https://github.com/SH3D/rockblock9704-zephyr - revision: v0.1.0 + revision: v0.2.0 path: modules/lib/rockblock9704-zephyr import: name-allowlist: @@ -100,6 +100,15 @@ without them the modem is taken to be powered: }; ``` +**USB-C and the header are the same serial port.** The 9704's USB-C goes +through an FTDI chip to the modem's UART, on the same lines as the +header's TX and RX. With the USB-C cable plugged in, that chip drives the +modem's RX, and a board on the header can hear the modem but not reach +it: `rb9704_begin` fails with `-EIO`, and the computer on USB gets no +answer either. Unplug the USB-C and power the 9704 from the header; a +board's 5 V pin will do, as the modem draws a few hundred mA +(`docs/boards/stamp_c3.md`). + `CONFIG_RB9704` follows the node. Then ``: ```c @@ -185,7 +194,7 @@ sample has overlays for: | `native_sim` | the host (x86-64) | yes | | NUCLEO-U575ZI-Q | STM32U5, Arm Cortex-M33 | yes | | Seeed XIAO ESP32S3 | ESP32-S3, Xtensa | yes | -| M5Stamp-C3 | ESP32-C3, RISC-V | WiFi and telnet so far, not yet the modem; `docs/boards/stamp_c3.md` | +| M5Stamp-C3 | ESP32-C3, RISC-V | yes, a real 9704 on TX and RX; `docs/boards/stamp_c3.md` | | ESP32-S3-DevKitC | ESP32-S3, Xtensa | builds | | ESP32 DevKitC | ESP32, Xtensa | builds | | LilyGO T3-S3 | ESP32-S3, Xtensa | builds; an out-of-tree board in OGLAST2, with its `-DBOARD_ROOT` | diff --git a/docs/CLOUDLOOP.md b/docs/CLOUDLOOP.md index 00b3339..d5c70be 100644 --- a/docs/CLOUDLOOP.md +++ b/docs/CLOUDLOOP.md @@ -18,7 +18,11 @@ have not been tried yet. - **Its USB-C port.** An FTDI FT234XD (USB id `0403:6015`) bridges it to the modem's UART, and the port also powers the board. It needs a port that supplies 500 mA at 4.0 to 5.3 V; an unpowered hub is not supported. - The supercapacitor takes about 40 s to charge from USB. LEDs: red PWR is + The supercapacitor takes about 40 s to charge from USB. The FTDI is on + the same UART lines as the 10-way header, so with USB-C plugged in a + microcontroller on the header can hear the modem but not reach it; a + board on the header powers the 9704 from the header, with USB-C + unplugged (`boards/stamp_c3.md`). LEDs: red PWR is input voltage present, green RDY is the modem powered and booted, blue XMT is transmitting. - **The library.** Ground Control's C library (MIT) is what this @@ -184,6 +188,9 @@ version, SIM, operational state). In order of likelihood: blocks it. The `--udev` rule stops the first. - **Not in `dialout`.** `install.sh` checks; `sudo usermod -aG dialout $USER` and log in again. +- **USB-C and the header at once.** A board on the header with the + USB-C cable plugged in: the FTDI drives the modem's RX, and neither side + gets an answer. Unplug one. - **Not booted.** No green RDY: the port gives too little current (a hub, a front-panel port), or the supercapacitor is still charging. - **Something odd.** `rb9704 jspr --setup 'GET hwInfo {}' diff --git a/docs/TESTING.md b/docs/TESTING.md index 329086c..c383c11 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md @@ -144,6 +144,10 @@ adapter in place of the 9704 has no I_BTD, so tie the board's I_BTD pin to 3.3 V for those runs, or build with the rig overlays, which have no control lines. +For a modem on TX and RX alone, `samples/shell/no-control-pins.overlay` +takes the three lines out of any board's overlay at build time: +`-DEXTRA_DTC_OVERLAY_FILE=no-control-pins.overlay`. + ## What has passed On 2026-10-09, Zephyr v4.4.0, Ground Control's library v1.0.1, the @@ -157,7 +161,11 @@ binding 1.0.2: | NUCLEO-U575ZI-Q through the rig | 12 | all pass | | a real 9704 (firmware v1.5.14), binding and native_sim, free checks | 2 | all pass | +On 2026-10-25, the M5Stamp-C3 (ESP32-C3, RISC-V) with the shell over +WiFi, and a real 9704 on its header pins, TX and RX only, powered from +the Stamp's 5V: `begin`, `info` and `signal` all answer, nothing dropped +(`boards/stamp_c3.md`). + Not yet: a message through a real modem and satellite, which costs -airtime and needs the sky (`CLOUDLOOP.md`, "The order to test in"), the -power pins on a board that has them wired, and the shell over WiFi on a -board. +airtime and needs the sky (`CLOUDLOOP.md`, "The order to test in"), and +the power pins on a board that has them wired. diff --git a/docs/boards/stamp_c3.md b/docs/boards/stamp_c3.md index 5286e57..de44407 100644 --- a/docs/boards/stamp_c3.md +++ b/docs/boards/stamp_c3.md @@ -20,19 +20,36 @@ The overlay is `samples/shell/boards/stamp_c3.overlay`, with | GPIO6 | I_EN | the modem enable, 10 ms after P_EN | | GPIO7 | I_BTD | `rb9704 begin` waits up to 30 s for it to go high | | GND | GND | | +| 5V | the 9704's supply in | the Stamp's USB-C supply, passed through | | GPIO2 | the RGB LED, an SK6812 | on the board | | GPIO3 | the button | on the board | | GPIO20, GPIO21 | `uart0`, the console | through the USB-C bridge | Kept clear: GPIO8 and GPIO9 (strapping pins, and the board's I2C) and -GPIO18 and GPIO19 (USB). The modem's supply is its own, at the voltage -and peak current Ground Control's manual gives, not the Stamp's 3.3 V. +GPIO18 and GPIO19 (USB). + +## Power: the Stamp's 5V, and the 9704's USB-C unplugged + +The 9704's header UART and its USB-C port are the same serial lines. With +USB-C plugged in, the 9704's FTDI chip is powered and drives the modem's +RX, and a board on the header cannot talk over it: the modem answers +nobody, the computer on USB included. Its TX still reaches the header, so +a board can listen alongside USB, but not send. + +So the 9704 is powered from the header with its USB-C unplugged. The +Stamp's 5V pin does it: the modem draws a few hundred mA, and its +supercapacitor charges slowly, about 40 s to the green RDY LED. Both +boards then run from the Stamp's USB-C; on a laptop's 500 mA port a +Stamp that resets by itself while the 9704 charges is the supply sagging, +and a charger or a powered hub gives the margin. The control lines are optional. With fewer wired, take the matching lines out of the overlay's `rockblock` node, or `rb9704 begin` waits on a pin that is not there: -- None: four wires, and the modem is taken to be powered. +- None: four wires, and the modem is taken to be powered. No edit + needed: `-DEXTRA_DTC_OVERLAY_FILE=no-control-pins.overlay` takes all + three out at build time (below). - P_EN only: `rb9704 power off` and `power on` over telnet restart a modem that has hung, with nobody walking out to it. The one most worth wiring. @@ -53,6 +70,16 @@ west flash Without `-DEXTRA_CONF_FILE=overlay-wifi.conf` the shell is on the USB console only, and the LED and button work the same. +TX and RX only, no control lines: + +```sh +west build -b stamp_c3 samples/shell -- -DEXTRA_CONF_FILE=overlay-wifi.conf \ + -DEXTRA_DTC_OVERLAY_FILE=no-control-pins.overlay +``` + +With no P_EN, the long press on the button ends without turning anything +off, and `rb9704 power` answers `-ENOTSUP`. + ## WiFi Once, on the USB console (115200), store the network. It is kept in flash @@ -143,5 +170,7 @@ has no I_BTD: tie GPIO7 to 3.3 V for those runs. | | | | --- | --- | | WiFi, the stored network, telnet | works (2026-10-24) | +| a real 9704 on TX and RX, powered from the Stamp's 5V: `begin`, `info`, `signal` | works (2026-10-25) | +| the same with the 9704's USB-C plugged in | fails: the FTDI holds the modem's RX | | the LED and button | built, not yet run | -| a real 9704 on this board | not yet | +| P_EN, I_EN, I_BTD | not yet wired | diff --git a/python/pyproject.toml b/python/pyproject.toml index 30df212..239ad37 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "rockblock9704-tools" -version = "0.1.0" +version = "0.2.0" description = "Host tools for the RockBLOCK 9704: a command line for the modem and Cloudloop, and a fake modem for testing" readme = "README.md" license = "MIT" diff --git a/python/rb9704tools/__init__.py b/python/rb9704tools/__init__.py index 5c15c46..aee323a 100644 --- a/python/rb9704tools/__init__.py +++ b/python/rb9704tools/__init__.py @@ -2,4 +2,4 @@ # Copyright (c) 2026 Scott Penrose """Host tools for the RockBLOCK 9704.""" -__version__ = "0.1.0" +__version__ = "0.2.0" diff --git a/samples/shell/boards/esp32_devkitc_esp32_procpu.overlay b/samples/shell/boards/esp32_devkitc_esp32_procpu.overlay index 682fcfa..3dd99c9 100644 --- a/samples/shell/boards/esp32_devkitc_esp32_procpu.overlay +++ b/samples/shell/boards/esp32_devkitc_esp32_procpu.overlay @@ -7,7 +7,7 @@ current-speed = <230400>; status = "okay"; - rockblock { + rb9704: rockblock { compatible = "rock7,rockblock-9704"; power-gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; /* P_EN */ iridium-enable-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; /* I_EN */ diff --git a/samples/shell/boards/esp32s3_devkitc_procpu.overlay b/samples/shell/boards/esp32s3_devkitc_procpu.overlay index fb00c6c..9d494f7 100644 --- a/samples/shell/boards/esp32s3_devkitc_procpu.overlay +++ b/samples/shell/boards/esp32s3_devkitc_procpu.overlay @@ -19,7 +19,7 @@ current-speed = <230400>; status = "okay"; - rockblock { + rb9704: rockblock { compatible = "rock7,rockblock-9704"; power-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; /* P_EN */ iridium-enable-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* I_EN */ diff --git a/samples/shell/boards/lilygo_t3s3_esp32s3_procpu.overlay b/samples/shell/boards/lilygo_t3s3_esp32s3_procpu.overlay index 1e69bdb..f84dc7b 100644 --- a/samples/shell/boards/lilygo_t3s3_esp32s3_procpu.overlay +++ b/samples/shell/boards/lilygo_t3s3_esp32s3_procpu.overlay @@ -8,7 +8,7 @@ current-speed = <230400>; status = "okay"; - rockblock { + rb9704: rockblock { compatible = "rock7,rockblock-9704"; }; }; diff --git a/samples/shell/boards/native_sim.overlay b/samples/shell/boards/native_sim.overlay index 026b9d5..55cc369 100644 --- a/samples/shell/boards/native_sim.overlay +++ b/samples/shell/boards/native_sim.overlay @@ -7,7 +7,7 @@ current-speed = <230400>; status = "okay"; - rockblock { + rb9704: rockblock { compatible = "rock7,rockblock-9704"; }; }; diff --git a/samples/shell/boards/native_sim_native_64.overlay b/samples/shell/boards/native_sim_native_64.overlay index 026b9d5..55cc369 100644 --- a/samples/shell/boards/native_sim_native_64.overlay +++ b/samples/shell/boards/native_sim_native_64.overlay @@ -7,7 +7,7 @@ current-speed = <230400>; status = "okay"; - rockblock { + rb9704: rockblock { compatible = "rock7,rockblock-9704"; }; }; diff --git a/samples/shell/boards/nucleo_u575zi_q.overlay b/samples/shell/boards/nucleo_u575zi_q.overlay index 4cfff45..26818a7 100644 --- a/samples/shell/boards/nucleo_u575zi_q.overlay +++ b/samples/shell/boards/nucleo_u575zi_q.overlay @@ -13,7 +13,7 @@ current-speed = <230400>; status = "okay"; - rockblock { + rb9704: rockblock { compatible = "rock7,rockblock-9704"; power-gpios = <&gpiof 15 GPIO_ACTIVE_HIGH>; /* P_EN */ iridium-enable-gpios = <&gpiof 14 GPIO_ACTIVE_HIGH>; /* I_EN */ diff --git a/samples/shell/boards/stamp_c3.overlay b/samples/shell/boards/stamp_c3.overlay index 224fde4..7018d4b 100644 --- a/samples/shell/boards/stamp_c3.overlay +++ b/samples/shell/boards/stamp_c3.overlay @@ -65,7 +65,7 @@ current-speed = <230400>; status = "okay"; - rockblock { + rb9704: rockblock { compatible = "rock7,rockblock-9704"; power-gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>; /* P_EN */ iridium-enable-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; /* I_EN */ diff --git a/samples/shell/boards/xiao_esp32s3_procpu.overlay b/samples/shell/boards/xiao_esp32s3_procpu.overlay index 89689b2..5e3131b 100644 --- a/samples/shell/boards/xiao_esp32s3_procpu.overlay +++ b/samples/shell/boards/xiao_esp32s3_procpu.overlay @@ -23,7 +23,7 @@ current-speed = <230400>; status = "okay"; - rockblock { + rb9704: rockblock { compatible = "rock7,rockblock-9704"; }; }; diff --git a/samples/shell/no-control-pins.overlay b/samples/shell/no-control-pins.overlay new file mode 100644 index 0000000..7f3d567 --- /dev/null +++ b/samples/shell/no-control-pins.overlay @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: MIT + * Copyright (c) 2026 Scott Penrose + * + * The modem on TX and RX alone: P_EN, I_EN and I_BTD taken out of the + * board overlay's node, for a modem wired with four wires. The module + * then takes it to be powered, as the RockBLOCK is with the pins open. + * + * west build -b stamp_c3 samples/shell -- \ + * -DEXTRA_DTC_OVERLAY_FILE=no-control-pins.overlay + */ +&rb9704 { + /delete-property/ power-gpios; + /delete-property/ iridium-enable-gpios; + /delete-property/ booted-gpios; +};