Skip to content

zephyrSerial: Redesign to supporting hardware serial #64

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

Merged
merged 4 commits into from
Oct 29, 2022

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
Collaborator

@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
Collaborator

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
Collaborator

@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
Collaborator

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
Collaborator

@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
Collaborator

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
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