-
Notifications
You must be signed in to change notification settings - Fork 59
cores: arduino: Bump to 0.53.1 #153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
931e3d5 to
f599674
Compare
|
I have one request: as these files do not include an SPDX identifier, could we explicitly assign a license to them? cores/arduino/time_macros.h |
|
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 Thanks for pointing out the files with missing licenses - will fix them ASAP. Is Again thanks for the effort! 👏 |
I addressed only files that has diff here. I believe these gone into the Arduino style now.
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.
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. |
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>
f599674 to
a23c93e
Compare
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>
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>
a23c93e to
8f375db
Compare
There was a problem hiding this 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.
2dd7a2d to
8f375db
Compare
Bump
cores/arduinoto https://github.com/arduino/ArduinoCore-zephyr @0.53.1.Including following features:
Including the following features:
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.