Skip to content

zephyrSerial: provide ARDUINO_ROUTER_SERIAL from DTS#370

Open
pillo79 wants to merge 5 commits intoarduino:mainfrom
pillo79:router-serial
Open

zephyrSerial: provide ARDUINO_ROUTER_SERIAL from DTS#370
pillo79 wants to merge 5 commits intoarduino:mainfrom
pillo79:router-serial

Conversation

@pillo79
Copy link

@pillo79 pillo79 commented Feb 27, 2026

This PR tries to provide an ARDUINO_ROUTER_SERIAL #define for the Arduino UNO Q from the DeviceTree Zephyr code, to be used to customize the library compilation stage and allow Serial to be exported to sketches.

Requires:

DNM until above PRs are merged and the last 'wip' commit is removed. EDIT: Blocker PRs merged!

@per1234 per1234 added the enhancement New feature or request label Feb 28, 2026
@pillo79 pillo79 force-pushed the router-serial branch 13 times, most recently from f8add01 to bf18e46 Compare March 6, 2026 17:39
@pillo79 pillo79 force-pushed the router-serial branch 7 times, most recently from ea09a82 to 4b5ef3d Compare March 10, 2026 13:40
@CLAassistant
Copy link

CLAassistant commented Mar 18, 2026

CLA assistant check
All committers have signed the CLA.

pillo79 added 5 commits March 19, 2026 11:59
This commit rewrites the serial port definition logic based on the DT
config. From the DT definition, the number of generic serial instances
is determined, and the Serial object(s) are declared accordingly. The
indexes of the serial instances are determined by a mapping function so
that the 'Serial' instance can be skipped if desired (e.g. when
SerialUSB is used).

The common parts are factored out to a single macro that is used to
declare all the serial instances.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Export two macros that automatically map to Serial objects depending on
the current board's DT configuration:

- ARDUINO_CONSOLE_SERIAL: Serial object used for the Zephyr console

- ARDUINO_HARDWARE_SERIAL: First generic Serial object (usually on pins
  D0/D1)

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This commit adds a conditional include for "postvariant.h" in the
Arduino.h header file. If it exists, it will be included after the main
Arduino definitions. This allows for additional variant-specific
configurations or overrides to be applied without modifying the core
Arduino.h file directly.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
If the board has an 'arduino,router-serial' node, then the functionality
of the 'Serial' object is actually provided by the 'Monitor' object in
the Arduino_RouterBridge library.

Define the property for the UNO Q board and make sure the library is
always included in every sketch so that the 'Serial' object is properly
defined. A stub header is provided in the 'libraries/stubs' folder to
handle the case of the library not being installed, so that the core can
be used without requiring the installation of the libray.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
The real DebugLog library is currently not compatible with the UNO Q.
Until a fix is implemented, this commit adds a shadow header that
disables all logging and assertions.

Include this only on the UNO Q artifact.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
@github-actions
Copy link

Built 0.53.2-0.dev+309853bb

CI run PASSED 🟢

ArtifactBoardCoreTestsRAMSketchesWarningsErrors
zephyr_contrib ek_ra8d1 📗

11.9%

2--
frdm_mcxn947 3 🏷️

58.0%

2--
frdm_rw612 1 🏷️

83.0%

2--
✔️* zephyr_main giga 4 🏷️ ✅*

54.5%

448-
nano33ble 1 🏷️ ✅*

78.7%

228-
nano_matter 📗 ✔️*

⚠️ 85.7%

208(2*)
niclasense 2 🏷️ ✅*

⚠️ 87.3%

208-
opta 4 🏷️ ✔️*

46.7%

548(2*)
portentac33 3 🏷️ ✔️*

⚠️ 95.1%

568(8*)
portentah7 3 🏷️ ✔️*

47.3%

588(2*)
✅* zephyr_unoq unoq 📗 ✅*

26.4%

628-
Legend

BoardTestStatus description
🔥 🔥 Test run failed to complete.
🔴 Test completed with unexpected errors.
✔️* 🚫 Test completed with errors, but all are known/expected.
✅* 🟡 Test completed with some warnings; no errors detected.
🟢 Test passed successfully, with no warnings or errors.
🌑 🌑 Test was skipped.

@pillo79 pillo79 marked this pull request as ready for review March 19, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants