Skip to content

Conversation

nerwalt
Copy link
Contributor

@nerwalt nerwalt commented Aug 19, 2025

Pulls pieces from 4393 and fixes a few things (e.g. channel numbers, port settings, etc.).
Does not use the extend crate.
Adds examples that work on the nrf54l15 PDK.

@nerwalt nerwalt changed the title Enable ppi and gpiote suport Enable ppi and gpiote support Aug 19, 2025
@nerwalt
Copy link
Contributor Author

nerwalt commented Aug 19, 2025

I submitted this as a draft PR as I am unsure whether the approach is desirable. Also, the nrf54l15 comes in two packages (QFN48 and CSP47), each with a different number of GPIO pins. The latter does not have P1_15. I ignored it for now, because I didn't want to introduce a new feature flag. Also, should the w.set_port() call in the InputChannel and OutputChannel panic on Port2? Port2 is in the MCU power domain, and there is no GPIOTE peripheral in that domain.

@dmitry-tarnyagin
Copy link

Please add signed - by from the original pr. I'll take a look to the content tomorrow.
Cheers, Dmitry

@nerwalt nerwalt force-pushed the nrf54l-ppi-gpiote branch from 28ea0e4 to 44bd544 Compare August 19, 2025 20:14
@nerwalt
Copy link
Contributor Author

nerwalt commented Aug 19, 2025

@dmitry-tarnyagin - I updated the PR to include "Signed-off-by" lines. Let me know if it is incorrect.
Also, thanks for your work on 4393! I am using the nrf54l in few new projects, so I am interested in getting support for it up and running. If this PR is okay, then I plan to submit others like it.

GPIOTE30_CH2,
GPIOTE30_CH3,

// GPIO port 2

Choose a reason for hiding this comment

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

Typo? GPIO port 0



// GPIO port 2
// GPIO port 0

Choose a reason for hiding this comment

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

Typo? GPIO port 2

#[cfg(not(feature = "_nrf54l"))]
impl_group!(PPI_GROUP3, 3);
#[cfg(not(feature = "_nrf51"))]
#[cfg(not(feature = "_nrf54l"))]

Choose a reason for hiding this comment

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

I found an error here later. Should be

#[cfg(not(any(feature = "_nrf51", feature = "_nrf54l")))]

, same below.

#![no_std]
#![no_main]

use defmt::info;

Choose a reason for hiding this comment

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

Not sure about policies for examples. Can defmt be used w/o a config option?

Copy link
Contributor Author

@nerwalt nerwalt Aug 20, 2025

Choose a reason for hiding this comment

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

It seems so. My approach for the examples is to copy them from the nrf52840 and adjust them for the nrf54l15 PDK. I have a 54l15 PDK and a 52840 DK, and I test the same examples on both to confirm the code works on different hardware. It's not complete, to be sure, but it's what I have available. The gpiote example does not have a 52840 counterpart. I added it to troubleshoot the wait_for_*() methods and left it because it is simple.

@dmitry-tarnyagin
Copy link

@nerwalt It's perfectly fine for me, and thank you for pushing it :). I'm not touching nRF54L at the moment, however it's one of our main platforms generally, and rust support is important for us. Please ping me for review, I'm available and glad to participate in this process.
Regards, Dmitry

@nerwalt nerwalt force-pushed the nrf54l-ppi-gpiote branch from f2fec2e to 34434ea Compare August 20, 2025 15:37
@nerwalt nerwalt changed the title Enable ppi and gpiote support nrf54l - Enable ppi and gpiote support Aug 20, 2025
@nerwalt nerwalt force-pushed the nrf54l-ppi-gpiote branch from 34434ea to 2161c80 Compare August 20, 2025 16:31
@nerwalt nerwalt marked this pull request as ready for review August 20, 2025 16:32
@nerwalt nerwalt force-pushed the nrf54l-ppi-gpiote branch 2 times, most recently from 3dc4cc0 to e82d549 Compare August 22, 2025 13:52
Copy link
Member

@lulf lulf left a comment

Choose a reason for hiding this comment

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

As with #4572, I think maybe this could be resolved at the PAC level so that all nrf variants has >= 1 gpiote instance?

@nerwalt nerwalt force-pushed the nrf54l-ppi-gpiote branch from e82d549 to 445548b Compare August 25, 2025 17:46
@nerwalt
Copy link
Contributor Author

nerwalt commented Aug 26, 2025

I am confused about what needs to be modified at the PAC level (for this PR). All nrf variants have at least one GPIOTE instance. Some have one for each security environment (domain), but there is still only one available to the application at any given time. Only the nrf54l has more than one available to the application (assuming all power domains are in play). This new dimension can only be handled at the HAL level.

Updated buffered_uarte for new ppi support
Adding gpiote examples

Signed-off-by: Dmitry Tarnyagin <[email protected]>
Signed-off-by: Vegard Eriksen <[email protected]>
Signed-off-by: Tyson Lawrence <[email protected]>
@nerwalt nerwalt force-pushed the nrf54l-ppi-gpiote branch from 445548b to 4965a7a Compare August 26, 2025 14:54
@nerwalt nerwalt closed this Sep 16, 2025
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