diff --git a/nrf_802154/doc/CHANGELOG.rst b/nrf_802154/doc/CHANGELOG.rst index a17907915b..89bc37d560 100644 --- a/nrf_802154/doc/CHANGELOG.rst +++ b/nrf_802154/doc/CHANGELOG.rst @@ -10,6 +10,14 @@ Changelog All notable changes to this project are documented in this file. See also :ref:`nrf_802154_limitations` for permanent limitations. +Main branch - nRF 802.15.4 Radio Driver +*************************************** + +Bug fixes +========= + +* Fixed an issue causing the driver to report a very inaccurate timestamp if a delayed operation starts shortly after sleep request. (KRKNWK-18589) + nRF Connect SDK v2.6.0 - nRF 802.15.4 Radio Driver ************************************************** diff --git a/nrf_802154/driver/src/nrf_802154_aes_ccm_acc_ecb.c b/nrf_802154/driver/src/nrf_802154_aes_ccm_acc_ecb.c index eb96628629..c79b20fc2a 100644 --- a/nrf_802154/driver/src/nrf_802154_aes_ccm_acc_ecb.c +++ b/nrf_802154/driver/src/nrf_802154_aes_ccm_acc_ecb.c @@ -44,7 +44,11 @@ #include "nrf_802154_const.h" #include "nrf_802154_config.h" #include "nrf_802154_tx_work_buffer.h" -#include "nrf_802154_sl_ecb.h" +#if defined(CONFIG_MPSL) +#include "mpsl_ecb.h" +#else +#include "hal/nrf_ecb.h" +#endif #ifndef MIN #define MIN(a, b) ((a) < (b) ? (a) : (b)) ///< Leaves the minimum of the two arguments @@ -62,14 +66,6 @@ #define NRF_802154_AES_CCM_AUTH_DATA_LENGTH_OCTET 0 // AnnnexB4.1.1b) - Position of octet for length of auth data in AddAuthData #define NRF_802154_AES_CCM_AUTH_DATA_OCTET 2 // AnnnexB4.1.1b) - Position of octet for data of auth data in AddAuthData -#if NRF_802154_AES_CCM_BLOCK_SIZE != NRF_802154_SL_ECB_CLEARTEXT_LENGTH -#error NRF_802154_AES_CCM_BLOCK_SIZE != NRF_802154_SL_ECB_CLEARTEXT_LENGTH -#endif - -#if NRF_802154_AES_CCM_BLOCK_SIZE != NRF_802154_SL_ECB_CIPHERTEXT_LENGTH -#error NRF_802154_AES_CCM_BLOCK_SIZE != NRF_802154_SL_ECB_CLEARTEXT_LENGTH -#endif - /** * @brief Steps of AES-CCM* algorithm. */ @@ -102,12 +98,98 @@ static uint8_t * mp_work_buffer; static const uint8_t m_mic_size[] = { 0, MIC_32_SIZE, MIC_64_SIZE, MIC_128_SIZE }; ///< Security level - 802.15.4-2015 Standard Table 9.6 +typedef struct +{ + uint32_t key[NRF_802154_AES_CCM_BLOCK_SIZE / sizeof(uint32_t)]; + uint8_t cleartext[NRF_802154_AES_CCM_BLOCK_SIZE]; + uint8_t ciphertext[NRF_802154_AES_CCM_BLOCK_SIZE]; +} nrf_802154_hal_ecb_data_t; + /******************************************************************************/ /******************************************************************************/ /******************************************************************************/ -static nrf_802154_sl_ecb_data_t m_ecb_hal_data; -static bool m_ecb_hal_req_run; +static nrf_802154_hal_ecb_data_t m_ecb_hal_data; +static bool m_ecb_hal_req_run; + +#if defined(CONFIG_MPSL) +static inline void ecb_block_encrypt(nrf_802154_hal_ecb_data_t * p_ecb_data) +{ + /* Note: nrf_802154_hal_ecb_data_t and mpsl_ecb_hal_data_t are equivalent + * and pointers to them can be safely cast. + */ + mpsl_ecb_block_encrypt((mpsl_ecb_hal_data_t *)p_ecb_data); +} + +#else + +#define ECB_INST NRF_ECB + +static inline void sleep_wfe(void) +{ +#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX) + void z_impl_k_busy_wait(); + z_impl_k_busy_wait(10); +#elif defined(CONFIG_SOC_COMPATIBLE_NRF52X) + __WFE(); +#else + /* Do-nothing. This includes nRF5340 series due multiple sleep-related anomalies (160, 165, 168) */ +#endif +} + +static void wait_for_ecb_end(void) +{ + while (!nrf_ecb_event_check(ECB_INST, NRF_ECB_EVENT_ENDECB) && + !nrf_ecb_event_check(ECB_INST, NRF_ECB_EVENT_ERRORECB)) + { +#if !defined(CONFIG_SOC_SERIES_BSIM_NRFXX) + if ((SCB->SCR & SCB_SCR_SEVONPEND_Msk) == SCB_SCR_SEVONPEND_Msk) +#endif + { + NVIC_ClearPendingIRQ(ECB_IRQn); + + uint32_t irq_was_masked = __get_PRIMASK(); + + __disable_irq(); + + nrf_ecb_int_enable(ECB_INST, NRF_ECB_INT_ENDECB_MASK | NRF_ECB_INT_ERRORECB_MASK); + if (!nrf_ecb_event_check(ECB_INST, NRF_ECB_EVENT_ENDECB) && + !nrf_ecb_event_check(ECB_INST, NRF_ECB_EVENT_ERRORECB)) + { + sleep_wfe(); + } + + if (!irq_was_masked) + { + __enable_irq(); + } + } + } +} + +static void ecb_block_encrypt(nrf_802154_hal_ecb_data_t * p_ecb_data) +{ + nrf_ecb_int_disable(ECB_INST, NRF_ECB_INT_ENDECB_MASK | NRF_ECB_INT_ERRORECB_MASK); + + do + { + nrf_ecb_task_trigger(ECB_INST, NRF_ECB_TASK_STOPECB); + nrf_ecb_event_clear(ECB_INST, NRF_ECB_EVENT_ENDECB); + nrf_ecb_event_clear(ECB_INST, NRF_ECB_EVENT_ERRORECB); + nrf_ecb_data_pointer_set(ECB_INST, p_ecb_data); + + nrf_ecb_task_trigger(ECB_INST, NRF_ECB_TASK_STARTECB); + wait_for_ecb_end(); + } + while (nrf_ecb_event_check(ECB_INST, NRF_ECB_EVENT_ERRORECB)); + + nrf_ecb_int_disable(ECB_INST, NRF_ECB_INT_ENDECB_MASK | NRF_ECB_INT_ERRORECB_MASK); + nrf_ecb_event_clear(ECB_INST, NRF_ECB_EVENT_ERRORECB); + nrf_ecb_event_clear(ECB_INST, NRF_ECB_EVENT_ENDECB); + NVIC_ClearPendingIRQ(ECB_IRQn); +} + +#endif /* defined(CONFIG_MPSL) */ static inline uint8_t * ecb_hal_cleartext_ptr_get(void) { @@ -121,7 +203,7 @@ static inline uint8_t * ecb_hal_ciphertext_ptr_get(void) static void ecb_hal_key_set(const uint8_t * p_key) { - memcpy(m_ecb_hal_data.key, p_key, NRF_802154_SL_ECB_KEY_LENGTH); + memcpy(m_ecb_hal_data.key, p_key, NRF_802154_AES_CCM_BLOCK_SIZE); } /******************************************************************************/ @@ -436,7 +518,7 @@ static void ecb_hal_block_encrypted_handler(void) static void start_ecb_auth_transformation(void) { ecb_hal_key_set(m_aes_ccm_data.key); - memcpy(ecb_hal_cleartext_ptr_get(), m_x, NRF_802154_SL_ECB_CLEARTEXT_LENGTH); + memcpy(ecb_hal_cleartext_ptr_get(), m_x, NRF_802154_AES_CCM_BLOCK_SIZE); m_state.iteration = 0; m_state.transformation = ADD_AUTH_DATA_AUTH; m_ecb_hal_req_run = true; @@ -444,7 +526,7 @@ static void start_ecb_auth_transformation(void) while (m_ecb_hal_req_run) { m_ecb_hal_req_run = false; - nrf_802154_sl_ecb_block_encrypt(&m_ecb_hal_data); + ecb_block_encrypt(&m_ecb_hal_data); ecb_hal_block_encrypted_handler(); } } diff --git a/nrf_802154/driver/src/nrf_802154_core.c b/nrf_802154/driver/src/nrf_802154_core.c index bc0f01d1c1..265c2275be 100644 --- a/nrf_802154/driver/src/nrf_802154_core.c +++ b/nrf_802154/driver/src/nrf_802154_core.c @@ -758,7 +758,7 @@ static void operation_terminated_notify(radio_state_t state, bool receiving_psdu nrf_802154_transmit_done_metadata_t metadata = {}; nrf_802154_tx_work_buffer_original_frame_update(mp_tx_data, &metadata.frame_props); - transmit_failed_notify(mp_tx_data, NRF_802154_TX_ERROR_ABORTED, &metadata); + transmit_failed_notify(mp_tx_data, NRF_802154_TX_ERROR_NO_ACK, &metadata); } break; @@ -843,16 +843,6 @@ static bool current_operation_terminate(nrf_802154_term_t term_lvl, return result; } -/** Enter Sleep state. */ -static void sleep_init(void) -{ - // This function is always executed from a critical section, so this check is safe. - if (timeslot_is_granted()) - { - nrf_802154_timer_coord_stop(); - } -} - /** Initialize Falling Asleep operation. */ static void falling_asleep_init(void) { @@ -862,7 +852,6 @@ static void falling_asleep_init(void) } else { - sleep_init(); state_set(RADIO_STATE_SLEEP); } } @@ -1212,7 +1201,6 @@ static void switch_to_idle(void) { if (!nrf_802154_pib_rx_on_when_idle_get()) { - sleep_init(); state_set(RADIO_STATE_SLEEP); } else @@ -1884,7 +1872,6 @@ void nrf_802154_trx_go_idle_finished(void) { nrf_802154_log_function_enter(NRF_802154_LOG_VERBOSITY_LOW); - sleep_init(); state_set(RADIO_STATE_SLEEP); nrf_802154_log_function_exit(NRF_802154_LOG_VERBOSITY_LOW); @@ -2568,7 +2555,6 @@ static bool core_sleep(nrf_802154_term_t term_lvl, req_originator_t req_orig, bo } else { - sleep_init(); state_set(RADIO_STATE_SLEEP); } } diff --git a/nrf_802154/sl/include/nrf_802154_sl_ecb.h b/nrf_802154/sl/include/nrf_802154_sl_ecb.h deleted file mode 100644 index bcc4d062b4..0000000000 --- a/nrf_802154/sl/include/nrf_802154_sl_ecb.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2024, Nordic Semiconductor ASA - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_802154_SL_ECB_H__ -#define NRF_802154_SL_ECB_H__ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_802154_sl_ecb ECB encryption - * @{ - * @ingroup nrf_802154_sl_ecb - * @brief The ECB encryption API for nRF 802.15.4 Radio Driver - */ - -#define NRF_802154_SL_ECB_KEY_LENGTH (16) /**< ECB key length in bytes. */ -#define NRF_802154_SL_ECB_CLEARTEXT_LENGTH (16) /**< ECB cleartext length in bytes. */ -#define NRF_802154_SL_ECB_CIPHERTEXT_LENGTH (16) /**< ECB ciphertext length in bytes. */ - -/**@brief AES ECB parameter typedefs */ -typedef uint32_t nrf_802154_sl_ecb_key_t[NRF_802154_SL_ECB_KEY_LENGTH / sizeof(uint32_t)]; /**< Encryption key type. */ -typedef uint8_t nrf_802154_sl_ecb_cleartext_t[NRF_802154_SL_ECB_CLEARTEXT_LENGTH]; /**< Cleartext data type. */ -typedef uint8_t nrf_802154_sl_ecb_ciphertext_t[NRF_802154_SL_ECB_CIPHERTEXT_LENGTH]; /**< Ciphertext data type. */ - -/**@brief AES ECB data structure */ -typedef struct -{ - nrf_802154_sl_ecb_key_t key; /**< Encryption key. */ - nrf_802154_sl_ecb_cleartext_t cleartext; /**< Cleartext data. */ - nrf_802154_sl_ecb_ciphertext_t ciphertext; /**< Ciphertext data. */ -} nrf_802154_sl_ecb_data_t; - -/**@brief Encrypts a block according to the specified parameters. - * - * @param[in, out] p_ecb_data Pointer to the ECB parameters' struct. - */ -void nrf_802154_sl_ecb_block_encrypt(nrf_802154_sl_ecb_data_t * p_ecb_data); - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif // NRF_802154_SL_ECB_H__ diff --git a/nrf_802154/sl/include/platform/nrf_802154_platform_timestamper.h b/nrf_802154/sl/include/platform/nrf_802154_platform_timestamper.h new file mode 100644 index 0000000000..5bf9439056 --- /dev/null +++ b/nrf_802154/sl/include/platform/nrf_802154_platform_timestamper.h @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2024, Nordic Semiconductor ASA + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +/** + * @brief Abstraction layer for peripheral-to-peripheral hardware connections needed for timestamping. + */ + +#ifndef NRF_802154_PLATFORM_TIMESTAMPER_H_ +#define NRF_802154_PLATFORM_TIMESTAMPER_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Initializes the timestamper platform. + */ +void nrf_802154_platform_timestamper_init(void); + +/** + * @brief Sets up cross-domain hardware connections necessary to capture a timestamp. + * + * This function configures cross-domain hardware connections necessary to capture a timestamp of + * an event from the local domain. These connections are identical for all local domain events. + * + * @note Every call to this function must be paired with a call to @ref + * nrf_802154_platform_timestamper_cross_domain_connections_clear. + */ +void nrf_802154_platform_timestamper_cross_domain_connections_setup(void); + +/** + * @brief Clears cross-domain hardware connections necessary to capture a timestamp. + */ +void nrf_802154_platform_timestamper_cross_domain_connections_clear(void); + +/** + * @brief Sets up local domain hardware connections necessary to capture a timestamp. + * + * This function configures local domain hardware connections necessary to capture a timestamp of + * an event from the local domain. These connections must be setup separately for every local domain + * event. + * + * @param[in] dppi_ch Local domain DPPI channel that the event to be timestamped publishes to. + */ +void nrf_802154_platform_timestamper_local_domain_connections_setup(uint32_t dppi_ch); + +/** + * @brief Clears local domain hardware connections necessary to capture a timestamp. + * + * @param[in] dppi_ch Local domain DPPI channel that the event to be timestamped publishes to. + */ +void nrf_802154_platform_timestamper_local_domain_connections_clear(uint32_t dppi_ch); + +/** + * @brief Reads timestamp captured using the configured hardware connections. + * + * @param[out] p_timestamp Captured timestamp. Only valid if @c true is returned, undefined otherwise. + * + * @retval true The timestamp was captured and read successfully. + * @retval false The timestamp could not be retrieved. + */ +bool nrf_802154_platform_timestamper_captured_timestamp_read(uint64_t * p_captured); + +#ifdef __cplusplus +} +#endif + +#endif // NRF_802154_PLATFORM_TIMESTAMPER_H_ diff --git a/nrf_802154/sl/sl/lib/nRF52833/hard-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nRF52833/hard-float/libnrf-802154-sl.a index 7ccc452937..294c83bec1 100644 Binary files a/nrf_802154/sl/sl/lib/nRF52833/hard-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nRF52833/hard-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nRF52833/soft-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nRF52833/soft-float/libnrf-802154-sl.a index b8c751e64e..a3f6491d2f 100644 Binary files a/nrf_802154/sl/sl/lib/nRF52833/soft-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nRF52833/soft-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nRF52833/softfp-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nRF52833/softfp-float/libnrf-802154-sl.a index dba62f9fc9..dfc32310c9 100644 Binary files a/nrf_802154/sl/sl/lib/nRF52833/softfp-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nRF52833/softfp-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nRF52840/hard-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nRF52840/hard-float/libnrf-802154-sl.a index 7ccc452937..294c83bec1 100644 Binary files a/nrf_802154/sl/sl/lib/nRF52840/hard-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nRF52840/hard-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nRF52840/soft-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nRF52840/soft-float/libnrf-802154-sl.a index b8c751e64e..a3f6491d2f 100644 Binary files a/nrf_802154/sl/sl/lib/nRF52840/soft-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nRF52840/soft-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nRF52840/softfp-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nRF52840/softfp-float/libnrf-802154-sl.a index dba62f9fc9..dfc32310c9 100644 Binary files a/nrf_802154/sl/sl/lib/nRF52840/softfp-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nRF52840/softfp-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nRF5340_CPUNET/soft-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nRF5340_CPUNET/soft-float/libnrf-802154-sl.a index f3e91b331e..936ec82ec4 100644 Binary files a/nrf_802154/sl/sl/lib/nRF5340_CPUNET/soft-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nRF5340_CPUNET/soft-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nRF54H20_CPURAD/hard-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nRF54H20_CPURAD/hard-float/libnrf-802154-sl.a index f3636a2947..ecce7360e7 100644 Binary files a/nrf_802154/sl/sl/lib/nRF54H20_CPURAD/hard-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nRF54H20_CPURAD/hard-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nRF54H20_CPURAD/soft-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nRF54H20_CPURAD/soft-float/libnrf-802154-sl.a index f3636a2947..ecce7360e7 100644 Binary files a/nrf_802154/sl/sl/lib/nRF54H20_CPURAD/soft-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nRF54H20_CPURAD/soft-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nRF54H20_CPURAD/softfp-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nRF54H20_CPURAD/softfp-float/libnrf-802154-sl.a index f3636a2947..ecce7360e7 100644 Binary files a/nrf_802154/sl/sl/lib/nRF54H20_CPURAD/softfp-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nRF54H20_CPURAD/softfp-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nRF54H20_CPURAD_SOC1/hard-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nRF54H20_CPURAD_SOC1/hard-float/libnrf-802154-sl.a index f3636a2947..ecce7360e7 100644 Binary files a/nrf_802154/sl/sl/lib/nRF54H20_CPURAD_SOC1/hard-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nRF54H20_CPURAD_SOC1/hard-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nRF54H20_CPURAD_SOC1/soft-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nRF54H20_CPURAD_SOC1/soft-float/libnrf-802154-sl.a index f3636a2947..ecce7360e7 100644 Binary files a/nrf_802154/sl/sl/lib/nRF54H20_CPURAD_SOC1/soft-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nRF54H20_CPURAD_SOC1/soft-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nRF54H20_CPURAD_SOC1/softfp-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nRF54H20_CPURAD_SOC1/softfp-float/libnrf-802154-sl.a index f3636a2947..ecce7360e7 100644 Binary files a/nrf_802154/sl/sl/lib/nRF54H20_CPURAD_SOC1/softfp-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nRF54H20_CPURAD_SOC1/softfp-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nRF54L15_CPUAPP_SOC1/hard-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/hard-float/libnrf-802154-sl.a similarity index 85% rename from nrf_802154/sl/sl/lib/nRF54L15_CPUAPP_SOC1/hard-float/libnrf-802154-sl.a rename to nrf_802154/sl/sl/lib/nrf54l15_cpuapp/hard-float/libnrf-802154-sl.a index f3636a2947..c1ae7498d7 100644 Binary files a/nrf_802154/sl/sl/lib/nRF54L15_CPUAPP_SOC1/hard-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/hard-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nRF54L15_CPUAPP_SOC1/soft-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/soft-float/libnrf-802154-sl.a similarity index 85% rename from nrf_802154/sl/sl/lib/nRF54L15_CPUAPP_SOC1/soft-float/libnrf-802154-sl.a rename to nrf_802154/sl/sl/lib/nrf54l15_cpuapp/soft-float/libnrf-802154-sl.a index f3636a2947..c1ae7498d7 100644 Binary files a/nrf_802154/sl/sl/lib/nRF54L15_CPUAPP_SOC1/soft-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/soft-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl/lib/nRF54L15_CPUAPP_SOC1/softfp-float/libnrf-802154-sl.a b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/softfp-float/libnrf-802154-sl.a similarity index 85% rename from nrf_802154/sl/sl/lib/nRF54L15_CPUAPP_SOC1/softfp-float/libnrf-802154-sl.a rename to nrf_802154/sl/sl/lib/nrf54l15_cpuapp/softfp-float/libnrf-802154-sl.a index f3636a2947..c1ae7498d7 100644 Binary files a/nrf_802154/sl/sl/lib/nRF54L15_CPUAPP_SOC1/softfp-float/libnrf-802154-sl.a and b/nrf_802154/sl/sl/lib/nrf54l15_cpuapp/softfp-float/libnrf-802154-sl.a differ diff --git a/nrf_802154/sl/sl_opensource/CMakeLists.txt b/nrf_802154/sl/sl_opensource/CMakeLists.txt index 505435548d..3a4a8c9c82 100644 --- a/nrf_802154/sl/sl_opensource/CMakeLists.txt +++ b/nrf_802154/sl/sl_opensource/CMakeLists.txt @@ -48,7 +48,6 @@ target_sources(nrf-802154-sl src/nrf_802154_sl_capabilities.c src/nrf_802154_sl_coex.c src/nrf_802154_sl_crit_sect_if.c - src/nrf_802154_sl_ecb.c src/nrf_802154_sl_fem.c src/nrf_802154_sl_log.c src/nrf_802154_sl_rsch.c diff --git a/nrf_802154/sl/sl_opensource/src/nrf_802154_sl_ecb.c b/nrf_802154/sl/sl_opensource/src/nrf_802154_sl_ecb.c deleted file mode 100644 index 8e67664fba..0000000000 --- a/nrf_802154/sl/sl_opensource/src/nrf_802154_sl_ecb.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2024, Nordic Semiconductor ASA - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "nrf_802154_sl_ecb.h" - -#include - -#if defined(CONFIG_SOC_COMPATIBLE_NRF52X) || defined(CONFIG_SOC_COMPATIBLE_NRF53X) - -#include "hal/nrf_ecb.h" - -#define ECB_INST NRF_ECB - -static inline void sleep_wfe(void) -{ -#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX) - void z_impl_k_busy_wait(); - z_impl_k_busy_wait(10); -#elif defined(CONFIG_SOC_COMPATIBLE_NRF52X) - __WFE(); -#else - /* Do-nothing. This includes nRF5340 series due multiple sleep-related anomalies (160, 165, 168) */ -#endif -} - -static void wait_for_ecb_end(void) -{ - while (!nrf_ecb_event_check(ECB_INST, NRF_ECB_EVENT_ENDECB) && - !nrf_ecb_event_check(ECB_INST, NRF_ECB_EVENT_ERRORECB)) - { -#if !defined(CONFIG_SOC_SERIES_BSIM_NRFXX) - if ((SCB->SCR & SCB_SCR_SEVONPEND_Msk) == SCB_SCR_SEVONPEND_Msk) -#endif - { - NVIC_ClearPendingIRQ(ECB_IRQn); - - uint32_t irq_was_masked = __get_PRIMASK(); - - __disable_irq(); - - nrf_ecb_int_enable(ECB_INST, NRF_ECB_INT_ENDECB_MASK | NRF_ECB_INT_ERRORECB_MASK); - if (!nrf_ecb_event_check(ECB_INST, NRF_ECB_EVENT_ENDECB) && - !nrf_ecb_event_check(ECB_INST, NRF_ECB_EVENT_ERRORECB)) - { - sleep_wfe(); - } - - if (!irq_was_masked) - { - __enable_irq(); - } - } - } -} - -void nrf_802154_sl_ecb_block_encrypt(nrf_802154_sl_ecb_data_t * p_ecb_data) -{ - nrf_ecb_int_disable(ECB_INST, NRF_ECB_INT_ENDECB_MASK | NRF_ECB_INT_ERRORECB_MASK); - - do - { - nrf_ecb_task_trigger(ECB_INST, NRF_ECB_TASK_STOPECB); - nrf_ecb_event_clear(ECB_INST, NRF_ECB_EVENT_ENDECB); - nrf_ecb_event_clear(ECB_INST, NRF_ECB_EVENT_ERRORECB); - nrf_ecb_data_pointer_set(ECB_INST, p_ecb_data); - - nrf_ecb_task_trigger(ECB_INST, NRF_ECB_TASK_STARTECB); - wait_for_ecb_end(); - } - while (nrf_ecb_event_check(ECB_INST, NRF_ECB_EVENT_ERRORECB)); - - nrf_ecb_int_disable(ECB_INST, NRF_ECB_INT_ENDECB_MASK | NRF_ECB_INT_ERRORECB_MASK); - nrf_ecb_event_clear(ECB_INST, NRF_ECB_EVENT_ERRORECB); - nrf_ecb_event_clear(ECB_INST, NRF_ECB_EVENT_ENDECB); - NVIC_ClearPendingIRQ(ECB_IRQn); -} - -#endif /* defined(CONFIG_SOC_COMPATIBLE_NRF52X) || defined(CONFIG_SOC_COMPATIBLE_NRF53X) */