Skip to content

modules: hal_nordic: nrf_802154: CCA threshold config in dBm + nRF54L15 clock latency #90795

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,9 @@
pinctrl-names = "default", "sleep";
};

&hfxo {
startup-time-us = <854>;
};

/* Get a node label for wi-fi spi to use in shield files */
wifi_spi: &spi22 {};
8 changes: 4 additions & 4 deletions modules/hal_nordic/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ config NRF_802154_CCA_MODE_CARRIER_OR_ED

endchoice

config NRF_802154_CCA_ED_THRESHOLD
int "nRF IEEE 802.15.4 CCA Energy Detection threshold"
default 45
config NRF_802154_CCA_ED_THRESHOLD_DBM
int "nRF IEEE 802.15.4 CCA Energy Detection threshold in dBm"
default -75
help
If energy detected in a given channel is above the value then the
channel is deemed busy. The unit is defined as per 802.15.4-2006 spec.
channel is deemed busy. The unit is dBm.

config NRF_802154_CCA_CORR_THRESHOLD
int "nRF IEEE 802.15.4 CCA Correlator threshold"
Expand Down
2 changes: 1 addition & 1 deletion modules/hal_nordic/nrf_802154/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ target_compile_definitions(zephyr-802154-interface
# CCA mode options
NRF_802154_CCA_CORR_LIMIT_DEFAULT=${CONFIG_NRF_802154_CCA_CORR_LIMIT}
NRF_802154_CCA_CORR_THRESHOLD_DEFAULT=${CONFIG_NRF_802154_CCA_CORR_THRESHOLD}
NRF_802154_CCA_ED_THRESHOLD_DEFAULT=${CONFIG_NRF_802154_CCA_ED_THRESHOLD}
NRF_802154_CCA_ED_THRESHOLD_DBM_DEFAULT=${CONFIG_NRF_802154_CCA_ED_THRESHOLD_DBM}

# Key storage size
NRF_802154_SECURITY_KEY_STORAGE_SIZE=${CONFIG_NRF_802154_SECURITY_KEY_STORAGE_SIZE}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ static bool hfclk_is_running;

void nrf_802154_clock_init(void)
{
/* Intentionally empty. */
#ifdef NRF54L_SERIES
uint32_t clock_latency_us = z_nrf_clock_bt_ctlr_hf_get_startup_time_us();
Copy link
Collaborator

@ankuns ankuns Jun 11, 2025

Choose a reason for hiding this comment

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

I'm just curious. Is there a reason to not do

#if DT_NODE_EXISTS(DT_NODELABEL(hfxo))
    uint32_t clock_latency_us = DT_PROP(DT_NODELABEL(hfxo), startup_time_us);
    nrf_802154_clock_hfclk_latency_set(clock_latency_us);
#endif

?

If you prefer to call z_nrf_clock_bt_ctlr_hf_get_startup_time_us, note it is wrapped with
#if DT_NODE_EXISTS(DT_NODELABEL(hfxo))
https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/clock_control/clock_control_nrf.c#L440

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The property is marked as required on nordic,nrf54l-hfxo binding. If there is no such property, the build will fail due to missing property.


nrf_802154_clock_hfclk_latency_set(clock_latency_us);
#endif
}

void nrf_802154_clock_deinit(void)
Expand Down