Skip to content

Commit adbb64e

Browse files
committed
nrf_802154: rev 38ca430cc7c375dd06db8c66b532cdfbad17783f
This commit updates revision of the nrf_802154 component. Signed-off-by: Rafal Kuznia <[email protected]>
1 parent 8f3c1e8 commit adbb64e

File tree

5 files changed

+98
-22
lines changed

5 files changed

+98
-22
lines changed

nrf_802154/common/include/nrf_802154.h

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -801,8 +801,8 @@ void nrf_802154_promiscuous_set(bool enabled);
801801
/**
802802
* @brief Checks if the radio is in the promiscuous mode.
803803
*
804-
* @retval True Radio is in the promiscuous mode.
805-
* @retval False Radio is not in the promiscuous mode.
804+
* @retval true Radio is in the promiscuous mode.
805+
* @retval false Radio is not in the promiscuous mode.
806806
*/
807807
bool nrf_802154_promiscuous_get(void);
808808

@@ -833,8 +833,8 @@ void nrf_802154_auto_ack_set(bool enabled);
833833
/**
834834
* @brief Checks if the auto ACK is enabled.
835835
*
836-
* @retval True Auto ACK is enabled.
837-
* @retval False Auto ACK is disabled.
836+
* @retval true Auto ACK is enabled.
837+
* @retval false Auto ACK is disabled.
838838
*/
839839
bool nrf_802154_auto_ack_get(void);
840840

@@ -926,8 +926,8 @@ void nrf_802154_src_addr_matching_method_set(nrf_802154_src_addr_match_t match_m
926926
* @param[in] length Length of @p p_data.
927927
* @param[in] data_type Type of data to be set. Refer to the @ref nrf_802154_ack_data_t type.
928928
*
929-
* @retval True Address successfully added to the list.
930-
* @retval False Not enough memory to store this address in the list.
929+
* @retval true Address successfully added to the list.
930+
* @retval false Not enough memory to store this address in the list.
931931
*/
932932
bool nrf_802154_ack_data_set(const uint8_t * p_addr,
933933
bool extended,
@@ -953,8 +953,8 @@ bool nrf_802154_ack_data_set(const uint8_t * p_addr,
953953
* @param[in] extended If the given address is an extended MAC address or a short MAC address.
954954
* @param[in] data_type Type of data to be removed. Refer to the @ref nrf_802154_ack_data_t type.
955955
*
956-
* @retval True Address removed from the list.
957-
* @retval False Address not found in the list.
956+
* @retval true Address removed from the list.
957+
* @retval false Address not found in the list.
958958
*/
959959
bool nrf_802154_ack_data_clear(const uint8_t * p_addr,
960960
bool extended,
@@ -1007,8 +1007,8 @@ void nrf_802154_auto_pending_bit_set(bool enabled);
10071007
* @param[in] p_addr Array of bytes containing the address of the node (little-endian).
10081008
* @param[in] extended If the given address is an extended MAC address or a short MAC address.
10091009
*
1010-
* @retval True The address is successfully added to the list.
1011-
* @retval False Not enough memory to store the address in the list.
1010+
* @retval true The address is successfully added to the list.
1011+
* @retval false Not enough memory to store the address in the list.
10121012
*/
10131013
bool nrf_802154_pending_bit_for_addr_set(const uint8_t * p_addr, bool extended);
10141014

@@ -1027,8 +1027,8 @@ bool nrf_802154_pending_bit_for_addr_set(const uint8_t * p_addr, bool extended);
10271027
* @param[in] p_addr Array of bytes containing the address of the node (little-endian).
10281028
* @param[in] extended If the given address is an extended MAC address or a short MAC address.
10291029
*
1030-
* @retval True The address is successfully removed from the list.
1031-
* @retval False No such address in the list.
1030+
* @retval true The address is successfully removed from the list.
1031+
* @retval false No such address in the list.
10321032
*/
10331033
bool nrf_802154_pending_bit_for_addr_clear(const uint8_t * p_addr, bool extended);
10341034

@@ -1533,6 +1533,23 @@ void nrf_802154_cst_writer_period_set(uint16_t period);
15331533
*/
15341534
void nrf_802154_cst_writer_anchor_time_set(uint64_t anchor_time);
15351535

1536+
/**
1537+
* @brief Returns if the radio has PA modulation fix enabled.
1538+
*
1539+
* @retval true PA modulation fix is enabled.
1540+
* @retval false PA modulation fix is disabled.
1541+
*/
1542+
bool nrf_802154_pa_modulation_fix_get(void);
1543+
1544+
/**
1545+
* @brief Enables or disables the PA modulation fix.
1546+
*
1547+
* @note The PA modulation fix is enabled by default on the chips that require it.
1548+
*
1549+
* @param[in] enabled If the PA modulation fix is to be enabled.
1550+
*/
1551+
void nrf_802154_pa_modulation_fix_set(bool enable);
1552+
15361553
/**
15371554
* @}
15381555
* @defgroup nrf_802154_test_modes Test modes

nrf_802154/doc/CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ Added
4242
* Added a TX diagnostic mode that permits sending arbitrary data payloads.
4343
Enable this feature with the :c:macro:`NRF_802154_TX_DIAGNOSTIC_MODE` configuration macro.
4444
When enabled, the driver must be built with reduced functionality. (KRKNWK-20784)
45+
* Added support for controlling the PA modulation fix at runtime. (KRKNWK-21006)
46+
47+
The fix is enabled by default on all SoCs that require it.
48+
You can use the :c:func:`nrf_802154_pa_modulation_fix_set` function to enable or disable the fix at runtime.
49+
50+
On SoCs that do not require the fix, enabling it has no effect.
4551

4652
nRF Connect SDK v3.1.0 - nRF 802.15.4 Radio Driver
4753
**************************************************

nrf_802154/driver/src/nrf_802154.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
#include "nrf_802154_pib.h"
6060
#include "nrf_802154_request.h"
6161
#include "nrf_802154_rx_buffer.h"
62+
#include "nrf_802154_trx.h"
6263
#include "nrf_802154_tx_power.h"
6364
#include "nrf_802154_stats.h"
6465
#include "nrf_802154_swi.h"
@@ -628,6 +629,16 @@ void nrf_802154_promiscuous_set(bool enabled)
628629
nrf_802154_pib_promiscuous_set(enabled);
629630
}
630631

632+
bool nrf_802154_pa_modulation_fix_get(void)
633+
{
634+
return nrf_802154_trx_pa_modulation_fix_get();
635+
}
636+
637+
void nrf_802154_pa_modulation_fix_set(bool enable)
638+
{
639+
nrf_802154_trx_pa_modulation_fix_set(enable);
640+
}
641+
631642
void nrf_802154_rx_on_when_idle_set(bool enabled)
632643
{
633644
nrf_802154_pib_rx_on_when_idle_set(enabled);

nrf_802154/driver/src/nrf_802154_trx.c

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ void nrf_802154_radio_irq_handler(void); ///< Prototype required by internal RAD
175175
#define NRF_802154_TRX_TEST_MODE_ALLOW_LATE_TX_ACK 0
176176
#endif
177177

178+
#if !defined(CONFIG_SOC_SERIES_BSIM_NRFXX) && (defined(NRF5340_XXAA) || \
179+
NRF54L_CONFIGURATION_56_ENABLE)
180+
#define NRF_802154_TRX_PA_MODULATION_FIX
181+
#endif
182+
178183
#if !defined(CONFIG_SOC_SERIES_BSIM_NRFXX)
179184
/// System Clock Frequency (Core Clock) provided by nrfx.
180185
extern uint32_t SystemCoreClock;
@@ -243,6 +248,10 @@ static volatile uint32_t m_timer_value_on_radio_end_event;
243248
static volatile bool m_transmit_with_cca;
244249
static volatile uint8_t m_remaining_cca_attempts;
245250

251+
#if defined(NRF_802154_TRX_PA_MODULATION_FIX)
252+
static bool m_pa_modulation_fix_enabled = true;
253+
#endif /* NRF_802154_TRX_PA_MODULATION_FIX */
254+
246255
static void timer_frequency_set_1mhz(void);
247256

248257
static void rxframe_finish_disable_ppis(void);
@@ -803,31 +812,26 @@ static void pa_modulation_fix_apply(bool enable)
803812
volatile uint32_t * p_radio_reg;
804813

805814
#if defined(NRF5340_XXAA)
815+
#define PA_MOD_FILTER_VALUE 0x40081B08
806816
p_radio_reg = (volatile uint32_t *)(RADIO_BASE + 0x584UL);
807-
#elif NRF54L_CONFIGURATION_56_ENABLE
817+
#elif NRF54L_CONFIGURATION_56_ENABLE /* MLTPAN-56 */
818+
#define PA_MOD_FILTER_VALUE 0x01280001ul
808819
p_radio_reg = (volatile uint32_t *)(RADIO_BASE + 0x8C4UL);
809820
#else
810821
#error Unknown SoC
811822
#endif
812823

813-
if (enable)
824+
if (enable && m_pa_modulation_fix_enabled)
814825
{
815826
mpsl_fem_caps_t fem_caps = {};
816827

817828
mpsl_fem_caps_get(&fem_caps);
818829

819830
if ((fem_caps.flags & MPSL_FEM_CAPS_FLAG_PA_SETUP_REQUIRED) != 0)
820831
{
821-
#if defined(NRF5340_XXAA)
822832
m_pa_mod_filter_latched = *(p_radio_reg);
823833
m_pa_mod_filter_is_latched = true;
824-
*(p_radio_reg) = 0x40081B08;
825-
#elif NRF54L_CONFIGURATION_56_ENABLE
826-
// MLTPAN-56
827-
m_pa_mod_filter_latched = *(p_radio_reg);
828-
m_pa_mod_filter_is_latched = true;
829-
*(p_radio_reg) = 0x01280001ul;
830-
#endif
834+
*(p_radio_reg) = PA_MOD_FILTER_VALUE;
831835
}
832836
}
833837
else if (m_pa_mod_filter_is_latched)
@@ -841,12 +845,33 @@ static void pa_modulation_fix_apply(bool enable)
841845
#endif /* !defined(CONFIG_SOC_SERIES_BSIM_NRFXX) */
842846
}
843847

848+
void nrf_802154_trx_pa_modulation_fix_set(bool enable)
849+
{
850+
#if defined(NRF_802154_TRX_PA_MODULATION_FIX)
851+
m_pa_modulation_fix_enabled = enable;
852+
#else
853+
(void)enable;
854+
#endif /* NRF_802154_TRX_PA_MODULATION_FIX */
855+
}
856+
857+
bool nrf_802154_trx_pa_modulation_fix_get(void)
858+
{
859+
#if defined(NRF_802154_TRX_PA_MODULATION_FIX)
860+
return m_pa_modulation_fix_enabled;
861+
#else
862+
return false;
863+
#endif /* NRF_802154_TRX_PA_MODULATION_FIX */
864+
}
865+
844866
void nrf_802154_trx_module_reset(void)
845867
{
846868
m_trx_state = TRX_STATE_DISABLED;
847869
m_timer_value_on_radio_end_event = 0;
848870
m_transmit_with_cca = false;
849871
mp_receive_buffer = NULL;
872+
#if defined(NRF_802154_TRX_PA_MODULATION_FIX)
873+
m_pa_modulation_fix_enabled = true;
874+
#endif /* NRF_802154_TRX_PA_MODULATION_FIX */
850875

851876
memset(&m_flags, 0, sizeof(m_flags));
852877
}

nrf_802154/driver/src/nrf_802154_trx.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,23 @@ void nrf_802154_trx_enable(void);
162162
*/
163163
void nrf_802154_trx_disable(void);
164164

165+
/**
166+
* @brief Returns if the radio has PA modulation fix enabled.
167+
*
168+
* @retval True PA modulation fix is enabled.
169+
* @retval False PA modulation fix is disabled.
170+
*/
171+
bool nrf_802154_trx_pa_modulation_fix_get(void);
172+
173+
/**
174+
* @brief Enables or disables the PA modulation fix.
175+
*
176+
* @note The PA modulation fix is enabled by default on the chips that require it.
177+
*
178+
* @param[in] enabled If the PA modulation fix is to be enabled.
179+
*/
180+
void nrf_802154_trx_pa_modulation_fix_set(bool enable);
181+
165182
/**
166183
* @brief Updates currently used antenna.
167184
*

0 commit comments

Comments
 (0)