From 6475620106ba9782d4125ee0e63349e622119ce0 Mon Sep 17 00:00:00 2001 From: Brandon Matthews Date: Wed, 20 Aug 2025 10:19:15 -0700 Subject: [PATCH 1/5] Add support for RP2350 aka Raspberry Pi Pico 2 This change adds very, very basic support for the Raspberry Pi Pico 2's RP2350 chip and its 4 MiB onboard flash. A new demo app is added with only jefe and idle tasks. --- Cargo.lock | 23 ++++++++++++++++ Cargo.toml | 1 + app/demo-pi-pico-2/Cargo.toml | 26 ++++++++++++++++++ app/demo-pi-pico-2/README.md | 3 +++ app/demo-pi-pico-2/app.toml | 25 ++++++++++++++++++ app/demo-pi-pico-2/build.rs | 7 +++++ app/demo-pi-pico-2/src/main.rs | 48 ++++++++++++++++++++++++++++++++++ boards/pi-pico-2.toml | 2 ++ build/kernel-link.x | 37 +++++++++++++++++++++++++- build/xtask/src/config.rs | 8 +++++- build/xtask/src/dist.rs | 9 ++++++- chips/rp235x/chip.toml | 7 +++++ chips/rp235x/memory.toml | 15 +++++++++++ chips/rp235x/openocd.cfg | 6 +++++ chips/rp235x/openocd.gdb | 12 +++++++++ drv/user-leds/src/main.rs | 3 +++ 16 files changed, 229 insertions(+), 3 deletions(-) create mode 100644 app/demo-pi-pico-2/Cargo.toml create mode 100644 app/demo-pi-pico-2/README.md create mode 100644 app/demo-pi-pico-2/app.toml create mode 100644 app/demo-pi-pico-2/build.rs create mode 100644 app/demo-pi-pico-2/src/main.rs create mode 100644 boards/pi-pico-2.toml create mode 100644 chips/rp235x/chip.toml create mode 100644 chips/rp235x/memory.toml create mode 100644 chips/rp235x/openocd.cfg create mode 100644 chips/rp235x/openocd.gdb diff --git a/Cargo.lock b/Cargo.lock index 3fb0fa3d22..37d4aa2652 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -874,6 +874,18 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "demo-pi-pico-2" +version = "0.1.0" +dependencies = [ + "build-util", + "cfg-if", + "cortex-m", + "cortex-m-rt", + "kern", + "rp235x-pac", +] + [[package]] name = "demo-stm32f4-discovery" version = "0.1.0" @@ -4539,6 +4551,17 @@ dependencies = [ "unwrap-lite", ] +[[package]] +name = "rp235x-pac" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffcb6931deee4242886b5a1df62db5e2555b0eb6ae1e8be101f3ea3e58e65c6" +dependencies = [ + "cortex-m", + "cortex-m-rt", + "vcell", +] + [[package]] name = "rsa" version = "0.9.0" diff --git a/Cargo.toml b/Cargo.toml index de44778dd5..73bad62767 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -132,6 +132,7 @@ stm32h7 = { version = "0.14", default-features = false } stm32g0 = { version = "0.15.1", default-features = false } strsim = { version = "0.10.0", default-features = false } syn = { version = "2", default-features = false, features = ["derive", "parsing", "proc-macro", "extra-traits", "full", "printing"] } +rp235x-pac = { version = "0.1.0", default-features = false } toml = { version = "0.7", default-features = false, features = ["parse", "display"] } toml_edit = { version = "0.19", default-features = false } vcell = { version = "0.1.2", default-features = false } diff --git a/app/demo-pi-pico-2/Cargo.toml b/app/demo-pi-pico-2/Cargo.toml new file mode 100644 index 0000000000..7b70389083 --- /dev/null +++ b/app/demo-pi-pico-2/Cargo.toml @@ -0,0 +1,26 @@ +[package] +edition = "2021" +readme = "README.md" +name = "demo-pi-pico-2" +version = "0.1.0" + +[dependencies] +cortex-m = { workspace = true } +cortex-m-rt = { workspace = true } +cfg-if = { workspace = true } +rp235x-pac = { workspace = true, features = ["rt"] } + +kern = { path = "../../sys/kern", default-features = false } + +[build-dependencies] +build-util = {path = "../../build/util"} + +# this lets you use `cargo fix`! +[[bin]] +name = "demo-pi-pico-2" +test = false +doctest = false +bench = false + +[lints] +workspace = true diff --git a/app/demo-pi-pico-2/README.md b/app/demo-pi-pico-2/README.md new file mode 100644 index 0000000000..d4914beeb6 --- /dev/null +++ b/app/demo-pi-pico-2/README.md @@ -0,0 +1,3 @@ +# Raspberry Pi Pico 2 demo application + +This is a minimal application to demonstrate support for the Raspberry Pi Pico 2. diff --git a/app/demo-pi-pico-2/app.toml b/app/demo-pi-pico-2/app.toml new file mode 100644 index 0000000000..83e22e7d00 --- /dev/null +++ b/app/demo-pi-pico-2/app.toml @@ -0,0 +1,25 @@ +name = "demo-pi-pico-2" +target = "thumbv8m.main-none-eabihf" +chip = "../../chips/rp235x" +board = "pi-pico-2" +stacksize = 944 + +[kernel] +name = "demo-pi-pico-2" +requires = {flash = 20000, ram = 1136} +stacksize = 640 + +[tasks.jefe] +name = "task-jefe" +priority = 0 +max-sizes = {flash = 4096, ram = 512} +start = true +stacksize = 352 +notifications = ["fault", "timer"] + +[tasks.idle] +name = "task-idle" +priority = 5 +max-sizes = {flash = 128, ram = 256} +stacksize = 256 +start = true diff --git a/app/demo-pi-pico-2/build.rs b/app/demo-pi-pico-2/build.rs new file mode 100644 index 0000000000..2800895934 --- /dev/null +++ b/app/demo-pi-pico-2/build.rs @@ -0,0 +1,7 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +fn main() { + build_util::expose_target_board(); +} diff --git a/app/demo-pi-pico-2/src/main.rs b/app/demo-pi-pico-2/src/main.rs new file mode 100644 index 0000000000..a44e43b2b0 --- /dev/null +++ b/app/demo-pi-pico-2/src/main.rs @@ -0,0 +1,48 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +#![no_std] +#![no_main] + +// We have to do this if we don't otherwise use it to ensure its vector table +// gets linked in. +use rp235x_pac as _; + +use cortex_m_rt::entry; + +/// Image definition to set up the chip for booting +/// +/// See datasheet 5.1.4 Image Definitions for more. These specific values come from +/// section 5.9.5. Minimum viable image metadata. +#[link_section = ".image_def"] +#[used] +pub static RP235X_IMAGE_DEF_ARM_MIN: [u32; 5] = [ + 0xFFFF_DED3, // START + 0x1021_0142, // PICOBIN_BLOCK_ITEM_1BS_IMAGE_TYPE, (EXE | S-mode | ARM | RP2350) + 0x0000_01FF, // PICOBIN_BLOCK_ITEM_2BS_LAST, (size=1 word) + 0x0000_0000, // next = self + 0xAB12_3579, // END +]; + +#[entry] +fn main() -> ! { + let p = unsafe { rp235x_pac::Peripherals::steal() }; + + p.RESETS.reset().modify(|_, w| w.io_bank0().clear_bit()); + while !p.RESETS.reset_done().read().io_bank0().bit() {} + + // TODO fix/update this for RP2350 + let cycles_per_ms = if p.CLOCKS.clk_sys_ctrl().read().src().is_clk_ref() { + // This is the reset state, so we'll assume we launched directly from + // flash running on the ROSC. + 6_000 // ish + } else { + // This is _not_ the reset state, so we'll assume that the pico-debug + // resident debugger has reconfigured things to run off the 48 MHz USB + // clock. + 48_000 + }; + + unsafe { kern::startup::start_kernel(cycles_per_ms) } +} diff --git a/boards/pi-pico-2.toml b/boards/pi-pico-2.toml new file mode 100644 index 0000000000..eacf61fff4 --- /dev/null +++ b/boards/pi-pico-2.toml @@ -0,0 +1,2 @@ +[probe-rs] +chip-name = "rp235x" diff --git a/build/kernel-link.x b/build/kernel-link.x index 6585a54d5a..31a60c84f5 100644 --- a/build/kernel-link.x +++ b/build/kernel-link.x @@ -74,6 +74,17 @@ SECTIONS . = . + _HUBRIS_IMAGE_HEADER_SIZE; } > FLASH + /* Optional RP235x IMAGE_DEF block loop (tiny: typically 20 bytes) + We put it AFTER the header to preserve the bootloader invariant. + If no object defines .image_def, this section has size 0. */ + .image_def : + { + __image_def_start = .; + . = ALIGN(4); + KEEP(*(.image_def)); + __image_def_end = .; + } > FLASH + /* Explicitly place text at vector table + size of header, deliberately ignoring section alignment. This is important because the bootloader assumes that the header immediately follows the vector table; if something changes to cause that to not @@ -81,7 +92,10 @@ SECTIONS a difficult to understand linker failure, which will hopefully be somewhat improved by this comment. */ - PROVIDE(_stext = ADDR(.vector_table) + SIZEOF(.vector_table) + SIZEOF(.header)); + PROVIDE(_stext = ADDR(.vector_table) + + SIZEOF(.vector_table) + + SIZEOF(.header) + + SIZEOF(.image_def)); /* ### .text */ .text _stext : @@ -279,5 +293,26 @@ ASSERT(ADDR(.vector_table) % (1 << LOG2CEIL(SIZEOF(.vector_table))) == 0, " Vector table alignment too small for number of exception entires. Increase the alignment to the next power of two"); +/* --- optional safety checks for RP235x builds --- */ + +/* IMAGE_DEF must sit within first 4 KiB of the image */ +ASSERT(SIZEOF(.image_def) == 0 + || (__image_def_end - ADDR(.vector_table)) <= 0x1000, +"RP235x: IMAGE_DEF must be within the first 4 KiB of the image"); + +/* Guard against the header growing large enough to push IMAGE_DEF out of the first 4k */ +ASSERT(SIZEOF(.image_def) == 0 + || (SIZEOF(.vector_table) + SIZEOF(.header) + SIZEOF(.image_def)) <= 0x1000, +"Vector+header+IMAGE_DEF must fit in first 4 KiB"); + +/* Ensure it remains the expected n-byte form (adjust if items are added) */ +ASSERT(SIZEOF(.image_def) == 0 + || SIZEOF(.image_def) == 20, +"Unexpected IMAGE_DEF size; edit kernel-link.x if this change was expected"); + +/* Sanity: keep IMAGE_DEF before .text */ +ASSERT(SIZEOF(.image_def) == 0 + || ADDR(.image_def) < ADDR(.text), +"IMAGE_DEF must precede .text"); /* Do not exceed this mark in the error messages above | */ diff --git a/build/xtask/src/config.rs b/build/xtask/src/config.rs index 63b30e51e1..4afc51dc27 100644 --- a/build/xtask/src/config.rs +++ b/build/xtask/src/config.rs @@ -144,7 +144,13 @@ impl Config { let mut peripherals: IndexMap = { let chip_file = cfg.parent().unwrap().join(&toml.chip).join("chip.toml"); - let chip_contents = std::fs::read(chip_file)?; + let chip_contents = + std::fs::read(&chip_file).with_context(|| { + format!( + "could not find chip.toml at {}", + chip_file.display() + ) + })?; hasher.write(&chip_contents); toml::from_str(std::str::from_utf8(&chip_contents)?)? }; diff --git a/build/xtask/src/dist.rs b/build/xtask/src/dist.rs index c32425ad6f..ca29429c97 100644 --- a/build/xtask/src/dist.rs +++ b/build/xtask/src/dist.rs @@ -934,7 +934,13 @@ fn build_archive( archive.copy(openocd_cfg, debug_dir.join("openocd.cfg"))?; } archive - .copy(chip_dir.join("openocd.gdb"), debug_dir.join("openocd.gdb"))?; + .copy(chip_dir.join("openocd.gdb"), debug_dir.join("openocd.gdb")) + .with_context(|| { + format!( + "could not locate openocd.gdb at {}", + chip_dir.join("openocd.gdb").display() + ) + })?; let mut metadata = None; @@ -2009,6 +2015,7 @@ fn build( format!( "-C link-arg=-z -C link-arg=common-page-size=0x20 \ -C link-arg=-z -C link-arg=max-page-size=0x20 \ + -C link-arg=-Map=target/firmware.map \ -C llvm-args=--enable-machine-outliner=never \ -Z emit-stack-sizes \ -C overflow-checks=y \ diff --git a/chips/rp235x/chip.toml b/chips/rp235x/chip.toml new file mode 100644 index 0000000000..2a0262ad11 --- /dev/null +++ b/chips/rp235x/chip.toml @@ -0,0 +1,7 @@ +[resets] +address = 0x4002_0000 # 2.2.4. APB registers +size = 32 + +[sio] +address = 0xd000_0000 # 2.2.6. Core-local peripherals (SIO) +size = 512 diff --git a/chips/rp235x/memory.toml b/chips/rp235x/memory.toml new file mode 100644 index 0000000000..baaa60b2c5 --- /dev/null +++ b/chips/rp235x/memory.toml @@ -0,0 +1,15 @@ +[[flash]] +address = 0x1000_0000 # 2.2. Address map "XIP 0x10000000" +# NOTE: RP235x flash is external, so the value here is a property of the Pico 2, not the RP2350 +# itself. Update to suit your actual hardware. +size = 0x40_0000 # Pico 2 datasheet: "RP2350 microcontroller with 4 MB of flash memory" +read = true +execute = true + +[[ram]] +address = 0x2000_0000 # 4.2. SRAM "SRAM is mapped to system addresses starting at 0x20000000." +size = 0x8_2000 # 4.2. SRAM "There is a total of 520 kB (520 × 1024 bytes) of on-chip SRAM." +read = true +write = true +execute = true # 4.2. SRAM "you can use any bank to store processor code, data buffers, or a + # mixture of the two." diff --git a/chips/rp235x/openocd.cfg b/chips/rp235x/openocd.cfg new file mode 100644 index 0000000000..ecea2636ed --- /dev/null +++ b/chips/rp235x/openocd.cfg @@ -0,0 +1,6 @@ +gdb_port 3340 +telnet_port 4450 + +# OpenOCD configuration for the RP235x +source [find interface/cmsis-dap.cfg] +source [find target/rp2350.cfg] diff --git a/chips/rp235x/openocd.gdb b/chips/rp235x/openocd.gdb new file mode 100644 index 0000000000..282adfe7e5 --- /dev/null +++ b/chips/rp235x/openocd.gdb @@ -0,0 +1,12 @@ +target extended-remote :3333 + +# print demangled symbols +set print asm-demangle on + +# set backtrace limit to not have infinite backtrace loops +set backtrace limit 32 + +# detect hard faults +break HardFault + +monitor arm semihosting enable diff --git a/drv/user-leds/src/main.rs b/drv/user-leds/src/main.rs index f0f2032c92..47b2ec848b 100644 --- a/drv/user-leds/src/main.rs +++ b/drv/user-leds/src/main.rs @@ -667,6 +667,9 @@ fn led_toggle(led: Led) { gpio_driver.toggle(pin).unwrap_lite(); } +/////////////////////////////////////////////////////////////////////////////// +// End board-specific bits + mod idl { use super::LedError; From 5186a0132da30bdf6ee414efb041c93baf6ca2dd Mon Sep 17 00:00:00 2001 From: Brandon Matthews Date: Fri, 29 Aug 2025 09:30:36 -0700 Subject: [PATCH 2/5] Make the Pi Pico 2's external flash a bit more obvious The RP235x chips use external flash, which means the flash size is a property of the board. This change renames the `memory.toml` file to something that indicates more clearly that the setup is particular to the Pico 2 board. --- app/demo-pi-pico-2/app.toml | 1 + chips/rp235x/{memory.toml => memory-pico-2.toml} | 0 2 files changed, 1 insertion(+) rename chips/rp235x/{memory.toml => memory-pico-2.toml} (100%) diff --git a/app/demo-pi-pico-2/app.toml b/app/demo-pi-pico-2/app.toml index 83e22e7d00..5a63573f04 100644 --- a/app/demo-pi-pico-2/app.toml +++ b/app/demo-pi-pico-2/app.toml @@ -2,6 +2,7 @@ name = "demo-pi-pico-2" target = "thumbv8m.main-none-eabihf" chip = "../../chips/rp235x" board = "pi-pico-2" +memory = "memory-pico-2.toml" stacksize = 944 [kernel] diff --git a/chips/rp235x/memory.toml b/chips/rp235x/memory-pico-2.toml similarity index 100% rename from chips/rp235x/memory.toml rename to chips/rp235x/memory-pico-2.toml From 27d44dc37b788367a530cf733cb61ee78e7e3aea Mon Sep 17 00:00:00 2001 From: Brandon Matthews Date: Fri, 29 Aug 2025 13:30:29 -0700 Subject: [PATCH 3/5] Add test runner for RPi Pico 2 This change adds the test suite for the RPI, and tweaks the memory config to set RAM as XN so that the execdata test passes. --- Cargo.lock | 11 +++++ chips/rp235x/chip.toml | 5 +++ chips/rp235x/memory-pico-2.toml | 2 +- test/tests-pi-pico-2/Cargo.toml | 26 +++++++++++ test/tests-pi-pico-2/app-rp235x.toml | 67 ++++++++++++++++++++++++++++ test/tests-pi-pico-2/build.rs | 7 +++ 6 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 test/tests-pi-pico-2/Cargo.toml create mode 100644 test/tests-pi-pico-2/app-rp235x.toml create mode 100644 test/tests-pi-pico-2/build.rs diff --git a/Cargo.lock b/Cargo.lock index 37d4aa2652..04ce280a2a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6296,6 +6296,17 @@ dependencies = [ "lpc55-pac", ] +[[package]] +name = "tests-pi-pico-2" +version = "0.1.0" +dependencies = [ + "build-util", + "cfg-if", + "cortex-m", + "cortex-m-rt", + "kern", +] + [[package]] name = "tests-psc" version = "0.1.0" diff --git a/chips/rp235x/chip.toml b/chips/rp235x/chip.toml index 2a0262ad11..cb7ffbef04 100644 --- a/chips/rp235x/chip.toml +++ b/chips/rp235x/chip.toml @@ -5,3 +5,8 @@ size = 32 [sio] address = 0xd000_0000 # 2.2.6. Core-local peripherals (SIO) size = 512 + +[spi0] +address = 0x4008_0000 # 12.3.5 List of registers +size = 0x1000 +interrupts = { irq = 31 } # SPI0_IRQ from 3.2 Interrupts diff --git a/chips/rp235x/memory-pico-2.toml b/chips/rp235x/memory-pico-2.toml index baaa60b2c5..2415641561 100644 --- a/chips/rp235x/memory-pico-2.toml +++ b/chips/rp235x/memory-pico-2.toml @@ -11,5 +11,5 @@ address = 0x2000_0000 # 4.2. SRAM "SRAM is mapped to system addresses starting size = 0x8_2000 # 4.2. SRAM "There is a total of 520 kB (520 × 1024 bytes) of on-chip SRAM." read = true write = true -execute = true # 4.2. SRAM "you can use any bank to store processor code, data buffers, or a +execute = false # 4.2. SRAM "you can use any bank to store processor code, data buffers, or a # mixture of the two." diff --git a/test/tests-pi-pico-2/Cargo.toml b/test/tests-pi-pico-2/Cargo.toml new file mode 100644 index 0000000000..37387351a2 --- /dev/null +++ b/test/tests-pi-pico-2/Cargo.toml @@ -0,0 +1,26 @@ +[package] +edition = "2021" +readme = "README.md" +name = "tests-pi-pico-2" +version = "0.1.0" + +[dependencies] +cfg-if = { workspace = true } +cortex-m = { workspace = true } +cortex-m-rt = { workspace = true } + +kern = { path = "../../sys/kern" } + +[build-dependencies] +build-util = { path = "../../build/util" } + +# this lets you use `cargo fix`! +[[bin]] +name = "tests-rp235x" +path = "../../app/demo-pi-pico-2/src/main.rs" +test = false +doctest = false +bench = false + +[lints] +workspace = true diff --git a/test/tests-pi-pico-2/app-rp235x.toml b/test/tests-pi-pico-2/app-rp235x.toml new file mode 100644 index 0000000000..24751a94b4 --- /dev/null +++ b/test/tests-pi-pico-2/app-rp235x.toml @@ -0,0 +1,67 @@ +name = "tests-rp235x" +target = "thumbv8m.main-none-eabihf" +chip = "../../chips/rp235x" +board = "pi-pico-2" +memory = "memory-pico-2.toml" + +[kernel] +name = "demo-pi-pico-2" +requires = {flash = 19112, ram = 3328} +stacksize = 2048 + +[tasks.runner] +name = "test-runner" +priority = 0 +max-sizes = {flash = 16384, ram = 4096} +start = true +stacksize = 1904 + +[tasks.suite] +name = "test-suite" +priority = 2 +max-sizes = {flash = 65536, ram = 4096} +start = true +task-slots = ["assist", "idol", "suite", "runner"] +stacksize = 1504 +# this doesn't actually use SPI; we're just mapping that interrupt to test +# interrupt handling. chosen completely arbitrarily. +uses = ["spi0"] +notifications = ["test-irq"] +interrupts = {"spi0.irq" = "test-irq"} + +# This block is used to test the task_config macro +[tasks.suite.config] +foo = '"Hello, world"' +bar = 42 +baz = [1, 2, 3, 4] +tup = [[1, true], [2, true], [3, false]] + +[tasks.assist] +name = "test-assist" +priority = 1 +max-sizes = {flash = 16384, ram = 2048} +start = true +stacksize = 1504 + +[tasks.idol] +name = "test-idol-server" +priority = 1 +max-sizes = {flash = 4096, ram = 1024} +stacksize = 1024 +start = true + +[tasks.hiffy] +name = "task-hiffy" +priority = 3 +features = ["testsuite"] +max-sizes = {flash = 32768, ram = 32768 } +stacksize = 2048 +start = true +task-slots = ["suite", "runner"] + +[tasks.idle] +name = "task-idle" +priority = 4 +max-sizes = {flash = 128, ram = 128} +stacksize = 128 +start = true diff --git a/test/tests-pi-pico-2/build.rs b/test/tests-pi-pico-2/build.rs new file mode 100644 index 0000000000..2800895934 --- /dev/null +++ b/test/tests-pi-pico-2/build.rs @@ -0,0 +1,7 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +fn main() { + build_util::expose_target_board(); +} From 23db079b65a01b6d1b2dd2a68e0f7d472a735fa9 Mon Sep 17 00:00:00 2001 From: Brandon Matthews Date: Fri, 29 Aug 2025 19:45:35 -0700 Subject: [PATCH 4/5] Put the firmware map file in dist --- build/xtask/src/dist.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/xtask/src/dist.rs b/build/xtask/src/dist.rs index ca29429c97..35116dde98 100644 --- a/build/xtask/src/dist.rs +++ b/build/xtask/src/dist.rs @@ -2015,14 +2015,16 @@ fn build( format!( "-C link-arg=-z -C link-arg=common-page-size=0x20 \ -C link-arg=-z -C link-arg=max-page-size=0x20 \ - -C link-arg=-Map=target/firmware.map \ + -C link-arg=-Map={}/firmware.map \ -C llvm-args=--enable-machine-outliner=never \ -Z emit-stack-sizes \ -C overflow-checks=y \ -C metadata={} \ {} ", - cfg.link_script_hash, remap_path_prefix, + cfg.dist_dir.display(), + cfg.link_script_hash, + remap_path_prefix, ), ); cmd.arg("--"); From 198fc9c068240fbfe19258f8265d360f1c98249c Mon Sep 17 00:00:00 2001 From: Brandon Matthews Date: Fri, 29 Aug 2025 20:40:34 -0700 Subject: [PATCH 5/5] Typo fix in caboose doc --- doc/guide/caboose.adoc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/guide/caboose.adoc b/doc/guide/caboose.adoc index 23434bdb49..98ba2879a1 100644 --- a/doc/guide/caboose.adoc +++ b/doc/guide/caboose.adoc @@ -37,8 +37,8 @@ mapped as an MPU region. Only tasks declared in `caboose.tasks` are allowed to read data from the caboose region of flash. If other tasks attempt to read from this memory region, they will experience the typical memory fault. -The Hubris build system will populate the caboose with start and end words -(32-bit words) words, and a sequence of +The Hubris build system will populate the caboose with 32-bit start and end +words, and a sequence of https://github.com/oxidecomputer/tlvc[TLV-C] key-value pairs containing image metadata: @@ -48,12 +48,12 @@ metadata: | Type | Description -| **Start** -| `u32` +| **Start** +| `u32` | `abi::CABOOSE_MAGIC` -| `GITC` tag -| TLV-C +| `GITC` tag +| TLV-C | The current Git commit hash with an optional trailing "-dirty" if the repository contains uncommitted changes. @@ -74,7 +74,7 @@ if it was set. | `u8` | _(filled with `0xFF`)_ -| **End** +| **End** | `u32` | Caboose size (little-endian `u32`) |=== @@ -111,8 +111,8 @@ let caboose: Option<&'static [u8]> = drv_caboose_pos::CABOOSE_POS.as_slice(); can't know the caboose position until all tasks have been built) Besides the start and end words and the default metadata described above, the -Hubris build system is agnostic to any further contents of the caboose. A +Hubris build system is agnostic to any further contents of the caboose. A separate release engineering process may decide to store any arbitrary data in -the remaining space. The +the remaining space. The https://github.com/oxidecomputer/hubtools[`hubtools` repository] includes a library and CLI for modifying the caboose of a Hubris archive.