Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

system.toml keys

Reference · Level 3: Production and tuning

The keys a bringup’s system.toml takes for an image, the files beside it, and a bridge binary’s nros-bridge.toml. The page is hand-kept; a gate holds the [image.<id>] table’s key set to the CLI’s own schema, both ways, so a key the CLI accepts cannot be missing here and a key it refuses cannot be listed. The Kconfig symbols an image can also set are in Configuration surface.

Where each setting lives

FileOwnsPer
system.tomlThe deployment: [system] (RMW, domain, capability features, [safety], sched tasks), [[component]] (what runs), and one [image.<id>] per target with its .run, .flash, .console and .knobs tables. One schema for Rust, C and C++bringup package
Cargo.tomlRust toolchain facts only: the crate, its language dependencies, the RMW feature menu. No board, no target tripleRust node package
CMakeLists.txtC and C++ toolchain facts only: targets and language dependencies. No platform, board or RMW set()C or C++ node package
package.xmlPackage identity and message <depend>severy package
build/<coord>/<image>_entry/nros-cargo.tomlGenerated, never edited: target, runner, rustflags, cross compiler, derived pool sizes as [env], the nros-* profiles, the [patch.crates-io] rowsimage
config.tomlHand-written no_std apps with their own main() only: [node], [<interface>], [network.<name>]application

A system.toml beside a Cargo.toml or CMakeLists.txt is refused. Precedence, highest first: a command-line or build flag, [image.<id>], [system], the board descriptor’s [knobs], the built-in default. nros config show prints the resolved values with where each came from.

[image.<id>]

KeyMeaning
boardnano-ros board id, resolved through the board catalog. Never a framework’s own board string
frameworkThe entry framework the image boots with (owned-spin, rtic). Absent: the board’s first listed framework. zephyr is refused: a Zephyr board decides its entry shape
link"static" (the default) or "dynamic", on a cross Linux board (linux-aarch64-musl). A static image is one self-contained ELF that needs nothing on the device. A dynamic one is linked against the device’s C library and loaded by its dynamic loader, which an image that links a vendor’s shared libraries needs. The Rust runtime and the C/C++ link switch together. After the link, the build reads the ELF: a static image that names a program interpreter or needs a library is refused, naming link = "dynamic". A dynamic image’s libraries are looked up in the sysroot where the device’s loader would look, and each symbol it needs must be exported by one of them. One the device’s C library is too old for, or a library missing from the sysroot, stops the build. A sysroot with no device C library is reported “not verified”. A dynamic image needs the device’s sysroot, stated as [sources] sysroot-linux-aarch64-musl = "<dir>" in the bringup’s system.toml or as $NROS_SYSROOT_LINUX_AARCH64_MUSL. The build refuses one that states neither. The link searches the sysroot’s lib/ and usr/lib/, and the C/C++ compile its usr/include after the C library’s own headers, so a node can include a vendor header and name a vendor library in its own CMakeLists.txt. Refused on every other board, whose images link one way only
launchLaunch file, relative to the bringup. Absent: [system] default_launch
argsLaunch arguments bound at resolve time, such as { host = "robot1" }
rmwBackend for this image. Absent: [system] rmw
domain_id, locatorOverride [system]’s. locator is what the image dials. On a linux image, $ROS_DOMAIN_ID / $NROS_LOCATOR override them at run time, and the image warns at boot naming both values when they differ
os_configLayer-1 files, in order: a board network file (.toml), Zephyr prj-*.conf or .overlay fragments. conf is read as its alias. Paths are relative; see “Where os_config files are found”
rmw_configThe middleware’s own file for this image, or { <domain> = "<file>" } per [[domain]]
panicPanic policy: platform, halt or own
before_boot"<pkg>::<fn>" the generated entry calls before the board boots. Rust only
profileBuild profile: a cargo profile (dev, release, nros-relwithdebinfo, nros-minsizerel, or one of your own) or a CMake build type (Debug, Release, RelWithDebInfo, MinSizeRel). Each pair names the same build. A CMake image builds its C, C++ and Rust with it. A cargo profile of your own has no build type there and is refused: drop profile from that image and set the type with nros build <image> -- -DCMAKE_BUILD_TYPE=<type>. A Zephyr image refuses profile and takes its optimisation from Kconfig. See Build profiles
variantFramework build variant (Zephyr prj_<buildtype>.conf)
featuresCapability axes for this image, added to [system]’s
build[image.<id>.build] cmake_args = ["-DFOO=ON", …]: arguments for every CMake configure of this image, one argument per entry, after [image_defaults.build]’s and before nros build --cmake-args=. The same rules as --cmake-args= apply: -D, -U, -W*, --log-level, --log-context and --debug-find only, and a name nros build passes itself or a -DCONFIG_* is refused, saying where it goes instead. There is no cargo_args: put features in the package’s manifest. Build arguments lists every rule
node_interfaces"stock" adds the node interfaces an rclcpp node has by default (the six parameter services, the /rosout publisher and the use_sim_time parameter with its /clock time source, i.e. the param_services, rosout and sim_time features) to this image; "none" removes them, even where [system] declared them. Also accepted in [system] and [image_defaults]; the most specific statement wins. Absent everywhere: "stock", so every image serves the six parameter services, publishes /rosout and declares use_sim_time unless it states "none". The exception is an image whose framework is "rtic": the RTIC entry cannot serve the parameter services, so such an image gets none of them unless a table states "stock" or its features name one, and the build then refuses it with the reason. A memory-tight image (one service server, as on the Pico W) states "none"
node_featuresCargo features of the image’s Rust node packages: "<feat>" in every node declaring it, "<pkg>/<feat>" in that node only. Refused on a C/C++ entry and for a feature no node declares
serdes, ros_editionSerialization provider and ROS edition. Absent: the [system] value
env{ NAME = "value" } for an application’s own build variable. A registry knob here is an error naming its knobs spelling
entryThe workspace package that is this image’s application, when it cannot be derived
producersfalse builds without the host board’s census recorder and profiler
runs_nano_rosfalse states that this image’s hand-written entry never initialises nano-ros (a test program that drives a device directly). Its census is then recorded empty without building or running the program on the host, and the image is sized for zero entities. Only an image sized by its owned entry’s census may state it (a hand-written entry on a cross board, in a bringup with no [[component]]); on any other image it is refused. Without it, such a program exits 0 in census mode with no census, and the configure refuses. true is the default. Never folded from [image_defaults]
params_files, ros_argsParameters and ROS arguments baked into the image for rclcpp::init
no_inventory"<reason>": why this image declares nothing to derive its pool sizes from (no contract wiring, no parameters), so it keeps the configured defaults by design. Optional: such an image gets a note either way, and this line records the reason in its place. An empty reason is refused, and so is the line on an image whose declarations DO derive its sizes. It never excuses a declaration that fails to derive: under NROS_PROBE_FAILURE=refuse (every fixture lane), that stops the build. Never folded from [image_defaults]
stack_floor_imageThe key its measured stack peak (an [[observed]] row) is filed under in config/stack-floors.toml, <template>/<lang>/<rmw>@<board>. nros new writes it; unset, the image is keyed <bringup>@<board>
stack_floor"check" (the default) or "raise". The floor is a heuristic: the deepest call path a walk of the compiled code finds, plus a margin, usually well above the stack the image really uses (A11). With "raise", a FreeRTOS image whose floor is above the stack it states is built once more at the floor instead of failing. The raise never lowers a stack, is worked out again on every build and is never stored. The build prints the value it used

Retired and refused by name: ip, gateway, netmask, transport, [image.<id>.net.<if>], and the old [deploy.<id>] table.

Folding over [image_defaults]

Kind of keyHow a specific block folds over the defaults
scalars (board, rmw, profile, …)replaced
node_featuresreplaced as a whole when the image states it
argsmerged
no_inventory, runs_nano_rosnever folded: each image states its own
os_config, featuresconcatenated, defaults first

[system] default_images = ["<id>", …] is what a bare nros build builds. Without it, a workspace with more than one image lists them and stops.

Images that never run together: [image_alternatives]

[image_alternatives]
fvp-tap = ["fvp-tap", "fvp-tap-stats", "fvp-tap-trace", "fvp-tap-trace-ring"]

Each key names a group; its value lists two or more images that are one host built different ways, of which only one is ever booted. Two images of one group may state the same static address and the same mac on a network; any other two images may not (see “Board network file” below). Membership is symmetric: no member is the base. Building several members is fine; building is not running. Nothing infers a group from image names, boards or os_config lists.

Refused, at parse: a member no [image.<id>] declares, an image in two groups (merge them), a group of fewer than two images, and an image listed twice in one group. A single-package leaf builds one image and refuses the table.

Sharing a fragment between bringups: include

A workspace with several bringups can state what they share once, in a fragment file, and name it from each bringup:

# src/pubsub_bringup/system.toml
include = ["../../shared/system-defaults.toml"]

[system]
name = "rust_pubsub"
default_launch = "system.launch.xml"
# shared/system-defaults.toml
[system]
rmw = "zenoh"
domain_id = 0

[image_defaults]
rmw = "zenoh"

examples/workspaces/rust shares one fragment between its five bringups this way. The rules:

Rule
Pathsinclude is a list of paths, each relative to the file that names it. A fragment may include further fragments.
Tablesmerge key by key, at every depth
A key in two filesrefused, naming both files. A fragment does not override the bringup, and the bringup does not override the fragment. A bringup that needs another value does not include that fragment.
[[component]], [[domain]], other arrays of tablesconcatenated: each include’s entries in the listed order, then the file’s own
A file reached twice, or through itselfrefused
Not in a fragment[system] name (the bringup names its system), [sources] and [tools] (this machine’s paths, read from the bringup’s own file)

Every road reads the expansion: nros build, the CMake configure, west and colcon. Editing a fragment rebuilds what it reaches, as editing the system.toml does. nros new --workspace --from refuses to move a system.toml that names fragments, because their paths are relative to it.

Where os_config files are found

The two kinds of file in os_config are looked up from different places:

FileLooked for in, first hit wins
Board network file (.toml)The directory of system.toml
Zephyr fragment (.conf, .overlay, .dts)<bringup>/boards/<board>/, then the west application’s directory, then the directory of system.toml

A generated application holds no files of yours, so a fragment is found beside system.toml. When entry names a west application of your own, a fragment with the same name in that application’s directory is used in place of the bringup’s. That is how a board or an application overrides a shared fragment.

Board network file

Named by os_config, beside system.toml. One table per interface, and any network other than the built-in qemu:

KeyTableMeaning
network[<if>]The network the interface is on. Default: the board’s (qemu on QEMU boards)
host[<if>]Last octet within the network’s subnet
address[<if>]Full IPv4, or "dhcp" on a network with dhcp = true
mac[<if>]Optional. Derived from the board’s mac_prefix and the image’s names when absent
vlan[<if>]Optional. An 802.1Q VLAN id, 1-4094, the interface’s traffic is tagged with. Taken only where the board’s interface states vlan = true (s32z270-rtu0-zephyr)
subnet, gateway[network.<name>]The network’s addressing. An interface never states them
dhcp[network.<name>]The network leases addresses

The built-in qemu network is QEMU user-mode networking, 10.0.2.0/24, with gateway and router host 10.0.2.2. An interface on qemu with no address takes 10.0.2.15. The resolved answer is written to build/nros/net/<image>.toml.

Refused, naming the image: an address outside its subnet or equal to the gateway; a network no file defines; two images with one static address or MAC on a network other than qemu, unless both are in one [image_alternatives] group; two files defining one network differently; a board network file on a board whose network belongs to the host OS (linux, freertos-posix, threadx-linux) or that declares no interfaces; an image on a network other than qemu with no locator, when its RMW’s descriptor states a host peer ([rmw.host] peer other than "none": zenoh, XRCE-DDS). A Cyclone DDS image has no router to name and is not refused.

On a Zephyr board

A Zephyr board takes a board network file once its [board.net] declares its interface (fvp-aemv8r-smp, mps2-an385-zephyr and s32z270-rtu0-zephyr do). nros build renders the resolved interface into Zephyr’s own Kconfig, build/nros/net/<image>.conf, appended last to EXTRA_CONF_FILE:

ResolvedRendered
any addressCONFIG_NET_CONFIG_SETTINGS=y, CONFIG_NET_CONFIG_AUTO_INIT=y, CONFIG_NET_CONFIG_NEED_IPV4=y
a static address (address or host)CONFIG_NET_DHCPV4=n, CONFIG_NET_CONFIG_MY_IPV4_ADDR, CONFIG_NET_CONFIG_MY_IPV4_NETMASK from the subnet
a network gatewayCONFIG_NET_CONFIG_MY_IPV4_GW
address = "dhcp"CONFIG_NET_DHCPV4=y, CONFIG_NET_CONFIG_MY_IPV4_ADDR=""

Zephyr configures the first auto-started interface at boot and, on a lease, waits for it (up to CONFIG_NET_CONFIG_INIT_TIMEOUT) before the application starts. Refused: a board or file with a second interface (Zephyr’s NET_CONFIG configures one; configure another in the application), a stated mac (the driver takes it from devicetree or generates one), and an os_config fragment that sets a rendered symbol, naming the fragment, the symbol, both values and the board network file. A symbol the file does not render, such as CONFIG_NET_DHCPV4_INITIAL_DELAY_MAX, stays the fragment’s.

An interface with a vlan tag keeps the address rows above, with these in place of NET_CONFIG_AUTO_INIT=y and NET_CONFIG_NEED_IPV4=y:

ResolvedRendered
vlan = <tag>CONFIG_NET_CONFIG_AUTO_INIT=n, CONFIG_NET_VLAN=y, CONFIG_NET_IF_MAX_IPV4_COUNT=2, CONFIG_NROS_NET_VLAN_TAG=<tag>

Zephyr’s VLAN is a virtual interface attached to the Ethernet one, and its own boot-time configuration (CONFIG_NET_CONFIG_MY_VLAN_ID) tags the Ethernet interface but still adds the address, or starts DHCPv4, on the untagged one. So the nros module does it instead, at the same init level: it tags the first Ethernet interface, makes the VLAN interface the default, and hands it to Zephyr’s net_config_init_by_iface with the rendered address or lease, which waits for the address up to CONFIG_NET_CONFIG_INIT_TIMEOUT. The untagged interface stays up with no address.

[image.<id>.run], .flash and .console

TableKeyMeaning
.runnic"slirp" (default on qemu), { bridge = "<dev>" } or { tap = "<dev>" }, for the first interface under QEMU or an Arm FVP. An FVP has no bridge mode, so it takes "slirp" or { tap = "<dev>" }
.run.fvpparamsArm FVP model parameters this image chooses, each as after -C: ["bp.pl011_uart1.out_file=trace.log"]. Read only on a board whose emulator is an FVP, and refused on any other. A parameter cannot hold whitespace or ;, so an out_file path with a space in it cannot be stated
.flashcommandReplaces the board’s flash method; {hex} and other placeholders are checked
.flashprepareHuman steps before flashing: { say = "…", wait_for = "<event>" }
.consolebaud, …Overrides a key of the board’s [board.console]

An image on a network other than qemu with no nic is physical only, and launching it under QEMU is refused.

On an Arm FVP board, the board’s own model parameters ([board.run.fvp] params in its descriptor) come first, then the image’s nic, then the image’s [image.<id>.run.fvp] params, which are [image_defaults.run.fvp]’s followed by its own. Each layer adds to the ones before it rather than replacing them. The model keeps the last value a parameter is given, so an image overrides a board parameter by naming it again. They are bound when the image is configured, so west build -t run and nros run boot the same model. The cost is that changing one, such as the TAP name, re-configures the image.

[image.<id>.test]

An image becomes a test by stating what its console must show. The keys are nros run’s grading flags, with the same meaning:

[image.linux.test]
expect = ["Publishing: 'Hello World: 1'"]
timeout = 30
KeyMeaning
expectLines of text. Each must appear on some console line, in any order
expect_regexAs expect, with regular expressions. Mixed with expect, every one must match
forbidText that fails the test the moment a line contains it, before or after the expectation is met
forbid_regexAs forbid, with regular expressions
settleOnce the expectation is met, keep watching this many seconds
timeoutSeconds to the expectation, or to the target’s end for a test that states only exit. Past it, the test fails. Default 60
exitThe exit code the target must end with, where it reports one

The image stays an ordinary image: nros build, nros run and nros flash treat it as before. A table that states neither an expectation nor exit is refused, since it could never fail, and so is [image_defaults.test]: a test is about one image’s output.

[image.<id>.can] and [canN]

The CAN frame driver (<nros/platform_can.h>) opens one default device, named in exactly one place, chosen by the board’s [board.net] stack:

Board stackThe device is named inIts rates live in
"host" (linux, freertos-posix, threadx-linux)[image.<id>.can] device = "vcan0" (or [image_defaults.can])the host OS (ip link)
"os" (Zephyr, native_sim too)the devicetree overlay in os_config: chosen { nros,can = &can1; };, default zephyr,canbusdevicetree (bus-speed, bus-speed-data)
"board" (FreeRTOS, ThreadX, bare metal)the board network file’s [canN] tablethe same table: bitrate, dbitrate
KeyTableMeaning
device[image.<id>.can]The host interface the driver opens. Host boards only
driver[image.<id>.can]"mock", the one backend an image chooses. Only on a board that runs as a host process: [board.run] host = true and no [board.flash] (linux, freertos-posix, threadx-linux, zephyr on native_sim)
bitrate[canN]The nominal bitrate, bit/s. Required
dbitrate[canN]The CAN FD data-phase bitrate, bit/s
frames[canN]With several [canN] tables, marks the one the driver opens

Every other backend is derived from the board, never stated. Refused, each naming the right home: device on an "os" or "board" board, a [canN] on a host or "os" board, driver = "mock" on a board that is not a host process, several [canN] with none marked (or more than one marked), any other driver, and a device on a board whose [board.net] links lack can. The resolved device rides NROS_IMAGE_NET as a can row and is written to build/nros/net/<image>.toml under [can]. The application opens it with nros_platform_can_open(&can, NULL, want_fd): on a host board the board hands the device to the SocketCAN backend at boot (a Rust entry), or a generated constructor does before main (a C or C++ entry). A second device is opened by its name instead of NULL.

The middleware’s own file

BackendDefault file, beside system.tomlSame document ROS 2 reads as
zenohrmw/zenoh.json5ZENOH_SESSION_CONFIG_URI
Cyclone DDSrmw/cyclonedds.xmlCYCLONEDDS_URI
XRCE-DDSnone: the endpoint is the image’s locator—

[system] rmw_config names another default file; [image.<id>] rmw_config names one image’s. A named file that does not exist is refused. An image with a zenoh file that also states a locator is refused. The flat rmw/zenoh.conf is retired.

[image.<id>.knobs.<group>]

The same shape as a board descriptor’s [knobs.<group>]. The key is the knob registry row’s board key where it has one (executor.max_cbs); otherwise the NROS_* name without NROS_, split at the first _ (NROS_EXECUTOR_MAX_SC is executor.max_sc). An unknown key, a wrong type or an out-of-range value stops nros build, naming the key. The image rung sits above the board and below an exported variable.

Standalone config.toml

TableKeys
[node]domain_id, locator
[<interface>]as the board network file, plus a board’s own facts ([uart0] baud, [eth0] device on ThreadX Linux)
[network.<name>]subnet, gateway
[node.rt.<rtos>]raw task priorities, such as app_priority, zenoh_read_priority on FreeRTOS

Read with Config::from_toml(include_str!("../config.toml")). A file in the retired [[transport]] shape panics at boot, naming the new spelling.

Cargo features of the nros crate

FeatureSelects
rmw-cffithe C-vtable RMW registry the backend registers into
platform-bare-metal, platform-freertos, platform-nuttx, platform-threadx, platform-zephyr, platform-posixthe platform
ros-humble, ros-ironthe ROS edition
std, allocoptional, by target

The generated entry selects these from the image. rmw in system.toml picks which linked backend is active.

nros-bridge.toml

A bridge binary’s own file, beside system.toml’s keys because it configures the same thing, a running image, but read at run time by the program, not by the build.

Consumed by nros::run_from_config (Rust) and the future C/C++ mirror (nros::run_from_config in nros-cpp).

Not the orchestration nros.toml. This is the bridge runtime config (multi-RMW byte forwarding). It is named nros-bridge.toml to avoid colliding with the orchestration nros.toml (component/system build config) — different lifecycle, different schema.

The file lives next to the binary (or anywhere the program can read it) and selects:

  1. Which RMW backends to open, under what locator / domain.
  2. How those backends are wired into bridge entries that forward traffic between them.

The binary’s Cargo.toml (or target_link_libraries) still selects which backends are linked — the TOML file selects which of the linked backends are used in this run. Backend names in the file that don’t match a linked backend surface as ConfigError::OpenSession.

Top-level structure

# nros-bridge.toml — sibling of the binary
[[node]]
name    = "field"
rmw     = "zenoh"
locator = "tcp/10.0.0.1:7447"

[[node]]
name    = "control"
rmw     = "cyclonedds"
locator = "domain=0"

[[bridge]]
type      = "std_msgs/Int32"
type_hash = "RIHS01_..."
from      = { node = "field",   topic = "/sensor/raw" }
to        = { node = "control", topic = "/sensor/raw" }

Run via:

fn main() -> Result<(), nros_bridge::ConfigError> {
    nros_bridge::run_from_config("nros-bridge.toml")
    // or, via the umbrella feature: nros::run_from_config("nros-bridge.toml")
}

[[node]]

One block per backend session. The first [[node]] becomes the primary session (extra_sessions[0] in Executor::open_multi); the rest open as extras keyed by rmw.

KeyTypeDefaultNotes
namestringrequiredLogical name. Bridge entries reference this.
rmwstringrequiredCanonical backend name: "zenoh", "xrce", "cyclonedds". Must match a backend the binary linked in.
locatorstring""Backend-specific locator. Zenoh uses tcp/..., udp4/..., serial/...; DDS uses domain=<n>; XRCE uses udp4://...:port.
domain_idu320ROS domain id passed to the backend.
namespacestring"/"Default namespace applied to handles created on this node.

Locator scheme grammar (zenoh)

SchemeExampleMeaning
tcp/<host>:<p>tcp/10.0.0.1:7447TCP unicast
udp/<host>:<p>udp/10.0.0.1:7447UDP unicast
serial/<dev>serial//dev/ttyUSB0UART (host-side) or board UART (bare-metal)
tls/<host>:<p>tls/router.example.org:7447TLS over TCP (requires link-tls on backend)

DDS / XRCE follow their native locator conventions; consult each backend’s docs for the exact form.

[[bridge]]

One block per topic forwarded between two [[node]]s. Each bridge creates a RawSubscription on the source side and an EmbeddedRawPublisher on the destination side and pumps bytes once per executor tick.

KeyTypeDefaultNotes
typestringrequiredROS type name ("std_msgs/Int32"). Backends use it for liveliness / discovery.
type_hashstring""ROS 2 RIHS type hash for the typed binding. May be left empty if both sides ignore it.
fromendpointrequired{ node = "<name>", topic = "<topic>" }. The source node + topic.
toendpointrequired{ node = "<name>", topic = "<topic>" }. The destination node + topic.

Bidirectional bridges are two [[bridge]] entries — one in each direction. The runtime stamps a bridge_origin attachment field on forwarded frames and drops on receive when the origin matches the local backend, so an echo pair does not loop.

Error semantics

run_from_config returns ConfigError:

VariantCause
IoFile read failed (missing / unreadable).
ParseTOML malformed or a required field missing.
UnknownNodeA [[bridge]] references a node name no [[node]] declared.
OpenSessionExecutor::open_multi rejected a spec — usually a backend name no RMW_INIT_ENTRIES entry registered under.
BuildNodecreate_node_on failed (registry exhausted, name too long, …).
BuildEntityCreating the source subscription or destination publisher failed (typically backend rejection of the topic name / type / QoS).

Any error short-circuits the runtime; bridges that opened cleanly before the failure are not pumped.

Linked-backend matrix

Backend nameCargo dep that contributes the RMW_INIT_ENTRIES entry
zenohnros-rmw-zenoh = { ... }
xrcenros-rmw-xrce-cffi = { ... }
cycloneddsnros-rmw-cyclonedds static lib (CMake side, --whole-archive)

Add a backend to your Cargo.toml (or target_link_libraries) to make its name available in the TOML; remove it to fence off use even when the TOML file lists it (yields OpenSession at startup).

Design background