nuttx-apps/system
Jorge Guzman ee20ddd0ba system/zbus: Port the Zephyr zbus message bus to NuttX
Port of the Zephyr RTOS zbus (many-to-many message bus with typed
channels and decoupled observers), built entirely on native NuttX
primitives and preserving the original declarative API
(ZBUS_CHAN_DEFINE, ZBUS_LISTENER_DEFINE, ZBUS_SUBSCRIBER_DEFINE, ...).

Features: listeners (synchronous callbacks), subscribers (queue of
channel references), message subscribers (ordered message copies),
async listeners (callback on a dedicated task), runtime observers,
per-observation notification masks, observer enable/disable, message
validators, channel user data, publish statistics, lookup by
name/numeric id and channel/observer iteration.

Mapping to NuttX primitives:
- Channel/observer registration: link-time iterable sections
  (include/nuttx/iterable_sections.h); the observers of a channel are
  named after their position in the definition, so the linker sorts the
  notification order, and the declarative macros are built on
  nuttx/macro.h (CONCATENATE, FOREACH_ARG and the FOREACH_IDX_ARG added
  in a companion nuttx commit) rather than on a private macro engine.
  Notification masks live in .bss with their initial value preserved in
  ROM and applied on lazy init.
- Channel lock: sem_t (enable CONFIG_PRIORITY_INHERITANCE instead of
  the Zephyr priority-boost/HLP); timeouts are computed with the
  clock_timespec_* helpers from nuttx/clock.h.
- Subscriber queues: kernel message queues (file_mq_*) opened lazily
  via pthread_once, usable from any task; mq payload copying replaces
  the Zephyr net_buf machinery entirely.
- Async listeners: one task per listener (task_create, priority and
  stack size configurable) blocking on the listener queue; a task
  rather than a pthread so it outlives the first API caller.
- Timeouts: milliseconds with CLOCK_MONOTONIC deadlines
  (ZBUS_NO_WAIT/ZBUS_FOREVER).

Includes a runnable example (examples/zbus, CONFIG_EXAMPLES_ZBUS) and a
cmocka test suite (testing/zbus, CONFIG_TESTING_ZBUS) covering the full
API: 17/17 tests passing on linum-stm32h753bi hardware, including
multi-channel index grouping, mask semantics, runtime observer error
paths, notification order (the observers of a channel run in the order
they are listed, and an observation bound with ZBUS_CHAN_ADD_OBS() runs
after all of them), queue overflow/timeout semantics, async listener
bursts,
bit-exact float/double payload delivery across every observer type
(sensor-style messages with a float-math validator) and an
interrupt-driven publisher (kernel timer interrupt -> signal -> sampling
thread -> zbus_chan_pub, the recommended pattern for interrupt sources).

Requirements: FLAT build; CONFIG_MQ_MAXMSGSIZE >= pointer size +
CONFIG_ZBUS_MSG_SUBSCRIBER_MAX_MSG_SIZE for message subscribers; board
linker script including <nuttx/linker/common-rom.ld> or the generic
CONFIG_ITERABLE_SECTIONS_LINKER_INSERT mode.

Not ported: multi-domain proxy agent (experimental upstream); publishing
from interrupt handlers (userspace library: hand the data to a thread).

Documentation lives in the nuttx repository
(Documentation/applications/system/zbus).

Assisted-by: Claude Code
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-09-21 18:46:31 -03:00
..
adb fs: rename PSEUDOFS_SOFTLINKS to FS_LINKS 2026-08-27 13:31:34 +08:00
adcscope apps/system/adcscope: nxstyle fix Relative files path 2026-08-08 16:56:29 -03:00
argtable3 cmake: Use NUTTX(_DIR/_BINARY_DIR) instead of CMAKE(_SOURCE_DIR/BINARY_DIR) 2026-08-09 10:43:01 -03:00
batterydump system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
cdcacm include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
cfgdata mtd/nvs: modify config name to MTD_CONFIG_NVS part1 2026-02-02 11:01:19 +08:00
cle include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
composite include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
conntrack system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
coredump !apps: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-22 13:38:25 +08:00
cpuload system/cpuload: Fix application's Make.defs location 2025-02-20 08:34:52 +01:00
critmon system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
cu include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
curl system/curl: add a small curl-like HTTP client command 2026-07-20 10:21:57 +02:00
dd apps: Fix O_ACCMODE bitmask checks after Linux flag alignment 2026-06-30 12:19:58 -04:00
debugpoint system/debugpoint: fix bug the length option parsing error 2025-02-25 13:07:58 -03:00
dhcp6c include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
dhcpc system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
dumpstack system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
expat system/expat: add reusable XML parser package 2026-08-21 20:09:58 +08:00
fastboot system/fastboot: fix pre-existing nxstyle warnings 2026-09-16 00:09:34 +08:00
fdt apps: add missing module metadata for executable tools 2026-06-22 22:27:07 +08:00
flash_eraseall system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
flatbuffers system: Fix Kconfig style 2026-08-11 15:38:46 -04:00
gcov gcov: Output mode judgment is implemented in the kernel layer 2025-06-26 23:48:01 +08:00
gdbstub system/gdbstub: Add depends of LIB_GDBSTUB 2025-07-18 22:42:03 +08:00
gprof system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
grep system/grep: Add grep command with regex support 2026-09-09 10:34:10 +08:00
hex2bin system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
hexed system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
hostname system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
i2c include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
iptables iptables: add file lock to prevent concurrent overwrite 2026-01-15 17:20:03 +08:00
irtest system/irtest: Set irtest command line size to CONFIG_LINE_MAX 2026-04-24 14:58:05 +02:00
kbd system/kbd: inject keys into a uinput keyboard 2026-08-02 18:36:37 +08:00
libffi system/libffi: Add libffi package integration 2026-05-22 21:51:31 +08:00
libuv cmake: Use NUTTX(_DIR/_BINARY_DIR) instead of CMAKE(_SOURCE_DIR/BINARY_DIR) 2026-08-09 10:43:01 -03:00
lm75 system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
lsan testing: add missing header files 2026-01-26 19:32:27 +08:00
lzf system/lzf: Fix missing space in Kconfig help text. 2026-05-28 21:27:01 +02:00
mdio system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
microros system/microros: Add UDP and serial custom transport backends. 2026-06-02 00:15:25 +08:00
netdb system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
nsh system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
ntpc system/ntpc: update ntpc messages 2025-09-05 23:47:36 +02:00
nxcamera apps: Fix codespell warnings. 2026-05-22 13:39:04 +08:00
nxcodec system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
nxdiag cmake: Use NUTTX(_DIR/_BINARY_DIR) instead of CMAKE(_SOURCE_DIR/BINARY_DIR) 2026-08-09 10:43:01 -03:00
nxinit system/nxinit: add fallback option to resolve preset service conflict 2026-09-16 00:08:45 +08:00
nxlooper include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
nxmbclient modbus: add nxmodbus 2026-04-20 12:45:17 -03:00
nxpkg system/nxstore: add an LVGL app-store front end 2026-08-18 15:23:15 -03:00
nxplayer nxplayer: add tone cmd implementation 2026-08-05 12:35:26 +02:00
nxrecorder system: audio: parse command filenames with PATH_MAX 2026-07-11 12:40:07 -03:00
nxstore system/nxstore: add an LVGL app-store front end 2026-08-18 15:23:15 -03:00
ofloader !apps: Simplify NuttX initialization 2026-05-06 13:27:05 +08:00
ping system/ping: Fix a segmentation fault when using ping 2026-07-09 09:42:30 +08:00
ping6 system/ping: Fix a segmentation fault when using ping 2026-07-09 09:42:30 +08:00
popen apps: Fix O_ACCMODE bitmask checks after Linux flag alignment 2026-06-30 12:19:58 -04:00
psmq system/psmq: add proper include path for embedlog 2025-02-20 08:39:13 +01:00
ptpd netutils/ptpd: fix drift divergence and post-jump bootstrap 2026-09-15 09:09:00 -03:00
readline system/readline: add caller-selectable control handling 2026-08-24 22:15:31 +08:00
resmonitor system: resmonitor: check CPU load reads 2026-07-06 16:31:38 +08:00
sched_note system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
sensorscope system/sensorscope: support for fixe16 data 2026-05-06 08:54:32 +02:00
sensortest system/sensortest: Put a blank line after the declarations. 2026-09-20 09:24:47 -04:00
setlogmask system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
settings system/settings: Bound storage string handling 2026-05-28 14:35:54 +02:00
smf system: Fix Kconfig style 2026-08-11 15:38:46 -04:00
spi include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
stackmonitor system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
stty system: Add stty utility for terminal control 2026-08-14 07:51:00 -03:00
sudo system/sudo: add setuid privilege helper 2026-08-17 09:06:13 -03:00
syslogd system/syslogd: Initial implementation 2025-06-17 20:43:58 +08:00
system include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
taskset apps/system: replace CONFIG_NSH_LINELEN to LINE_MAX 2025-01-14 19:31:54 +08:00
tcpdump pkt: Set sll_protocol for raw socket to ETH_P_ALL 2026-01-04 21:41:21 +08:00
tee include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
telnet apps: Fix unchecked strdup()/asprintf() as requested in #1727 2026-05-23 16:30:52 -04:00
telnetd system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
termcurses include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
toybox system/toybox: Add toybox a tool box similar to busybox 2026-08-15 22:28:49 +02:00
trace apps/system/trace: support binary dump of noteram 2026-01-26 19:32:42 +08:00
ubloxmodem include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
uniqueid system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
uorb system/uorb: Select the printf extension the format strings need. 2026-09-20 22:30:19 +08:00
usbmsc apps: Fix O_ACCMODE bitmask checks after Linux flag alignment 2026-06-30 12:19:58 -04:00
vi include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
vncviewer system/vncviewer: Drain truncated desktop names 2026-07-09 09:28:13 +08:00
xipfs system/xipfs: Add a command to compact a xipfs volume and report it. 2026-07-28 16:47:49 +08:00
xrcedds system/xrcedds: add eProsima Micro XRCE-DDS 2026-09-15 09:14:39 -03:00
ymodem apps/system/ymodem: Optimized ymodem for burn during bootloader 2026-02-02 11:00:19 +08:00
zbus system/zbus: Port the Zephyr zbus message bus to NuttX 2026-09-21 18:46:31 -03:00
zlib cmake: Use NUTTX(_DIR/_BINARY_DIR) instead of CMAKE(_SOURCE_DIR/BINARY_DIR) 2026-08-09 10:43:01 -03:00
zmodem !apps: replace sclock_t with clock_t and drop redundant time_t/off_t casts 2026-05-11 17:38:32 +08:00
.gitignore Remove extra whitespace from files (#43) 2020-01-31 08:29:24 -06:00
CMakeLists.txt system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
Make.defs system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
Makefile system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00