diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst index 7c952a8370a8..78231a837116 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -480,6 +480,10 @@ Peripheral samples * Support for the :ref:`nRF54L15 PDK ` board. * Support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. +* :ref:`802154_phy_test` sample: + + * Added support for the :ref:`nRF54L15 PDK ` board. + PMIC samples ------------ diff --git a/samples/peripheral/802154_phy_test/boards/nrf21540dk_nrf52840.conf b/samples/peripheral/802154_phy_test/boards/nrf21540dk_nrf52840.conf index 381867f8be5d..4829f8918764 100644 --- a/samples/peripheral/802154_phy_test/boards/nrf21540dk_nrf52840.conf +++ b/samples/peripheral/802154_phy_test/boards/nrf21540dk_nrf52840.conf @@ -5,3 +5,11 @@ # CONFIG_SHELL_PROMPT_UART=">" + +# nrfx drivers configuration: +CONFIG_NRFX_POWER=y # enable DC/DC support +CONFIG_NRFX_RNG=y # enable RNG +CONFIG_NRFX_TIMER2=y # enable TIMER2 + +# Allow sharing the RTC between IEEE 802.15.4 and Zephyr +CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=3 diff --git a/samples/peripheral/802154_phy_test/boards/nrf52833dk_nrf52833.conf b/samples/peripheral/802154_phy_test/boards/nrf52833dk_nrf52833.conf new file mode 100644 index 000000000000..4829f8918764 --- /dev/null +++ b/samples/peripheral/802154_phy_test/boards/nrf52833dk_nrf52833.conf @@ -0,0 +1,15 @@ +# +# Copyright (c) 2023 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_SHELL_PROMPT_UART=">" + +# nrfx drivers configuration: +CONFIG_NRFX_POWER=y # enable DC/DC support +CONFIG_NRFX_RNG=y # enable RNG +CONFIG_NRFX_TIMER2=y # enable TIMER2 + +# Allow sharing the RTC between IEEE 802.15.4 and Zephyr +CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=3 diff --git a/samples/peripheral/802154_phy_test/boards/nrf52840dk_nrf52840.conf b/samples/peripheral/802154_phy_test/boards/nrf52840dk_nrf52840.conf index 381867f8be5d..4829f8918764 100644 --- a/samples/peripheral/802154_phy_test/boards/nrf52840dk_nrf52840.conf +++ b/samples/peripheral/802154_phy_test/boards/nrf52840dk_nrf52840.conf @@ -5,3 +5,11 @@ # CONFIG_SHELL_PROMPT_UART=">" + +# nrfx drivers configuration: +CONFIG_NRFX_POWER=y # enable DC/DC support +CONFIG_NRFX_RNG=y # enable RNG +CONFIG_NRFX_TIMER2=y # enable TIMER2 + +# Allow sharing the RTC between IEEE 802.15.4 and Zephyr +CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=3 diff --git a/samples/peripheral/802154_phy_test/boards/nrf5340dk_nrf5340_cpunet.conf b/samples/peripheral/802154_phy_test/boards/nrf5340dk_nrf5340_cpunet.conf index 8e1acc035f03..e28fb1557a77 100644 --- a/samples/peripheral/802154_phy_test/boards/nrf5340dk_nrf5340_cpunet.conf +++ b/samples/peripheral/802154_phy_test/boards/nrf5340dk_nrf5340_cpunet.conf @@ -26,3 +26,8 @@ CONFIG_NCS_SAMPLE_REMOTE_SHELL_CHILD_IMAGE=y CONFIG_APP_RPC=y CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=2 + +# nrfx drivers configuration: +CONFIG_NRFX_POWER=y # enable DC/DC support +CONFIG_NRFX_RNG=y # enable RNG +CONFIG_NRFX_TIMER2=y # enable TIMER2 diff --git a/samples/peripheral/802154_phy_test/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/peripheral/802154_phy_test/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..f6b0c2b8180c --- /dev/null +++ b/samples/peripheral/802154_phy_test/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,14 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_SHELL_PROMPT_UART=">" + +# currently unsupported for nRF54L15 +CONFIG_PTT_CACHE_MGMT=n + +# nrfx drivers configuration: +CONFIG_NRFX_TIMER20=y # enable TIMER2 +CONFIG_NRFX_DPPI=y # enable DPPIC diff --git a/samples/peripheral/802154_phy_test/prj.conf b/samples/peripheral/802154_phy_test/prj.conf index df6e49c139aa..05b6bfae2721 100644 --- a/samples/peripheral/802154_phy_test/prj.conf +++ b/samples/peripheral/802154_phy_test/prj.conf @@ -11,23 +11,12 @@ CONFIG_LOG_BACKEND_UART=n # Enable temperature sensor CONFIG_NRFX_TEMP=y -# Enable DC/DC Support -CONFIG_NRFX_POWER=y - -# Enable RNG -CONFIG_NRFX_RNG=y # Use XOSHIRO PRNG CONFIG_XOSHIRO_RANDOM_GENERATOR=y -# Enable Timer -CONFIG_NRFX_TIMER2=y - # Enabling radio driver CONFIG_NRF_802154_RADIO_DRIVER=y -# Allow sharing the RTC between IEEE 802.15.4 and Zephyr -CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=3 - # Enable ring buffers CONFIG_RING_BUFFER=y diff --git a/samples/peripheral/802154_phy_test/sample.yaml b/samples/peripheral/802154_phy_test/sample.yaml index 316bf413b363..73a0ef6ea7fe 100644 --- a/samples/peripheral/802154_phy_test/sample.yaml +++ b/samples/peripheral/802154_phy_test/sample.yaml @@ -9,8 +9,9 @@ tests: - nrf52840dk_nrf52840 - nrf21540dk_nrf52840 - nrf5340dk_nrf5340_cpunet + - nrf54l15pdk_nrf54l15_cpuapp platform_allow: nrf52833dk_nrf52833 nrf52840dk_nrf52840 nrf21540dk_nrf52840 - nrf5340dk_nrf5340_cpunet + nrf5340dk_nrf5340_cpunet nrf54l15pdk_nrf54l15_cpuapp tags: ci_build ci_rs_build ci_rs_weekly sample.peripheral.802154_phy_test.ant_div_mode_auto: build_only: true diff --git a/samples/peripheral/802154_phy_test/src/periph_proc.c b/samples/peripheral/802154_phy_test/src/periph_proc.c index c9df4e1ec738..f32026257a0c 100644 --- a/samples/peripheral/802154_phy_test/src/periph_proc.c +++ b/samples/peripheral/802154_phy_test/src/periph_proc.c @@ -41,7 +41,11 @@ LOG_MODULE_REGISTER(periph); #if IS_ENABLED(CONFIG_PTT_CLK_OUT) /* Timer instance used for HFCLK output */ +#if defined(NRF52_SERIES) || defined(NRF53_SERIES) #define PTT_CLK_TIMER 2 +#elif defined(NRF54L_SERIES) +#define PTT_CLK_TIMER 20 +#endif static nrfx_timer_t clk_timer = NRFX_TIMER_INSTANCE(PTT_CLK_TIMER); @@ -50,12 +54,22 @@ static nrfx_timer_t clk_timer = NRFX_TIMER_INSTANCE(PTT_CLK_TIMER); [DT_PROP(gpio_node, port)] = \ NRFX_GPIOTE_INSTANCE(DT_PROP(GPIOTE_NODE(gpio_node), instance)), +#define COND_GPIOTE_INST_AND_COMMA(gpio_node) \ + COND_CODE_1(DT_NODE_HAS_PROP(gpio_node, gpiote_instance), \ + (GPIOTE_INST_AND_COMMA(gpio_node)), \ + ()) + static const nrfx_gpiote_t gpiote_inst[GPIO_COUNT] = { - DT_FOREACH_STATUS_OKAY(nordic_nrf_gpio, GPIOTE_INST_AND_COMMA) + DT_FOREACH_STATUS_OKAY(nordic_nrf_gpio, COND_GPIOTE_INST_AND_COMMA) }; #define NRF_GPIOTE_FOR_GPIO(idx) &gpiote_inst[idx] #define NRF_GPIOTE_FOR_PSEL(psel) &gpiote_inst[psel >> 5] + +static inline bool gpiote_is_valid(const nrfx_gpiote_t *gpiote) +{ + return gpiote->p_reg != NULL; +} #endif /* IS_ENABLED(CONFIG_PTT_CLK_OUT) */ static const struct gpio_dt_spec led0 = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios); @@ -94,6 +108,10 @@ void periph_init(void) for (int i = 0; i < GPIO_COUNT; ++i) { const nrfx_gpiote_t *gpiote = NRF_GPIOTE_FOR_GPIO(i); + if (!gpiote_is_valid(gpiote)) { + continue; + } + if (!nrfx_gpiote_init_check(gpiote)) { err_code = nrfx_gpiote_init(gpiote, 0); NRFX_ASSERT(err_code); @@ -127,7 +145,7 @@ bool ptt_clk_out_ext(uint8_t pin, bool mode) nrfx_err_t err; const nrfx_gpiote_t *gpiote = NRF_GPIOTE_FOR_PSEL(pin); - if (!nrf_gpio_pin_present_check(pin)) { + if (!nrf_gpio_pin_present_check(pin) || !gpiote_is_valid(gpiote)) { return false; }