Skip to content

Conversation

@soburi
Copy link
Member

@soburi soburi commented Feb 1, 2026

Bump cores/arduino to https://github.com/arduino/ArduinoCore-zephyr @0.53.1.

Including following features:

Including the following features:

  • Support for Serial USB
  • Support for DAC
  • ITOA implementation
  • C++ language support (abi/new)
  • Multithread support
  • UART Improvements

All of these are new features, and there is no downgrading of existing functionality.
It would be better to improve the #ifdef isolation in main.cpp, but there are no problems with operation as it is.

@soburi soburi force-pushed the bump_to_arduino_repo branch from 931e3d5 to f599674 Compare February 1, 2026 21:46
@soburi soburi changed the title Bump to arduino repo Bump to arduino-repo@0.53.0 Feb 1, 2026
@soburi soburi changed the title Bump to arduino-repo@0.53.0 Sync with arduino repo Feb 1, 2026
@soburi
Copy link
Member Author

soburi commented Feb 1, 2026

@pillo79 @facchinm

I have one request: as these files do not include an SPDX identifier, could we explicitly assign a license to them?
Zephyr is quite finicky about this sort of thing...

cores/arduino/time_macros.h
cores/arduino/overloads.h
cores/arduino/new.h
loader/bootanimation.h
loader/llext_exports.c
loader/fixups.c
loader/matrix.inc

@pillo79
Copy link
Contributor

pillo79 commented Feb 2, 2026

Thank you SO MUCH for taking the time to do all of this. I always meant to start upstreaming but we've not at a stable point yet so it isn't easy to stop and look back.

We started using clang-format as a code formatting tool and that complicated this effort even more. But I see this PR is using Zephyr style, please tell me you didn't have to change all the formatting by hand? 👀
(I always meant to raise this in Discord to agree on a format and just use that. Would you like to propose something?)

Thanks for pointing out the files with missing licenses - will fix them ASAP.

Is cores/arduino now perfectly synced with 0.53? I could start experimenting with using ArduinoCore-zephyr as a proper Zephyr module in our loader build, separating the two in a much cleaner way.

Again thanks for the effort! 👏

@soburi
Copy link
Member Author

soburi commented Feb 3, 2026

We started using clang-format as a code formatting tool and that complicated this effort even more. But I see this PR is using Zephyr style, please tell me you didn't have to change all the formatting by hand? 👀 (I always meant to raise this in Discord to agree on a format and just use that. Would you like to propose something?)

I addressed only files that has diff here. I believe these gone into the Arduino style now.
IMO, after the merger, we'll also need to split up the all-in-one zephyrCommon.cpp.
So, this is a temporary issue, so I don't think it's something to worry about.
However, I'm concerned that the current .clang-format doesn't look very clean. We'll need to improve .clang-format with refer the zephyr's one and the rules a bit more.

Thanks for pointing out the files with missing licenses - will fix them ASAP.

This is beyond my control, so I appreciate your help. Also, I think the issue under libraries needs to be discussed as a separate issue.

Is cores/arduino now perfectly synced with 0.53? I could start experimenting with using ArduinoCore-zephyr as a proper Zephyr module in our loader build, separating the two in a much cleaner way.

With this patch series, there are almost no differences in core/arduino. However, there are a few patches that should be apply to arduino-repo from here. Since the loader build is independent, I don't think there's any problem with simply incorporating them, but I'll proceed with this in a separate PR.

facchinm and others added 10 commits February 5, 2026 19:56
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
added availableForWrite - overwrite Print virtual - get it from ring buffer
fix peek and Read, that if 0 bytes read from ring buffer return -1

begin method appeared to have initial garbage in it.  so have it call ring_buf_reset on the rx ring buffer

Co-authored-by: Kurt Eckhardt <kurte@rockisland.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
SerialX.flush() - now waits until the TX completes...
Looks at the TC flag of the uart to know when it has completed
the transfer.

Moved the flush() function to .cpp file as it now uses the device header
file which is only included in the .cpp file

Co-authored-by: Kurt Eckhardt <kurte@rockisland.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Fixes compilation error found at https://www.cnx-software.com/2024/12/10/arduino-core-for-zephyr-beta-released/

Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
@soburi soburi force-pushed the bump_to_arduino_repo branch from f599674 to a23c93e Compare February 5, 2026 11:51
@soburi soburi added the DNM This PR should not be merged (Do Not Merge) label Feb 5, 2026
facchinm and others added 12 commits February 5, 2026 21:29
Note by committer: Only under the `cores/arduino` was picked.

Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: Kurt Eckhardt <kurte@rockisland.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: kurte <kurte@rockisland.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Note by committer: Only under the `cores/arduino` was picked.

Co-authored-by: Mike S <CyberMerln@gmail.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Resolves: zephyrproject-rtos#51

There is an IO pin on the NANO that that when turned on, enables most of the sensors on the BLE sense which are on SPI1.   The MBED version, enables this pin as part of the main().

Which I am trying to emulate.  There is code already in, that if you use at least one of the zephyr device drivers, will eanble this pin.  However that does not help when you are using external libraries or the like.

So I added details about this pin in our overlay file, in the zephyr,user section.

I then added code to main.cpp, that is only included if your are building using an NRFX board.  Currently the nano and one of the nicla boards.  Could also specically only do this on the NANO, but probably does not
matter as, the code tries to find that property and only if it is found, does it turn on the pin.

Note: The MBED version turn on this pin with high drive.  Which I emulated using the information,
mentioned in the zephyr discussion.
zephyrproject-rtos/zephyr#78710
In one of my sketches I verified that the pin pads configuration looks the same as mbed setup.

With these changes I am able to access most of the sensors.
Most of the testing has been done by @mjs513, with some by myself as well.

Note by committer: Only under the `cores/arduino` was picked.

Co-authored-by: kurte <kurte@rockisland.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Added call to main.cpp to initVariant.
Added a weak version in main.cpp.

Then moved the code for initializing the enable sensor pin out of main.cpp
into the initVariant that I added to variant.cpp for the specific board

Note by committer: Only under the `cores/arduino` was picked.

Co-authored-by: Kurt Eckhardt <kurte@rockisland.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Note by committer: Only under the `cores/arduino` was picked.

Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Note by committer: Only under the `cores/arduino` was picked.

Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
facchinm and others added 19 commits February 5, 2026 21:34
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
This would have been spotted if we extend the CI to compile all the exaples (TestClient in particular).

Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
…sues

The DIGITAL_PIN_EXISTS macro (used e.g. by LED_BUILTIN) was not working
properly because the inline comments in devicetree_generated.h were
confusing the preprocessor: one internal macro tried to create an
unsigned constant by pasting a '*/' comment end marker with the 'U'
character.

Splitting that macro into two parts, so that the DT_REG_ADDR macro is
invoked with an expanded argument, fixes the issue.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
There's no way to convince the compiler to consider the provided flags
when linking modern c++ code (std::).
Get rid of the useless symbols in the linker and add the (then) missing
implementations in abi.cpp

Note by committer: Only under the `cores/arduino` was picked.

Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Note by committer: Only under the `cores/arduino` was picked.

Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Use a global 'extern "C" { }' block to avoid warnings about variables
being initialized and declared extern.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
availableForWrite() was taking the free space of the Rx buffer
instead of the Tx buffer.

Co-authored-by: Tamas Jozsi <tamas.jozsi@silabs.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Note by committer: Only under the `cores/arduino` was picked.

Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Note by committer: Only under the `cores/arduino` was picked.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
Take into account the analog switch

Note by committer: Only under the `cores/arduino` was picked.

Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: Sebastian Romero <s.romero@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
According to Zephyr documentation, k_thread_create() both initializes
and starts the thread. The second loop that was calling k_thread_start()
on each static thread was redundant.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Note by committer: Only under the `cores/arduino` was picked.

Co-authored-by: Tamas Jozsi <tamas.jozsi@silabs.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Note by committer: Only under the `cores/arduino` was picked.

Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Co-authored-by: pennam <m.pennasilico@arduino.cc>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
@soburi soburi force-pushed the bump_to_arduino_repo branch from a23c93e to 8f375db Compare February 5, 2026 12:41
@soburi soburi changed the title Sync with arduino repo cores: arduino: Bump to 0.53.1 Feb 5, 2026
@soburi soburi marked this pull request as ready for review February 5, 2026 17:11
Copilot AI review requested due to automatic review settings February 5, 2026 17:11
@soburi soburi requested a review from beriberikix as a code owner February 5, 2026 17:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bumps the Arduino core for Zephyr from its current version to 0.53.1, bringing substantial new functionality and improvements to the Arduino API implementation on Zephyr RTOS.

Changes:

  • Enhanced serial communication with USB CDC support, improved flow control, and better buffer management
  • Added new Arduino-compatible APIs including C++ new/delete operators, itoa functions, and time macros
  • Implemented DAC support alongside existing ADC/PWM capabilities with resolution control
  • Introduced USB device stack integration with proper descriptor management and CDC ACM handling
  • Improved code formatting and consistency across all files with standardized brace placement

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
cores/arduino/zephyrSerial.h Adds USB CDC support, availableForWrite method, flush implementation, and improved formatting
cores/arduino/zephyrSerial.cpp Implements non-blocking write with yielding, flush mechanism, ring buffer reset on begin, and USB CDC integration
cores/arduino/zephyrPrint.h Reformats code with consistent brace style and spacing
cores/arduino/zephyrPrint.cpp Fixes spacing issues in operators and reformats for consistency
cores/arduino/zephyrCommon.cpp Adds DAC support, analog resolution control, 64-bit cycle counter support, and guard conditions for empty GPIO configurations
cores/arduino/usb_device_descriptor.c New file implementing USB device descriptors and configuration for the new USB stack
cores/arduino/time_macros.h New file providing Arduino-compatible clock cycle conversion macros
cores/arduino/threads.cpp New file implementing static thread initialization support
cores/arduino/overloads.h New file declaring DAC and analog resolution getter functions
cores/arduino/new.h New compatibility header redirecting to standard new header
cores/arduino/new.cpp New file implementing C++ new/delete operators with malloc/free
cores/arduino/new New standard header declaring C++ memory allocation operators
cores/arduino/main.cpp Adds USB Serial initialization, static threads, variant initialization, and entry point for LLEXT
cores/arduino/itoa.cpp New file implementing itoa/ltoa/utoa/ultoa conversion functions
cores/arduino/apiCommon.cpp Reformats code for consistency
cores/arduino/abi.cpp New file implementing ABI stubs for C++ runtime support
cores/arduino/USB.cpp New file implementing USB CDC serial with baud rate change detection and device stack support
cores/arduino/SerialUSB.h New header defining SerialUSB_ class for USB CDC communication
cores/arduino/CMakeLists.txt Adds new source files USB.cpp, itoa.cpp, and threads.cpp to build
cores/arduino/Arduino.h Adds DAC support, analog resolution APIs, USB serial header, helper macros for pin mapping
Kconfig Adds USB device configuration options for manufacturer, product, VID, and PID

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@soburi soburi force-pushed the bump_to_arduino_repo branch 2 times, most recently from 2dd7a2d to 8f375db Compare February 9, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DNM This PR should not be merged (Do Not Merge)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants