Skip to content

Commit 5c82839

Browse files
committed
samples: remove unused platforms from radio_test source code
removed unsupported platforms specific code (nrf53, nrf54h) from the sample. In sdk-nrf-bm it only supports nrf54l Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
1 parent 3dce12b commit 5c82839

7 files changed

Lines changed: 7 additions & 352 deletions

File tree

samples/peripherals/radio_test/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ CONFIG_DYNAMIC_INTERRUPTS=y
1111

1212
CONFIG_NRFX_TIMER=y
1313
CONFIG_NRFX_GPPI=y
14-
CONFIG_CLOCK_CONTROL=y
1514

1615
CONFIG_ENTROPY_GENERATOR=y
1716
CONFIG_NRF_SECURITY=y

samples/peripherals/radio_test/src/main.c

Lines changed: 0 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
#if defined(NRF54L15_XXAA)
1212
#include <hal/nrf_clock.h>
1313
#endif /* defined(NRF54L15_XXAA) */
14-
#if defined(CONFIG_CLOCK_CONTROL_NRF2)
15-
#include <hal/nrf_lrcconf.h>
16-
#endif
1714
#include <nrfx.h>
1815
/* TODO: DRGN-27733 Remove the alternative condition for nRF54LS05B
1916
* when the errata has been applied to this chip and the errata
@@ -29,7 +26,6 @@
2926
/* Empty trim value */
3027
#define TRIM_VALUE_EMPTY 0xFFFFFFFF
3128

32-
#if defined(CONFIG_CLOCK_CONTROL_NRF)
3329
static void clock_init(void)
3430
{
3531
int err;
@@ -78,129 +74,11 @@ static void clock_init(void)
7874
printk("Clock has started\n");
7975
}
8076

81-
#elif defined(CONFIG_CLOCK_CONTROL_NRF2)
82-
83-
static void clock_init(void)
84-
{
85-
int err;
86-
int res;
87-
const struct device *radio_clk_dev =
88-
DEVICE_DT_GET_OR_NULL(DT_CLOCKS_CTLR(DT_NODELABEL(radio)));
89-
struct onoff_client radio_cli;
90-
91-
/** Keep radio domain powered all the time to reduce latency. */
92-
nrf_lrcconf_poweron_force_set(NRF_LRCCONF010, NRF_LRCCONF_POWER_DOMAIN_1, true);
93-
94-
sys_notify_init_spinwait(&radio_cli.notify);
95-
96-
err = nrf_clock_control_request(radio_clk_dev, NULL, &radio_cli);
97-
98-
do {
99-
err = sys_notify_fetch_result(&radio_cli.notify, &res);
100-
if (!err && res) {
101-
printk("Clock could not be started: %d\n", res);
102-
return;
103-
}
104-
} while (err == -EAGAIN);
105-
106-
printk("Clock has started\n");
107-
}
108-
109-
#if defined(CONFIG_SOC_SERIES_NRF54H)
110-
static void nrf54hx_radio_trim(void)
111-
{
112-
/* Apply HMPAN-102 workaround for nRF54H series */
113-
*(volatile uint32_t *)0x5302C7E4 =
114-
(((*((volatile uint32_t *)0x5302C7E4)) & 0xFF000FFF) | 0x0012C000);
115-
116-
/* Apply HMPAN-18 workaround for nRF54H series - load trim values*/
117-
if (*(volatile uint32_t *) 0x0FFFE458 != TRIM_VALUE_EMPTY) {
118-
*(volatile uint32_t *) 0x5302C734 = *(volatile uint32_t *) 0x0FFFE458;
119-
}
120-
121-
if (*(volatile uint32_t *) 0x0FFFE45C != TRIM_VALUE_EMPTY) {
122-
*(volatile uint32_t *) 0x5302C738 = *(volatile uint32_t *) 0x0FFFE45C;
123-
}
124-
125-
if (*(volatile uint32_t *) 0x0FFFE460 != TRIM_VALUE_EMPTY) {
126-
*(volatile uint32_t *) 0x5302C73C = *(volatile uint32_t *) 0x0FFFE460;
127-
}
128-
129-
if (*(volatile uint32_t *) 0x0FFFE464 != TRIM_VALUE_EMPTY) {
130-
*(volatile uint32_t *) 0x5302C740 = *(volatile uint32_t *) 0x0FFFE464;
131-
}
132-
133-
if (*(volatile uint32_t *) 0x0FFFE468 != TRIM_VALUE_EMPTY) {
134-
*(volatile uint32_t *) 0x5302C74C = *(volatile uint32_t *) 0x0FFFE468;
135-
}
136-
137-
if (*(volatile uint32_t *) 0x0FFFE46C != TRIM_VALUE_EMPTY) {
138-
*(volatile uint32_t *) 0x5302C7D8 = *(volatile uint32_t *) 0x0FFFE46C;
139-
}
140-
141-
if (*(volatile uint32_t *) 0x0FFFE470 != TRIM_VALUE_EMPTY) {
142-
*(volatile uint32_t *) 0x5302C840 = *(volatile uint32_t *) 0x0FFFE470;
143-
}
144-
145-
if (*(volatile uint32_t *) 0x0FFFE474 != TRIM_VALUE_EMPTY) {
146-
*(volatile uint32_t *) 0x5302C844 = *(volatile uint32_t *) 0x0FFFE474;
147-
}
148-
149-
if (*(volatile uint32_t *) 0x0FFFE478 != TRIM_VALUE_EMPTY) {
150-
*(volatile uint32_t *) 0x5302C848 = *(volatile uint32_t *) 0x0FFFE478;
151-
}
152-
153-
if (*(volatile uint32_t *) 0x0FFFE47C != TRIM_VALUE_EMPTY) {
154-
*(volatile uint32_t *) 0x5302C84C = *(volatile uint32_t *) 0x0FFFE47C;
155-
}
156-
157-
/* Apply HMPAN-103 workaround for nRF54H series*/
158-
if ((*(volatile uint32_t *) 0x5302C8A0 == 0x80000000) ||
159-
(*(volatile uint32_t *) 0x5302C8A0 == 0x0058120E)) {
160-
*(volatile uint32_t *) 0x5302C8A0 = 0x0058090E;
161-
}
162-
163-
*(volatile uint32_t *) 0x5302C8A4 = 0x00F8AA5F;
164-
*(volatile uint32_t *) 0x5302C7AC = 0x8672827A;
165-
*(volatile uint32_t *) 0x5302C7B0 = 0x7E768672;
166-
*(volatile uint32_t *) 0x5302C7B4 = 0x0406007E;
167-
}
168-
#endif /* defined(CONFIG_SOC_SERIES_NRF54H) */
169-
170-
#else
171-
BUILD_ASSERT(false, "No Clock Control driver");
172-
#endif /* defined(CONFIG_CLOCK_CONTROL_NRF) */
173-
17477
int main(void)
17578
{
17679
printk("Starting Radio Test sample\n");
17780

178-
#if defined(CONFIG_SOC_SERIES_NRF54H)
179-
const struct device *console_uart = DEVICE_DT_GET_OR_NULL(DT_CHOSEN(zephyr_console));
180-
const struct device *shell_uart = DEVICE_DT_GET_OR_NULL(DT_CHOSEN(zephyr_shell_uart));
181-
182-
if (console_uart != NULL) {
183-
int ret = pm_device_runtime_get(console_uart);
184-
185-
if (ret < 0) {
186-
printk("Failed to get console UART runtime PM: %d\n", ret);
187-
}
188-
}
189-
190-
if (shell_uart != NULL && shell_uart != console_uart) {
191-
int ret = pm_device_runtime_get(shell_uart);
192-
193-
if (ret < 0) {
194-
printk("Failed to get shell UART runtime PM: %d\n", ret);
195-
}
196-
}
197-
#endif /* defined(CONFIG_SOC_SERIES_NRF54H) */
198-
19981
clock_init();
20082

201-
#if defined(CONFIG_SOC_SERIES_NRF54H)
202-
nrf54hx_radio_trim();
203-
#endif
204-
20583
return 0;
20684
}

samples/peripherals/radio_test/src/radio_cmd.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
#include <zephyr/init.h>
1111
#include <zephyr/shell/shell.h>
1212
#include <zephyr/types.h>
13-
#if !defined(CONFIG_SOC_SERIES_NRF54H)
1413
#include <hal/nrf_power.h>
15-
#endif /* !defined(CONFIG_SOC_SERIES_NRF54H) */
1614

1715
#include "radio_test.h"
1816

0 commit comments

Comments
 (0)