Skip to content

Conversation

@soburi
Copy link
Member

@soburi soburi commented Oct 15, 2022

Add support for the hardware serial device. The implementation
using the UART interrupt, enabling CONFIG_UART_INTERRUPT_DRIVEN.

Instantiate as 'Serial' with UART device defined in 'serials' array
under zephyr,user node. If the 'serials' array is not defined,
try to instantiate with a UART device labeled 'arduino_serial'.
If even 'arduino_serial' does not define, it uses the stub
implementation that redirects to printk().


As a result of this PR, changes Serial output goes to UART1(exporse in Arduino header) in nrf52840dk_nrf52840 case.

Copy link
Member

@DhruvaG2000 DhruvaG2000 left a comment

Choose a reason for hiding this comment

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

Thanks for this PR,
I feel like you also need to add overlay changes for nrf52840dk_nrf52840, rest you've covered.

```sh
$> west build -p -b arduino_nano_33_ble sample/serial_event/

$> west flash --bossac=/home/$USER/.arduino15/packages/arduino/tools/bossac/1.9.1-arduino2/bossac
Copy link
Member

Choose a reason for hiding this comment

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

close code ticks after this .. ```

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed it.

@soburi
Copy link
Member Author

soburi commented Oct 16, 2022

I feel like you also need to add overlay changes for nrf52840dk_nrf52840, rest you've covered.

It is no needed.
Because nrf52840dk_nrf52840 defines arduino_serial, uses it.
Use exists definition if possible to use. (It is rule for reduce our work.)

@soburi soburi requested a review from DhruvaG2000 October 16, 2022 23:59
Copy link
Member

@DhruvaG2000 DhruvaG2000 left a comment

Choose a reason for hiding this comment

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

Built locally, yet to test on HW, but code LGTM

@DhruvaG2000 DhruvaG2000 requested a review from szczys October 18, 2022 16:47
@DhruvaG2000
Copy link
Member

This is a major PR in serial, and it would be awesome to have @szczys review it as well.

Add implementations for adruino::Print functions.
Add support for the hardware serial device. The implementation
using the UART interrupt, enabling CONFIG_UART_INTERRUPT_DRIVEN.

Instantiate as 'Serial' with UART device defined in 'serials' array
under zephyr,user node. If the 'serials' array is not defined,
try to instantiate with a UART device labeled 'arduino_serial'.
If even  'arduino_serial' does not define, it uses the stub
implementation that redirects to printk().
Add a sample to demonstrate how to use Serial APIs
Add a description for `serials`
Copy link
Member

@szczys szczys left a comment

Choose a reason for hiding this comment

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

I read through the commit and this LGTM. I didn't have the chance to do a deep dive into everything, @DhruvaG2000 do you have any remaining concerns with this PR?

@DhruvaG2000 DhruvaG2000 merged commit 972a54e into zephyrproject-rtos:main Oct 29, 2022
@DhruvaG2000
Copy link
Member

do you have any remaining concerns with this PR?

None, Thanks alot @soburi for this PR and Mike for reviewing! Apologies for the delay in merging.

@soburi soburi deleted the hardware_serial branch October 29, 2022 09:56
soburi pushed a commit to soburi/gsoc-2022-arduino-core that referenced this pull request Sep 24, 2025
resolves: zephyrproject-rtos#64

Removed the pins logical Arduino pins 11-13 from the PWM pin list, plus their defines
for the timers.

With these defines in place, the pins Alternate Function settings were set to that of the timers
versus the SPI value (5)

Note: This was done by @mjs513 and myself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants