Diagnostic codes
Every refusal nano-ros prints carries a code, NROS- and four digits:
error[NROS-0004]: src/demo_bringup/system.toml: names no board
help: add `board = "<board>"` to the `[image.<id>]` table in system.toml
explain: nros code show NROS-0004
The explain: line is a command: nros code show NROS-0004 prints the
code’s section below without a network or a checkout. A code never
changes its meaning, and a retired code names the one that replaced it.
| Code | What went wrong |
|---|---|
| NROS-0001 | ROS 2 is not sourced, and the project has messages to generate |
| NROS-0002 | an image names a board that no board descriptor claims |
| NROS-0003 | the workspace declares no image |
| NROS-0004 | an image names no board |
| NROS-0005 | a board’s platform reaches no built-in family |
| NROS-0006 | no diagnostic has this code |
| NROS-0011 | a knob is spelled with its retired name |
| NROS-0012 | an image’s env row sets a registry knob |
| NROS-0013 | an image names a retired host board key |
| NROS-0014 | an image states a framework its board does not boot |
| NROS-0015 | an image cannot build for its board |
| NROS-0016 | no build road takes this image’s languages to this board |
| NROS-0017 | the image’s RMW needs a capability the board lacks |
| NROS-0018 | the image’s network or link is not one the board carries |
| NROS-0019 | a tool the board builds with is not installed |
| NROS-0020 | the board’s vendor SDK root is not set |
| NROS-0021 | the image needs more RAM than the board has |
NROS-0001: ROS 2 is not sourced, and the project has messages to generate
nros configure, nros build or nros run stopped before building anything,
because this shell has not sourced ROS 2 and the project has messages to
generate.
nano-ros generates every message type a project uses (a talker’s std_msgs,
for example) from the message definitions of your ROS 2 install, so the types
and their hashes match your ROS 2 peers. It finds that install through
AMENT_PREFIX_PATH, which sourcing ROS 2 sets. A configure that ran in a
sourced shell records the prefix in the project, so later commands do not
need it; this project has no such record yet.
It happens on every board and every RMW, Linux and Cyclone DDS included.
How to fix it
Source ROS 2 once, in this shell, and run the same command again:
source /opt/ros/humble/setup.bash # or your overlay's install/setup.bash
nros build
That configure records the prefix in the project. Later builds and runs of the same project reuse it, from any shell, an IDE or a CI step. A new project records its own, so its first build needs a sourced shell again.
The refusal’s help line, unless the site gives a more specific one:
source ROS 2 in this shell (
source /opt/ros/<distro>/setup.bash, or your overlay’sinstall/setup.bash) and run the command again; later shells need not source it
NROS-0002: an image names a board that no board descriptor claims
An image names a board that no board descriptor claims, so nano-ros does not know what to build it for.
[image.<id>] board in a bringup’s system.toml is where an image names its
board. Each board crate ships a descriptor whose names list says which
spellings it answers to, and several are aliases for one board
(mps2-an385-baremetal, baremetal and bare-metal all name one
descriptor). A name that none of them lists is refused by name rather than
guessed at, because a guess builds the wrong image and reports success.
How to fix it
Check the spelling in system.toml:
[image.demo]
board = "mps2-an385-freertos"
nros board list prints every board this SDK has. If the board is your own,
its board package must be on the board search path.
The refusal’s help line, unless the site gives a more specific one:
check the spelling of the image’s
board;nros board listnames every board this SDK has
NROS-0003: the workspace declares no image
nros build (or a verb that resolves images) found no [image.<id>] in any
bringup package of the workspace, so there is nothing to build.
An image is the buildable unit of nano-ros: one board, one RMW, and the
components that run on it. It is declared in a bringup package’s
system.toml (a directory holding package.xml and system.toml, and no
code). A workspace whose bringup declares no image, or that has no bringup
package at all, has nothing for nros build to plan.
How to fix it
Add an image to the bringup package’s system.toml:
[image.demo]
board = "linux"
If the workspace has no bringup package yet, nros new <ws> --board <board> --template talker shows the shape, and nros configure --migrate moves a
system.toml that sits beside a package’s code into one.
The refusal’s help line, unless the site gives a more specific one:
add
[image.<id>] board = "<board>"to the bringup package’s system.toml
NROS-0004: an image names no board
An [image.<id>] table in system.toml has no board key, so nano-ros does
not know what to build the image for.
Every image names exactly one board. The board decides the target triple, the RTOS, the toolchain and the network setup; nothing else in the project can stand in for it.
How to fix it
Add the board to the image’s table:
[image.demo]
board = "mps2-an385-freertos"
nros board list prints the boards this SDK has.
The refusal’s help line, unless the site gives a more specific one:
add
board = "<board>"to the[image.<id>]table in system.toml
NROS-0005: a board’s platform reaches no built-in family
A board names a platform that is not one of nano-ros’s built-in platforms, and
the platform’s inherits chain does not reach one, so nano-ros does not know
which family’s build rules the platform takes.
A platform you add yourself (nros new platform) is described by its
nros-platform.toml. Its inherits key names the built-in family it builds
like (freertos, zephyr, bare-metal, and so on), directly or through
another platform that does. The refusal names the chain it followed, and says
which of these went wrong:
- the chain ends at a platform that inherits nothing;
- a name in the chain is neither built in nor answered by any
nros-platform.tomlon the platform search path; - the chain loops back on itself.
How to fix it
Add inherits to the platform the refusal names, choosing the built-in family
it is closest to:
# nros-platform.toml
inherits = "freertos"
A platform that does not exist yet is scaffolded with
nros new platform <name> --inherits <family>.
The refusal’s help line, unless the site gives a more specific one:
add
inherits = "<family>"to the platform’s nros-platform.toml
NROS-0006: no diagnostic has this code
nros code show (or its older spelling, nros explain) was given a code,
spelled NROS- and four digits, that no diagnostic has.
Every code nano-ros prints is compiled into the nros binary, so this one was
mistyped, or comes from a newer release than this binary. The refusal lists
the three codes nearest the one you gave.
How to fix it
Copy the code from the explain: line of the refusal that printed it. If it
came from a newer nano-ros, run that release’s nros code show.
A plan file that happens to be named like a code is reached as a path:
nros explain ./NROS-0412.
The refusal’s help line, unless the site gives a more specific one:
check the code against the refusal that printed it
NROS-0011: a knob is spelled with its retired name
A knob in system.toml is spelled with a name that has been retired. Each
knob has one current spelling; older spellings (ZPICO_MAX_QUERYABLES for
NROS_ZENOH_MAX_QUERYABLES, for example) are refused rather than read,
because two names for one setting is how a build ends up reading the one you
did not change.
The refusal points at the key in the file and names the current spelling.
How to fix it
Use the current spelling. nros fix does it for every retired spelling in
the workspace’s system.toml files: it prints the change first, and writes
it with --apply. A retired spelling in an image’s env table is moved to
the image’s knobs table under the knob’s current name (see NROS-0012), with
a value in an old unit converted (a _KB spelling’s value times 1024).
nros fix # show what would change
nros fix --apply # write it
A knob whose setting was removed outright, not renamed, has no current spelling. Its refusal names the reason instead, and the row has to be deleted by hand.
The refusal’s help line, unless the site gives a more specific one:
rename the key to the knob’s current spelling, which the refusal names;
nros fixdoes it
NROS-0012: an image’s env row sets a registry knob
An image’s env table in system.toml sets a knob that the knob registry
holds, such as NROS_ZENOH_MAX_QUERYABLES. A registry knob is stated in the
image’s knobs table instead, where its value is checked against the knob’s
type and range:
[image.talker.knobs.zenoh]
max_queryables = 12
The env row was deprecated in release 0.6.0 and is refused since, because a knob that can be set two ways is set the way you did not look at.
The same applies to a knob spelled with a retired name in an env table
(NROS-0011): it moves to the knobs table under its current name, and a value
in an old unit (KiB, 8-byte words) is converted.
How to fix it
nros fix moves each such row to its knobs table and converts the value:
it prints the change first, and writes it with --apply.
nros fix # show what would change
nros fix --apply # write it
A value that the knob’s type or range does not admit is not moved. The refusal says why; correct the value by hand.
The refusal’s help line, unless the site gives a more specific one:
move the row to the image’s
[image.<id>.knobs.<group>]table, which the refusal names;nros fixdoes it
NROS-0013: an image names a retired host board key
An image names native or posix as its board. Both were aliases of the
host board, whose one name is linux. They were retired because they claim
more than the board supports: native means every general-purpose host and
posix every POSIX system, while the host board uses Linux-only calls.
How to fix it
[image.talker]
board = "linux"
nros fix makes this change: it prints it first, and writes it with
--apply.
The refusal’s help line, unless the site gives a more specific one:
write
board = "linux";nros fixdoes it
NROS-0014: an image states a framework its board does not boot
An image’s framework ([image.<id>] framework, or [image_defaults])
names an entry framework its board cannot boot. The board definition
(nros-board.toml) is the authority, and the refusal points at both lines:
the image’s framework, and the board’s frameworks list.
Some boards decide their entry shape from their platform (a Zephyr board,
for example). An image on such a board states no framework at all.
How to fix it
Choose a framework from the board’s frameworks list, or remove the
framework line so the board’s first framework is used. If the image needs
a framework this board does not list, choose another board.
This needs a decision, so nros fix does not change it.
The refusal’s help line, unless the site gives a more specific one:
choose a framework from the board’s
frameworkslist, or remove the line so the board’s default is used
NROS-0015: an image cannot build for its board
An image cannot build for the board it names, and the reasons are listed
below the error, each with its own code and a fix: line.
Before it generates or compiles anything, nros build compares the image
with its board: the framework and entry the board boots, what the image’s
RMW needs from a board, the links and network the board carries, the tools
the board builds with, and the vendor SDK the board package names. It reports
every mismatch at once, so switching an image to another board shows the
whole list in one run instead of one failure per build. nros check --board <board> runs the same comparison without building.
The error names where the board came from (its descriptor file), so a board that exists in two places is not confused with the copy you edited.
How to fix it
Work through the listed reasons; each has its own explanation
(nros code show <code>). If most of them say the board lacks something, the
image probably wants a different board: nros board list names them all.
The refusal’s help line, unless the site gives a more specific one:
fix each reason listed, or choose a board that has what the image needs
NROS-0016: no build road takes this image’s languages to this board
No way of building takes this image’s languages to this board.
Each board is built along one road (cargo, CMake or west), chosen by its platform and entry shape. A road compiles a fixed set of languages, and an image whose packages are written in C or C++ needs a road that compiles them. When the board’s road cannot, there is no build to run, and nano-ros says so before starting one rather than failing later with an error about a tool.
How to fix it
Read the reason: it names the board’s road and the languages it lacks. Choose a board whose road compiles every language the image uses, or keep the C or C++ packages out of this image.
The refusal’s help line, unless the site gives a more specific one:
choose a board whose build road compiles every language the image uses, or move the image’s C or C++ code into a package for another image
NROS-0017: the image’s RMW needs a capability the board lacks
The image’s RMW backend needs a capability the board does not have.
Each RMW backend states what it needs from a board in its nros-rmw.toml:
[rmw.needs]
threads = true
heap = true
in the same words a board uses for what it has, in its nros-board.toml:
[board.capabilities]
heap = true
atomics = true
threads = false
A backend that runs its own threads cannot build for a board without them; it would fail at link time, or at run time, with a message about something else.
How to fix it
Choose an RMW the board can run: nros rmw list names every backend and the
boards each is verified on. Set it with rmw = "<name>" in the image’s
[image.<id>] table. Or choose a board that has the capability.
The refusal’s help line, unless the site gives a more specific one:
choose an RMW this board can run (
nros rmw list), or a board with the capability
NROS-0018: the image’s network or link is not one the board carries
The image’s network or link is not one its board can carry.
A board states the links it has in [board.net] links (ethernet, serial,
can, …). An image reaches its peers through its locator, whose scheme
names a link (tcp/… and udp/… need an IP link, serial/… a serial one).
The image’s address must also fit the network the board is on, and the RMW
must have a port for that link on the board’s platform.
How to fix it
Read the reason; it names the link or the address and what the board offers
(the board’s [board.net] links, in its nros-board.toml). Change the
image’s locator (or its [image.<id>.network]) to one the board carries,
or choose a board that has the link.
The refusal’s help line, unless the site gives a more specific one:
change the image’s
locatoror network to one the board carries (its[board.net] links), or choose a board that has the link
NROS-0019: a tool the board builds with is not installed
A toolchain or tool that the board builds with is not installed.
Each board names the compiler, the Rust target and the host tools its images need. They are checked before anything is generated, so a missing tool is reported by name, with the command that installs it, instead of as a compiler error halfway through a build.
How to fix it
Run the run: line printed under the reason. nros setup <board> installs
everything the board needs at once; nros doctor shows what is present.
The refusal’s help line, unless the site gives a more specific one:
run the
run:line the reason prints;nros setup <board>installs everything the board needs
NROS-0020: the board’s vendor SDK root is not set
The board package builds against a vendor SDK, and the environment variable that says where that SDK is installed is not set, or does not name a directory.
A board package that cannot ship its vendor’s SDK names the variable in its
nros-board.toml:
[board.sdk]
root_env = "ACME_SDK_ROOT"
and every build of an image for that board reads the SDK from there.
How to fix it
Install the vendor SDK, then export the variable in the shell you build from:
export ACME_SDK_ROOT=/opt/acme/sdk
The board package’s documentation says which SDK release it supports.
The refusal’s help line, unless the site gives a more specific one:
export the variable the reason names, set to the vendor SDK’s directory
NROS-0021: the image needs more RAM than the board has
The image needs more RAM than its board has.
A board states its memory in its nros-board.toml:
[board.memory]
flash = 4194304
ram = 4194304
Before anything is compiled, nros build adds up the RAM the image’s sizing
descriptor states in bytes: the stacks of the tasks its entry starts, the heap
it is configured with, and the rings that keep transient-local samples for
late joiners. That sum is a lower bound, “needs at least”, because most of
what an image uses is counted only by the linker. When even the lower bound
does not fit, the image cannot fit, and the build stops before compiling.
The exact figure comes after the link: nros build prints the image’s size
against the same budget.
How to fix it
Read the parts the reason lists, and lower the largest: a task’s stack, the
heap, or the depth of a transient-local publisher. Or choose a board with more
RAM; nros board list names them.
The refusal’s help line, unless the site gives a more specific one:
lower what the image states (task stacks, heap, transient-local depth), or choose a board with more RAM