Skip to content

Commit 5697f65

Browse files
ankunsrlubos
authored andcommitted
nrf_802154: rev 68bee073028691c3353b4a15bd5207e51c6c4dd1
This commit updates revision of the nrf_802154 component. Signed-off-by: Andrzej Kuros <andrzej.kuros@nordicsemi.no>
1 parent 6645729 commit 5697f65

23 files changed

+516
-286
lines changed

nrf_802154/common/include/nrf_802154_config.h

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@
3535
#ifndef NRF_802154_CONFIG_H__
3636
#define NRF_802154_CONFIG_H__
3737

38+
/* This file must not include nrf.h or nrfx.h directly or indirectly,
39+
* to avoid circular dependencies.
40+
*/
41+
3842
#ifdef NRF_802154_PROJECT_CONFIG
3943
#include NRF_802154_PROJECT_CONFIG
4044
#endif
4145

42-
#include <nrfx.h>
43-
#include "nrf_802154_nrfx_addons.h"
44-
4546
#ifdef __cplusplus
4647
extern "C" {
4748
#endif
@@ -499,19 +500,6 @@ extern "C" {
499500
#define NRF_802154_ENCRYPTION_ENABLED 1
500501
#endif
501502

502-
/**
503-
* @def NRF_802154_ENCRYPTION_ACCELERATOR_ECB
504-
*
505-
* Enables ECB peripheral to be used as hardware accelerator for on-the-fly AES-CCM* encryption.
506-
*/
507-
#if !defined(NRF_802154_ENCRYPTION_ACCELERATOR_ECB) || defined(__DOXYGEN__)
508-
#if defined(NRF52_SERIES) || defined(NRF5340_XXAA) || defined(__DOXYGEN__)
509-
#define NRF_802154_ENCRYPTION_ACCELERATOR_ECB 1
510-
#elif defined(NRF54H_SERIES) || defined(NRF54L_SERIES)
511-
#define NRF_802154_ENCRYPTION_ACCELERATOR_ECB 0
512-
#endif
513-
#endif
514-
515503
/**
516504
* @}
517505
* @defgroup nrf_802154_ie Information Elements configuration
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
/*
2+
* Copyright (c) 2025, Nordic Semiconductor ASA
3+
* All rights reserved.
4+
*
5+
* SPDX-License-Identifier: BSD-3-Clause
6+
*
7+
* Redistribution and use in source and binary forms, with or without
8+
* modification, are permitted provided that the following conditions are met:
9+
*
10+
* 1. Redistributions of source code must retain the above copyright notice, this
11+
* list of conditions and the following disclaimer.
12+
*
13+
* 2. Redistributions in binary form must reproduce the above copyright
14+
* notice, this list of conditions and the following disclaimer in the
15+
* documentation and/or other materials provided with the distribution.
16+
*
17+
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
18+
* contributors may be used to endorse or promote products derived from this
19+
* software without specific prior written permission.
20+
*
21+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23+
* IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE
24+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31+
* POSSIBILITY OF SUCH DAMAGE.
32+
*
33+
*/
34+
35+
#ifndef NRF_802154_CONFIG_SOC_H_
36+
#define NRF_802154_CONFIG_SOC_H_
37+
38+
/* This file provides information about the SoC to the nRF 802.15.4 driver.
39+
* It defines nrf 802.15.4 driver's internal macros to denote SoC series and
40+
* SoC features based on macros provided by the build system.
41+
*
42+
* This file intentionally does not include nrf.h or nrfx.h to avoid
43+
* circular include dependencies.
44+
*/
45+
46+
#ifdef NRF_802154_SOC_SUPPORTED
47+
#error "Do not define NRF_802154_SOC_SUPPORTED externally"
48+
#endif
49+
50+
#ifdef NRF_802154_SOC_NRF52_SERIES
51+
#error "Do not define NRF_802154_SOC_NRF52_SERIES externally"
52+
#endif
53+
54+
#if defined (NRF52833_XXAA) || defined (NRF52840_XXAA)
55+
#define NRF_802154_SOC_NRF52_SERIES
56+
#define NRF_802154_SOC_SUPPORTED
57+
#endif
58+
59+
#ifdef NRF_802154_SOC_NRF53_SERIES
60+
#error "Do not define NRF_802154_SOC_NRF53_SERIES externally"
61+
#endif
62+
63+
#if defined (NRF5340_XXAA) || defined(NRF5340_XXAA_APPLICATION) || defined(NRF5340_XXAA_NETWORK)
64+
#define NRF_802154_SOC_NRF53_SERIES
65+
#define NRF_802154_SOC_SUPPORTED
66+
#endif
67+
68+
#ifdef NRF_802154_SOC_NRF54H_SERIES
69+
#error "Do not define NRF_802154_SOC_NRF54H_SERIES externally"
70+
#endif
71+
72+
#if defined (NRF54H20_XXAA)
73+
#define NRF_802154_SOC_NRF54H_SERIES
74+
#define NRF_802154_SOC_SUPPORTED
75+
#endif
76+
77+
#ifdef NRF_802154_SOC_NRF54L_SERIES
78+
#error "Do not define NRF_802154_SOC_NRF54L_SERIES externally"
79+
#endif
80+
81+
#if defined (NRF54L05_XXAA) || defined (NRF54LV10A_ENGA_XXAA) || defined (NRF54L10_XXAA) \
82+
|| defined (NRF54L15_XXAA) || defined (NRF54LM20A_ENGA_XXAA)
83+
#define NRF_802154_SOC_NRF54L_SERIES
84+
#define NRF_802154_SOC_SUPPORTED
85+
#endif
86+
87+
#ifdef NRF_802154_SOC_PPI_PRESENT
88+
#error "Do not define NRF_802154_SOC_PPI_PRESENT externally"
89+
#endif
90+
91+
#ifdef NRF_802154_SOC_DPPI_PRESENT
92+
#error "Do not define NRF_802154_SOC_DPPI_PRESENT externally"
93+
#endif
94+
95+
#if defined(NRF_802154_SOC_NRF52_SERIES)
96+
#define NRF_802154_SOC_PPI_PRESENT
97+
#endif
98+
99+
#if defined(NRF_802154_SOC_NRF53_SERIES)
100+
#define NRF_802154_SOC_DPPI_PRESENT
101+
#endif
102+
103+
#if defined(NRF_802154_SOC_NRF54H_SERIES)
104+
#define NRF_802154_SOC_DPPI_PRESENT
105+
#endif
106+
107+
#if defined(NRF_802154_SOC_NRF54L_SERIES)
108+
#define NRF_802154_SOC_DPPI_PRESENT
109+
#endif
110+
111+
#ifdef NRF_802154_USE_INTERNAL_INCLUDES
112+
#include "nrf_802154_soc_config_internal.h"
113+
#endif
114+
115+
#ifndef NRF_802154_SOC_SUPPORTED
116+
#error "nRF 802.15.4 driver is not supported on the selected SoC."
117+
#endif
118+
119+
#endif /* NRF_802154_CONFIG_SOC_H_ */

nrf_802154/doc/CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ Notable changes
2525
* The experimental IFS feature has been removed. (KRKNWK-20788)
2626
* The return value of :c:func:`nrf_802154_transmit_raw`, :c:func:`nrf_802154_transmit_csma_ca_raw`, and :c:func:`nrf_802154_transmit_raw_at` was updated.
2727
These API functions now return ``nrf_802154_tx_error_t`` instead of ``bool``. (KRKNWK-18536)
28+
* The following header files no longer include ``nrf.h`` or ``nrfx.h`` to avoid circular dependencies (KRKNWK-20956):
29+
30+
* ``nrf_802154_peripherals_nrf52.h``
31+
* ``nrf_802154_peripherals_nrf53.h``
32+
* ``nrf_802154_peripherals_nrf54h.h``
33+
* ``nrf_802154_peripherals_nrf54l.h``
2834

2935
Added
3036
=====

nrf_802154/doc/rd_including.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ Using CMake
1616

1717
The nRF 802.15.4 Radio Driver supports the CMake build system and can be directly included in a project using the CMake build system with the ``add_subdirectory(nrfxlib/nrf_802154)`` CMake command.
1818

19-
To do so, you must first set the ``NRF52_SERIES`` or ``NRF53_SERIES`` CMake variable to ``1``, depending on the used SoC family.
20-
2119
If building on a single core SoC, you should then do the following:
2220

2321
1. Link the following libraries (CMake targets) to the application library:

nrf_802154/driver/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ target_sources(nrf-802154-driver
5252
src/nrf_802154_core_hooks.c
5353
src/nrf_802154_critical_section.c
5454
src/nrf_802154_debug.c
55+
src/nrf_802154_debug_gpio.c
5556
src/nrf_802154_encrypt.c
5657
src/nrf_802154_notification_direct.c
5758
src/nrf_802154_notification_swi.c

nrf_802154/driver/src/nrf_802154.c

Lines changed: 9 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include <string.h>
5050

5151
#include "nrf_802154_config.h"
52+
#include "nrf_802154_facade_helpers.h"
5253
#include "nrf_802154_utils.h"
5354
#include "nrf_802154_const.h"
5455
#include "nrf_802154_core.h"
@@ -92,25 +93,6 @@ static uint8_t m_tx_buffer[RAW_PAYLOAD_OFFSET + MAX_PACKET_SIZE];
9293

9394
#endif // NRF_802154_CARRIER_FUNCTIONS_ENABLED
9495

95-
static inline bool are_frame_properties_valid(const nrf_802154_transmitted_frame_props_t * p_props)
96-
{
97-
return p_props->dynamic_data_is_set || !(p_props->is_secured);
98-
}
99-
100-
static inline bool are_extra_cca_attempts_valid(const nrf_802154_transmit_at_metadata_t * p_data)
101-
{
102-
return !p_data->cca || (p_data->extra_cca_attempts < UINT8_MAX);
103-
}
104-
105-
static inline bool is_tx_timestamp_request_valid(const bool tx_timestamp_encode)
106-
{
107-
#if NRF_802154_TX_TIMESTAMP_PROVIDER_ENABLED
108-
return true;
109-
#else
110-
return !tx_timestamp_encode;
111-
#endif
112-
}
113-
11496
void nrf_802154_channel_set(uint8_t channel)
11597
{
11698
bool changed = nrf_802154_pib_channel_get() != channel;
@@ -403,16 +385,7 @@ nrf_802154_tx_error_t nrf_802154_transmit_raw(uint8_t
403385

404386
if (p_metadata == NULL)
405387
{
406-
static const nrf_802154_transmit_metadata_t metadata_default =
407-
{
408-
.frame_props = NRF_802154_TRANSMITTED_FRAME_PROPS_DEFAULT_INIT,
409-
.cca = true,
410-
.tx_power = {.use_metadata_value = false},
411-
.tx_channel = {.use_metadata_value = false},
412-
.tx_timestamp_encode = false
413-
};
414-
415-
p_metadata = &metadata_default;
388+
p_metadata = nrf_802154_transmit_metadata_default_ptr_get();
416389
}
417390

418391
result = nrf_802154_frame_parser_data_init(p_data,
@@ -432,8 +405,7 @@ nrf_802154_tx_error_t nrf_802154_transmit_raw(uint8_t
432405

433406
if (result)
434407
{
435-
result = are_frame_properties_valid(&p_metadata->frame_props) &&
436-
is_tx_timestamp_request_valid(p_metadata->tx_timestamp_encode);
408+
result = nrf_802154_transmit_metadata_is_valid(p_metadata);
437409
}
438410

439411
if (result)
@@ -459,21 +431,14 @@ nrf_802154_tx_error_t nrf_802154_transmit_raw_at(
459431
bool result;
460432
nrf_802154_frame_t frame;
461433
nrf_802154_tx_error_t error;
462-
nrf_802154_transmit_at_metadata_t metadata_default =
463-
{
464-
.frame_props = NRF_802154_TRANSMITTED_FRAME_PROPS_DEFAULT_INIT,
465-
.cca = true,
466-
.tx_power = {.use_metadata_value = false},
467-
.extra_cca_attempts = 0,
468-
.tx_timestamp_encode = false,
469-
};
434+
nrf_802154_transmit_at_metadata_t metadata_default;
470435

471436
nrf_802154_log_function_enter(NRF_802154_LOG_VERBOSITY_LOW);
472437

473438
if (p_metadata == NULL)
474439
{
475-
metadata_default.channel = nrf_802154_channel_get();
476-
p_metadata = &metadata_default;
440+
nrf_802154_transmit_at_metadata_default_prepare(&metadata_default);
441+
p_metadata = &metadata_default;
477442
}
478443

479444
result = nrf_802154_frame_parser_data_init(p_data,
@@ -493,9 +458,7 @@ nrf_802154_tx_error_t nrf_802154_transmit_raw_at(
493458

494459
if (result)
495460
{
496-
result = are_frame_properties_valid(&p_metadata->frame_props) &&
497-
are_extra_cca_attempts_valid(p_metadata) &&
498-
is_tx_timestamp_request_valid(p_metadata->tx_timestamp_encode);
461+
result = nrf_802154_transmit_at_metadata_is_valid(p_metadata);
499462
}
500463

501464
if (result)
@@ -766,15 +729,7 @@ nrf_802154_tx_error_t nrf_802154_transmit_csma_ca_raw(
766729

767730
if (p_metadata == NULL)
768731
{
769-
static const nrf_802154_transmit_csma_ca_metadata_t metadata_default =
770-
{
771-
.frame_props = NRF_802154_TRANSMITTED_FRAME_PROPS_DEFAULT_INIT,
772-
.tx_power = {.use_metadata_value = false},
773-
.tx_channel = {.use_metadata_value = false},
774-
.tx_timestamp_encode = false
775-
};
776-
777-
p_metadata = &metadata_default;
732+
p_metadata = nrf_802154_transmit_csma_ca_metadata_default_ptr_get();
778733
}
779734

780735
result = nrf_802154_frame_parser_data_init(p_data,
@@ -794,8 +749,7 @@ nrf_802154_tx_error_t nrf_802154_transmit_csma_ca_raw(
794749

795750
if (result)
796751
{
797-
result = are_frame_properties_valid(&p_metadata->frame_props) &&
798-
is_tx_timestamp_request_valid(p_metadata->tx_timestamp_encode);
752+
result = nrf_802154_transmit_csma_ca_metadata_is_valid(p_metadata);
799753
}
800754

801755
if (result)

nrf_802154/driver/src/nrf_802154_aes_ccm_acc_ccm.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@
3333
*/
3434

3535
#include "nrf_802154_config.h"
36+
#include "nrf_802154_peripherals.h"
3637

37-
#if NRF_802154_ENCRYPTION_ENABLED && !NRF_802154_ENCRYPTION_ACCELERATOR_ECB
38+
#if NRF_802154_ENCRYPTION_ENABLED && defined(NRF_802154_ENCRYPTION_ACCELERATOR_CCM)
3839

3940
/** Configures if the CCM's OUT.PTR pointer points to the same memory location as PACKETPTR register
4041
* of the RADIO.
@@ -48,6 +49,7 @@
4849
#define CCM_ADATA_ATTR_ID 13 ///< Attribute field that identifies the adata CCM job
4950
#define CCM_MDATA_ATTR_ID 14 ///< Attribute field that identifies the mdata CCM job
5051

52+
#include <nrfx.h>
5153
#include "nrf_802154_aes_ccm.h"
5254

5355
#include <string.h>
@@ -383,4 +385,4 @@ void nrf_802154_aes_ccm_transform_reset(void)
383385
memset(m_nonce, 0, sizeof(m_nonce));
384386
}
385387

386-
#endif // NRF_802154_ENCRYPTION_ENABLED && !NRF_802154_ENCRYPTION_ACCELERATOR_ECB
388+
#endif // NRF_802154_ENCRYPTION_ENABLED && defined(NRF_802154_ENCRYPTION_ACCELERATOR_CCM)

nrf_802154/driver/src/nrf_802154_aes_ccm_acc_ecb.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,17 @@
3333
*/
3434

3535
#include "nrf_802154_config.h"
36+
#include "nrf_802154_peripherals.h"
3637

37-
#if NRF_802154_ENCRYPTION_ACCELERATOR_ECB
38+
#if NRF_802154_ENCRYPTION_ENABLED && defined(NRF_802154_ENCRYPTION_ACCELERATOR_ECB)
3839

40+
#include <nrfx.h>
3941
#include "nrf_802154_aes_ccm.h"
4042

4143
#include "nrf_802154_assert.h"
4244
#include <string.h>
4345

4446
#include "nrf_802154_const.h"
45-
#include "nrf_802154_config.h"
4647
#include "nrf_802154_tx_work_buffer.h"
4748
#if defined(CONFIG_MPSL)
4849
#include "mpsl_ecb.h"
@@ -614,4 +615,4 @@ void nrf_802154_aes_ccm_transform_abort(uint8_t * p_frame)
614615
m_aes_ccm_data.raw_frame = NULL;
615616
}
616617

617-
#endif /* NRF_802154_ENCRYPTION_ACCELERATOR_ECB */
618+
#endif /* NRF_802154_ENCRYPTION_ENABLED && defined(NRF_802154_ENCRYPTION_ACCELERATOR_ECB) */

0 commit comments

Comments
 (0)