zbus: Add linker support, documentation and linum-stm32h753bi configuration - #20027
Open
JorgeGzm wants to merge 2 commits into
Open
zbus: Add linker support, documentation and linum-stm32h753bi configuration#20027JorgeGzm wants to merge 2 commits into
JorgeGzm wants to merge 2 commits into
Conversation
NuttX-side support for the zbus message bus port (apps/system/zbus in nuttx-apps), built on the link-time iterable sections infrastructure added in a companion PR: - include/nuttx/linker/common-rom.ld and common-insert.ld: register the zbus channel, observer and channel observation iterable sections (ITERABLE_SECTION blocks guarded by CONFIG_ZBUS, no-op otherwise) for the include and the zero-touch INSERT modes respectively; common-ram.ld: note that zbus needs no RAM sections. - Documentation/applications/system/zbus: Sphinx documentation for the zbus application, with the upstream Zephyr diagrams (Apache-2.0). - .codespellrc: skip the reused zbus SVG diagrams (embedded base64 raster data trips the spell checker). Assisted-by: Claude Code Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
Adopt the zbus message bus on the linum-stm32h753bi (first adopter board): - scripts/flash.ld: include the iterable sections common fragments (2 lines: common-rom.ld inside .text, common-ram.ld inside .data). - configs/zbus/defconfig: board configuration enabling zbus with all observer types, the zbus example and its cmocka test suite (./tools/configure.sh linum-stm32h753bi:zbus). - Board documentation: describe the new configuration. Validated on hardware: the 16-test cmocka suite passes twice in the same boot and the zbus example produces the expected output. Assisted-by: Claude Code Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
JorgeGzm
requested review from
hartmannathan,
jerpelea,
linguini1 and
rcsim
as code owners
August 31, 2026 23:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Integration of the zbus message bus port (apache/nuttx-apps#3743) on
top of the iterable sections infrastructure (#19927, merged), in two
commits (NuttX-side zbus support, then the board adoption):
ITERABLE_SECTION()blocks,guarded by
CONFIG_ZBUS, ininclude/nuttx/linker/common-rom.ld(include mode) and
common-insert.ld(zero-touch INSERT mode ofinclude/nuttx: Add link-time iterable sections infrastructure #19927); plus the zbus Sphinx documentation.
#includelines in
flash.ldand azbusboard configuration enabling thezbus example, its cmocka test suite and the OS test (
ostest),reproducible with
./tools/configure.sh linum-stm32h753bi:zbus.This resubmits the content of #19916, which was merged and then reverted
in #20009 because it landed before apache/nuttx-apps#3743: the board
configuration enables
CONFIG_EXAMPLES_ZBUSandCONFIG_TESTING_ZBUS,which only exist once the application side is in. Both dependencies are
declared with
depends-on:lines, and this PR should only be mergedafter both of them.
Impact
linum-stm32h753bi through the new
:zbusconfiguration; any otherboard can adopt it the same way (two linker-script lines, or the
INSERT mode with no board edit).
nothing unless
CONFIG_ZBUSis enabled (verified: the stock:nshmap has zero zbus sections).
hook lives in include/nuttx: Add link-time iterable sections infrastructure #19927); Make and CMake both supported for the include
mode.
zbusentry in theboard configuration list.
.codespellrcskip list (their embedded base64 raster data trips thespell checker with false positives).
Testing
Host: Ubuntu 24.04.4 x86_64, arm-none-eabi-gcc 13.2.1 (GNU ld 2.41).
Target: linum-stm32h753bi (STM32H753BI), built with #19927 and
apache/nuttx-apps#3743 applied (as CI does).
Stock
:nshbuild: no zbus references in the map or in thepreprocessed linker script (no-op proof).
:zbusbuild (Make and CMake): OK, the three_zbus_*_listsectionscollected name-sorted in flash as required by the zbus VDED algorithm.
On hardware (ST-LINK V3): the 17-test zbus cmocka suite passes twice
in the same boot and the
zbusexample produces the expected output,with the fourth message correctly masked for the listener and the
listener notified before the subscriber:
osteston the same boot, after the zbus suite (the zbus asynclistener task stays alive throughout):
ostest_main: Exiting with status 0, no failures.INSERT mode:
common-insert.ldpreprocessed withCONFIG_ZBUSexpandsto the three zbus
ITERABLE_SECTIONblocks inside.iterable_sections(
INSERT AFTER .text) and to an empty section without it;common-rom.ldexpands to nothing in that mode.tools/checkpatch.sh -c -u -m -gon both commits (nxstyle +codespell, same flags as CI): all checks pass.
sphinx-build -W:clean.
Depends-On #20015
Depends-On apache/nuttx-apps/pull/3743