Skip to content

Commit 897edab

Browse files
committed
nrf_802154: rev dd2f456a2f55e6d0445dc4b1e9b30efac56b8bd4
This commit updates revision of the nrf_802154 component. Signed-off-by: Piotr Koziar <[email protected]>
1 parent bc14fc9 commit 897edab

13 files changed

+192
-50
lines changed

nrf_802154/driver/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ target_sources(nrf-802154-driver
6363
src/nrf_802154_rx_buffer.c
6464
src/nrf_802154_stats.c
6565
src/nrf_802154_swi.c
66+
src/nrf_802154_swi_callouts_weak.c
6667
src/nrf_802154_trx.c
6768
src/nrf_802154_trx_dppi.c
6869
src/nrf_802154_trx_ppi.c

nrf_802154/driver/src/mac_features/nrf_802154_tx_timestamp_provider.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
#if NRF_802154_TX_TIMESTAMP_PROVIDER_ENABLED
4848

49-
static uint64_t m_tx_timestamp_us; ///< Cached transmit timestamp.
49+
static uint32_t m_tx_timestamp_us; ///< Cached transmit timestamp.
5050
static uint8_t * mp_tx_timestamp_addr; ///< Cached tx timestamp placeholder address.
5151

5252
nrf_802154_tx_error_t nrf_802154_tx_timestamp_provider_tx_setup(
@@ -127,8 +127,14 @@ void nrf_802154_tx_timestamp_provider_tx_started_hook(uint8_t * p_frame)
127127
* This function executes approximately 32us before the first bit of PHR.
128128
* The calculation takes it into account by adding 32us to the current time.
129129
*/
130-
m_tx_timestamp_us = nrf_802154_sl_timer_current_time_get() + 32;
131-
host_64_to_big(m_tx_timestamp_us, mp_tx_timestamp_addr);
130+
NRF_STATIC_ASSERT(NRF_802154_TX_TIMESTAMP_PROVIDER_TIMESTAMP_SIZE == 4,
131+
"Currently, only TX timestamp size 4 can be handled.");
132+
/* The current time value is 64 bits (8 bytes).
133+
* Since the timestamp size is 32 bits (4 bytes),
134+
* only the least significant 32 bits are used.
135+
*/
136+
m_tx_timestamp_us = (uint32_t)(nrf_802154_sl_timer_current_time_get()) + 32U;
137+
host_32_to_little(m_tx_timestamp_us, mp_tx_timestamp_addr);
132138

133139
mp_tx_timestamp_addr = NULL;
134140
}

nrf_802154/driver/src/mac_features/nrf_802154_tx_timestamp_provider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
#include "nrf_802154_types_internal.h"
4242

43-
#define NRF_802154_TX_TIMESTAMP_PROVIDER_TIMESTAMP_SIZE (sizeof(uint64_t))
43+
#define NRF_802154_TX_TIMESTAMP_PROVIDER_TIMESTAMP_SIZE (sizeof(uint32_t))
4444

4545
/**
4646
* @brief TX setup hook for the tx timestamp provider module.

nrf_802154/driver/src/nrf_802154_peripherals.h

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,19 +235,34 @@ extern "C" {
235235
#define NRF_802154_EGU_SYNC_USED_CHANNELS_MASK (1U << NRF_802154_EGU_SYNC_CHANNEL_NO)
236236

237237
/**
238-
* @def NRF_802154_EGU_RAMP_UP_CHANNEL_NO
238+
* @def NRF_802154_EGU_TRIGGER_CHANNEL_NO
239239
*
240-
* The channel number of the @ref NRF_802154_EGU_INSTANCE used for triggering the ramp-up of the RADIO.
240+
* The channel number of the @ref NRF_802154_EGU_INSTANCE used for triggering the radio hardware.
241241
*/
242-
#define NRF_802154_EGU_RAMP_UP_CHANNEL_NO 15
242+
#define NRF_802154_EGU_TRIGGER_CHANNEL_NO 14
243243

244244
/**
245-
* @def NRF_802154_EGU_RAMP_UP_USED_CHANNELS_MASK
245+
* @def NRF_802154_EGU_TRIGGER_EVENT
246246
*
247-
* Mask of EGU channels used for triggering the ramp-up of the RADIO.
248-
* See @ref NRF_802154_EGU_USED_CHANNELS_MASK.
247+
* The EGU event used by the driver to trigger the radio hardware.
248+
*/
249+
#define NRF_802154_EGU_TRIGGER_EVENT NRFX_CONCAT_2(NRF_EGU_EVENT_TRIGGERED, \
250+
NRF_802154_EGU_TRIGGER_CHANNEL_NO)
251+
252+
/**
253+
* @def NRF_802154_EGU_TRIGGER_TASK
254+
*
255+
* The EGU task used by the driver to trigger the radio hardware.
256+
*/
257+
#define NRF_802154_EGU_TRIGGER_TASK NRFX_CONCAT_2(NRF_EGU_TASK_TRIGGER, \
258+
NRF_802154_EGU_TRIGGER_CHANNEL_NO)
259+
260+
/**
261+
* @def NRF_802154_EGU_RAMP_UP_CHANNEL_NO
262+
*
263+
* The channel number of the @ref NRF_802154_EGU_INSTANCE used for triggering the ramp-up of the RADIO.
249264
*/
250-
#define NRF_802154_EGU_RAMP_UP_USED_CHANNELS_MASK (1U << NRF_802154_EGU_RAMP_UP_CHANNEL_NO)
265+
#define NRF_802154_EGU_RAMP_UP_CHANNEL_NO 15
251266

252267
/**
253268
* @def NRF_802154_EGU_RAMP_UP_EVENT
@@ -265,6 +280,15 @@ extern "C" {
265280
#define NRF_802154_EGU_RAMP_UP_TASK NRFX_CONCAT_2(NRF_EGU_TASK_TRIGGER, \
266281
NRF_802154_EGU_RAMP_UP_CHANNEL_NO)
267282

283+
/**
284+
* @def NRF_802154_EGU_RAMP_UP_USED_CHANNELS_MASK
285+
*
286+
* Mask of EGU channels used for triggering the ramp-up of the RADIO.
287+
* See @ref NRF_802154_EGU_USED_CHANNELS_MASK.
288+
*/
289+
#define NRF_802154_EGU_RAMP_UP_USED_CHANNELS_MASK (1U << NRF_802154_EGU_RAMP_UP_CHANNEL_NO) | \
290+
(1U << NRF_802154_EGU_TRIGGER_CHANNEL_NO)
291+
268292
#ifndef NRF_802154_EGU_TIMER_START_USED_CHANNELS_MASK
269293
#define NRF_802154_EGU_TIMER_START_USED_CHANNELS_MASK 0U
270294
#endif

nrf_802154/driver/src/nrf_802154_peripherals_nrf53.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ extern "C" {
9999
* The channel number of the @ref NRF_802154_EGU_INSTANCE used for starting the TIMER.
100100
* Used only when @ref NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US is non-zero.
101101
*/
102-
#define NRF_802154_EGU_TIMER_START_CHANNEL_NO 14
102+
#define NRF_802154_EGU_TIMER_START_CHANNEL_NO 13
103103

104104
#define NRF_802154_EGU_TIMER_START_USED_CHANNELS_MASK \
105105
(1U << NRF_802154_EGU_TIMER_START_CHANNEL_NO)
@@ -110,7 +110,7 @@ extern "C" {
110110
* The channel number of the @ref NRF_802154_EGU_INSTANCE used for starting the TIMER (second source).
111111
* Used only when @ref NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US is non-zero.
112112
*/
113-
#define NRF_802154_EGU_TIMER_START2_CHANNEL_NO 13
113+
#define NRF_802154_EGU_TIMER_START2_CHANNEL_NO 12
114114

115115
#define NRF_802154_EGU_TIMER_START2_USED_CHANNELS_MASK \
116116
(1U << NRF_802154_EGU_TIMER_START2_CHANNEL_NO)

nrf_802154/driver/src/nrf_802154_peripherals_nrf54l.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ extern "C" {
9898
* The channel number of the @ref NRF_802154_EGU_INSTANCE used for starting the TIMER.
9999
* Used only when @ref NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US is non-zero.
100100
*/
101-
#define NRF_802154_EGU_TIMER_START_CHANNEL_NO 14
101+
#define NRF_802154_EGU_TIMER_START_CHANNEL_NO 13
102102

103103
#define NRF_802154_EGU_TIMER_START_USED_CHANNELS_MASK \
104104
(1U << NRF_802154_EGU_TIMER_START_CHANNEL_NO)
@@ -109,7 +109,7 @@ extern "C" {
109109
* The channel number of the @ref NRF_802154_EGU_INSTANCE used for starting the TIMER (second source).
110110
* Used only when @ref NRF_802154_CCAIDLE_TO_TXEN_EXTRA_TIME_US is non-zero.
111111
*/
112-
#define NRF_802154_EGU_TIMER_START2_CHANNEL_NO 13
112+
#define NRF_802154_EGU_TIMER_START2_CHANNEL_NO 12
113113

114114
#define NRF_802154_EGU_TIMER_START2_USED_CHANNELS_MASK \
115115
(1U << NRF_802154_EGU_TIMER_START2_CHANNEL_NO)

nrf_802154/driver/src/nrf_802154_swi.c

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@
3939
*/
4040

4141
#include "nrf_802154_swi.h"
42+
#include "nrf_802154_swi_callouts.h"
4243

4344
#include <stdbool.h>
44-
#include <stdint.h>
4545

46-
#include "compiler_abstraction.h"
47-
#include "nrf_802154.h"
4846
#include "nrf_802154_config.h"
47+
#if !NRF_802154_INTERNAL_SWI_IRQ_HANDLING
48+
#include "nrf_802154_irq_handlers.h"
49+
#endif
50+
#include "nrf_802154_peripherals.h"
4951
#include "platform/nrf_802154_irq.h"
5052

5153
#if NRF_802154_INTERNAL_SWI_IRQ_HANDLING
@@ -55,20 +57,7 @@
5557
#define SWI_IRQHandler nrf_802154_swi_irq_handler ///< Symbol of SWI IRQ handler.
5658
#endif
5759

58-
__WEAK void nrf_802154_trx_swi_irq_handler(void)
59-
{
60-
/* Implementation provided by other module if necessary */
61-
}
62-
63-
__WEAK void nrf_802154_notification_swi_irq_handler(void)
64-
{
65-
/* Implementation provided by other module if necessary */
66-
}
67-
68-
__WEAK void nrf_802154_request_swi_irq_handler(void)
69-
{
70-
/* Implementation provided by other module if necessary */
71-
}
60+
static bool initialized = false;
7261

7362
static void swi_irq_handler(void)
7463
{
@@ -79,14 +68,12 @@ static void swi_irq_handler(void)
7968

8069
void nrf_802154_swi_init(void)
8170
{
82-
static bool initialized = false;
83-
8471
if (!initialized)
8572
{
86-
nrf_802154_irq_init(nrfx_get_irq_number(NRF_802154_EGU_INSTANCE),
87-
NRF_802154_SWI_PRIORITY,
88-
swi_irq_handler);
89-
nrf_802154_irq_enable(nrfx_get_irq_number(NRF_802154_EGU_INSTANCE));
73+
IRQn_Type irq_number = nrfx_get_irq_number(NRF_802154_EGU_INSTANCE);
74+
75+
nrf_802154_irq_init(irq_number, NRF_802154_SWI_PRIORITY, &swi_irq_handler);
76+
nrf_802154_irq_enable(irq_number);
9077
initialized = true;
9178
}
9279
}
@@ -95,3 +82,11 @@ void SWI_IRQHandler(void)
9582
{
9683
swi_irq_handler();
9784
}
85+
86+
#ifdef TEST
87+
void nrf_802154_swi_module_reset(void)
88+
{
89+
initialized = false;
90+
}
91+
92+
#endif // TEST

nrf_802154/driver/src/nrf_802154_swi.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@
3535
#ifndef NRF_802154_SWI_H__
3636
#define NRF_802154_SWI_H__
3737

38-
#include <stdbool.h>
39-
#include <stdint.h>
40-
4138
#ifdef __cplusplus
4239
extern "C" {
4340
#endif
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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_SWI_CALLOUTS_H__
36+
#define NRF_802154_SWI_CALLOUTS_H__
37+
38+
#ifdef __cplusplus
39+
extern "C" {
40+
#endif
41+
42+
/** @brief Callout from SWI for nrf_802154_trx module. */
43+
void nrf_802154_trx_swi_irq_handler(void);
44+
45+
/** @brief Callout from SWI for nrf_802154_notification_swi module. */
46+
void nrf_802154_notification_swi_irq_handler(void);
47+
48+
/** @brief Callout from SWI for nrf_802154_request_swi module. */
49+
void nrf_802154_request_swi_irq_handler(void);
50+
51+
#ifdef __cplusplus
52+
}
53+
#endif
54+
55+
#endif /* NRF_802154_SWI_CALLOUTS_H__ */
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
#include "nrf_802154_swi_callouts.h"
36+
#include "compiler_abstraction.h"
37+
38+
__WEAK void nrf_802154_trx_swi_irq_handler(void)
39+
{
40+
/* Implementation provided by other module if necessary */
41+
}
42+
43+
__WEAK void nrf_802154_notification_swi_irq_handler(void)
44+
{
45+
/* Implementation provided by other module if necessary */
46+
}
47+
48+
__WEAK void nrf_802154_request_swi_irq_handler(void)
49+
{
50+
/* Implementation provided by other module if necessary */
51+
}

0 commit comments

Comments
 (0)