Skip to content
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

samples:drivers:led_ws2812: support for nRF7002DK and nRF5340DK #64823

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

ndaneil
Copy link
Contributor

@ndaneil ndaneil commented Nov 5, 2023

Overlay and config files for nRF5340DK (compatible with nRF7002DK too)

Copy link

github-actions bot commented Nov 5, 2023

Hello @ndaneil, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@nordicjm nordicjm self-requested a review November 6, 2023 07:57
@@ -0,0 +1,5 @@
CONFIG_SPI=n
Copy link
Collaborator

Choose a reason for hiding this comment

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

Bit confused by this as there is no such board in zephyr?

Copy link
Contributor Author

@ndaneil ndaneil Nov 7, 2023

Choose a reason for hiding this comment

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

By default SPI is turned on (

config SPI
default y
) but since I used I2S, it is not needed in this case.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The comment was regarding the name of the overlay file, as there is no such board as nrf7002dk_nrf5340 in Zephyr upstream since it's part of nRF Connect SDK.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see. Thank you for clarifying. I didn't know it was not part of the upstream (yet). I see nrf5340dk_nrf5340 is already here (https://github.com/zephyrproject-rtos/zephyr/tree/95a5f5178fed90dc193c5c934f4a61559f203cf8/boards/arm/nrf5340dk_nrf5340) so I renamed the files to that. Should work with that as well since the nRF7002DK has the nrf5340 as well. Added a comment here: https://github.com/zephyrproject-rtos/zephyr/pull/64823/files#diff-8971d1014b6cb1e62fc6e2b5e679f34fc2e9b7b15d07f26abf385c5d034e8698R105-R106

Copy link
Collaborator

Choose a reason for hiding this comment

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

I tested this on nrf5340dk yesterday and can confirm it works

Copy link
Collaborator

@simonguinot simonguinot 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 patch @ndaneil.


&gpio1 {
status = "okay";
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why does gpio1 need to be set to okay ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I remember I needed to set it for a project and I thought that since the I2S device is on gpio1, I needed it here as well. But I checked and it compiled without this so I removed these four lines.

@ndaneil ndaneil changed the title samples:drivers:led_ws2812: support for nRF7002DK samples:drivers:led_ws2812: support for nRF7002DK and nRF5340DK Nov 7, 2023
Copy link
Collaborator

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

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

Can you amend the original commits with the correct filenames instead of adding the nrf7002 filenames then renaming then in a later commit?

@@ -102,6 +102,8 @@ This sample uses different drivers depending on the selected board:
I2S driver:

- thingy52_nrf52832
- nrf5340dk_nrf5340 (1.8V logic level, make sure to use a logic level shifter!)
- works with nrf7002dk_nrf5340 too
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove as this is an out-of-tree board, or reword along the lines of "can be used [or "should work"] for other boards featuring an nRF5340 host processor" if that is the case.

Suggested change
- works with nrf7002dk_nrf5340 too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the README as you suggested.

@ndaneil
Copy link
Contributor Author

ndaneil commented Nov 7, 2023

@nordicjm I squashed the commits.

Comment on lines 105 to 106
- nrf5340dk_nrf5340 (1.8V logic level, make sure to use a logic level shifter!)
- should work for other boards featuring an nRF5340 host processor
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is incorrect, the nrf5340dk is 3.3v logic level

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed it

led_strip: ws2812 {
compatible = "worldsemi,ws2812-i2s";

i2s-dev = < &i2s_led >;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since you'll have to push a new version and to be consistent with the rest of the file, please remove the empty spaces in the phandle above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Collaborator

Choose a reason for hiding this comment

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

There is a misunderstanding here. I was not talking about the new line after the compatible (which was perfectly OK) but about the empty spaces around the I2S phandle just above:

i2s-dev = < &i2s_led >;

Should be:

i2s-dev = <&i2s_led>;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see. Fixed it.

LED_COLOR_ID_BLUE>;
reset-delay = <500>;
};

Copy link
Collaborator

Choose a reason for hiding this comment

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

There is an unnecessary tab above. Sorry :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed it

New config files to support nrf5340-based boards

Signed-off-by: Daniel Istvan Nemeth <nemeth.daniel.istvan@hallgato.ppke.hu>
Copy link
Collaborator

@simonguinot simonguinot left a comment

Choose a reason for hiding this comment

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

Thanks :)

@carlescufi carlescufi merged commit e5dbb26 into zephyrproject-rtos:main Nov 13, 2023
15 checks passed
Copy link

Hi @ndaneil!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: LED Label to identify LED subsystem area: Samples Samples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants