-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Conversation
Hello @ndaneil, and thank you very much for your first pull request to the Zephyr project! |
09aaaa3
to
4141c05
Compare
@@ -0,0 +1,5 @@ | |||
CONFIG_SPI=n |
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.
Bit confused by this as there is no such board in zephyr?
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.
By default SPI is turned on (
zephyr/samples/drivers/led_ws2812/Kconfig
Lines 6 to 7 in 95a5f51
config SPI | |
default y |
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.
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.
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.
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
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.
I tested this on nrf5340dk yesterday and can confirm it works
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.
Thanks for this patch @ndaneil.
|
||
&gpio1 { | ||
status = "okay"; | ||
}; |
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.
Why does gpio1
need to be set to okay
?
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.
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.
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.
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 |
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.
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.
- works with nrf7002dk_nrf5340 too |
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.
Updated the README as you suggested.
@nordicjm I squashed the commits. |
- nrf5340dk_nrf5340 (1.8V logic level, make sure to use a logic level shifter!) | ||
- should work for other boards featuring an nRF5340 host processor |
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.
This is incorrect, the nrf5340dk is 3.3v logic level
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.
Fixed it
led_strip: ws2812 { | ||
compatible = "worldsemi,ws2812-i2s"; | ||
|
||
i2s-dev = < &i2s_led >; |
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.
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.
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.
done
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.
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>;
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.
I see. Fixed it.
3992001
to
eb391c1
Compare
LED_COLOR_ID_BLUE>; | ||
reset-delay = <500>; | ||
}; | ||
|
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.
There is an unnecessary tab above. Sorry :)
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.
Removed it
New config files to support nrf5340-based boards Signed-off-by: Daniel Istvan Nemeth <nemeth.daniel.istvan@hallgato.ppke.hu>
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.
Thanks :)
Hi @ndaneil! 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! 🪁 |
Overlay and config files for nRF5340DK (compatible with nRF7002DK too)