diff --git a/.github/scripts/collect_fixtures.py b/.github/scripts/collect_fixtures.py index fa5228c..dc76c5a 100644 --- a/.github/scripts/collect_fixtures.py +++ b/.github/scripts/collect_fixtures.py @@ -245,6 +245,8 @@ def is_serial_recovery(config: str) -> bool: True >>> is_serial_recovery("serial_recovery_buf512") True + >>> is_serial_recovery("serial_recovery_raw") + True >>> is_serial_recovery("serial") False >>> is_serial_recovery("serial_buf512") diff --git a/.github/scripts/test_collect_fixtures.py b/.github/scripts/test_collect_fixtures.py index 5b8b9e0..ba01196 100644 --- a/.github/scripts/test_collect_fixtures.py +++ b/.github/scripts/test_collect_fixtures.py @@ -416,6 +416,34 @@ def test_process_serial_recovery_buffer_matrix_mps2(tmp_path: Path) -> None: assert entry.qemu_cmd.count("-device loader") == 2 +def test_process_serial_recovery_raw_mps2(tmp_path: Path) -> None: + """Raw variant: the app's raw-UART transport makes the entry serial_raw while + it stays a two-loader serial-recovery mcuboot image.""" + out = tmp_path / "out" + out.mkdir() + build_dir = make_build_dir( + tmp_path, + "smp_server.fixture.serial_recovery_raw.mps2_an385", + files={ + "mcuboot/zephyr/zephyr.hex": "x", + "smp-server/zephyr/.config": ( + "CONFIG_UART_MCUMGR_RAW_PROTOCOL=y\n" + "CONFIG_MCUMGR_TRANSPORT_RAW_UART=y\n" + "CONFIG_MCUMGR_GRP_IMG=y\n" + ), + "smp-server/zephyr/zephyr.signed.bin": "x", + }, + ) + entry = cf.process_build_dir(build_dir, "4.4.0", "05e7c6bddead", out) + assert entry is not None + assert entry.config == "serial_recovery_raw" + assert entry.transport == "serial_raw" + assert entry.serial_recovery is True + assert entry.mcuboot is True + assert entry.qemu_cmd is not None + assert entry.qemu_cmd.count("-device loader") == 2 + + def test_process_serial_recovery_mps2_elf_fallback(tmp_path: Path) -> None: # A recovery build without the mcuboot hex still ships MCUboot's elf as a # single-loader -kernel image (the .signed.bin remains the upload payload). diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ab3a91a..a3eefc6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -89,7 +89,11 @@ jobs: # Canonical names + manifest are produced by a typed, unit-tested # script (.github/scripts/); the check-script job gates it on ruff + # mypy --strict + pytest. west stays here: it must run in the workspace. + # The zephyr label is a release tag verbatim (e.g. 4.4.0); a pinned main + # commit (we track a post-v4.4.0 main SHA for mcuboot#2755's raw serial + # recovery) is shortened to 12 chars so fixture names stay readable. ver=$(west list zephyr --format='{revision}'); ver=${ver#v} + if [ "${#ver}" -ge 40 ]; then ver=${ver:0:12}; fi uv run .github/scripts/collect_fixtures.py \ --git-sha "$GITHUB_SHA" --zephyr-version "$ver" \ --leg "${{ matrix.leg }}" --twister-out twister-out --out-dir fixtures diff --git a/README.md b/README.md index f69b23b..81d5571 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ ships a machine-readable [`manifest.json`](#manifest) describing every fixture. | **`serial_fs`, `udp_fs`** | native_sim | littlefs mounted at `/lfs1` for fs-group file upload/download. | | **`serial`** (roomy) | mps2 | Cortex-M3, 4 MB SRAM via a flash overlay: one runnable image with **every** non-img group, fs file round-trips, and large buffers. | | **`serial_recovery`** | mps2 | Do-it-all MCUboot RAM_LOAD image — boots **straight into the full app** (every group incl. img) serving SMP on uart0 and logging on uart1. `os reset boot_mode=1` re-enters MCUboot **serial recovery** on demand; an upload there persists across the soft reset (slots live in a non-erased RAM-backed flash simulator). Launched with two QEMU loaders: the MCUboot `.hex` plus the `.signed.bin` dropped into slot0. | +| **`serial_recovery_raw`** | mps2 | The `serial_recovery` image, but both MCUboot recovery and the app speak the **raw** (non-console) SMP serial encoding — no base64/CRC/console framing, packets framed by the SMP header length (`CONFIG_BOOT_SERIAL_RAW_PROTOCOL` + `CONFIG_UART_MCUMGR_RAW_PROTOCOL`). For testing a client's raw serial transport against a real recovery server. Same two-loader launch as `serial_recovery`. | | **`serial`** | qemu_cortex_m0 | Merged MCUboot + signed app — exercises the img (DFU) group under emulation. | | **`serial`, `ble`, `serial_recovery`** | nrf52840dk | Build-only images for a hardware bench. | diff --git a/apps/smp-server/sample.yaml b/apps/smp-server/sample.yaml index 6a46e96..55a9e28 100644 --- a/apps/smp-server/sample.yaml +++ b/apps/smp-server/sample.yaml @@ -444,6 +444,44 @@ tests: - &mps2_doitall_mcuboot_log mcuboot_CONFIG_LOG_DEFAULT_LEVEL=4 - &mps2_doitall_mcuboot_dbg mcuboot_CONFIG_MCUBOOT_LOG_LEVEL_DBG=y + # Raw (non-console) variant of the do-it-all recovery fixture: identical RAM_LOAD + # two-UART design, but both MCUboot recovery and the app speak the raw SMP serial + # encoding (no base64/CRC/console framing) instead of SMP-over-console -- for + # smpclient's SMPSerialRawTransport against a real recovery server (mcu-tools/ + # mcuboot#2755, intercreate/smpclient#106). mcuboot_CONFIG_BOOT_SERIAL_RAW_PROTOCOL + # is MCUboot's counterpart of the app's CONFIG_UART_MCUMGR_RAW_PROTOCOL; both drop + # base64/CRC and frame packets by the SMP header length. The app swaps serial.conf + # for raw_serial.conf (raw transport on uart0); ramload.conf is still last, so it + # restores the uart1 console/log that raw_serial.conf turns off for a single-UART + # target. Same serial_recovery_* two-loader scheme (MCUboot's code-only hex plus + # the signed app dropped into slot0's RAM-backed sim-flash). + smp_server.fixture.serial_recovery_raw.mps2_an385: + sysbuild: true + platform_allow: [mps2/an385] + integration_platforms: [mps2/an385] + extra_args: + - *mps2_doitall_suffix + - >- + EXTRA_CONF_FILE="raw_serial.conf; + grp_os.conf; + grp_fs.conf; + grp_shell.conf; + grp_stat.conf; + grp_settings.conf; + grp_enum.conf; + grp_zbasic.conf; + grp_img.conf; + ramload.conf" + - *mps2_doitall_overlay + - *mps2_doitall_mcuboot + - *mps2_doitall_ramload + - *mps2_doitall_unsigned + - *mps2_doitall_hex + - *mps2_doitall_log + - *mps2_doitall_mcuboot_log + - *mps2_doitall_mcuboot_dbg + - mcuboot_CONFIG_BOOT_SERIAL_RAW_PROTOCOL=y + # mps2/an385 buffer-size matrix on the do-it-all RAM_LOAD image: the same # every-group-incl-img recovery fixture above, swept across # CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE. mps2's UART paces the link (no PTY-burst diff --git a/west.yml b/west.yml index 7b3259b..6393624 100644 --- a/west.yml +++ b/west.yml @@ -10,7 +10,7 @@ manifest: projects: - name: zephyr remote: zephyrproject-rtos - revision: v4.4.0 + revision: f33aa2bc4a430e0a330a30cde38c35aea184962a import: name-allowlist: - cmsis_6