Skip to content

Commit 4c44ee3

Browse files
Hi-Im-Davidnordicjm
authored andcommitted
tests: drivers: audio: Add support for nRF7120
Added supported for pdm_loopback, pdm_instances and dmic_api tests for nRF7120 which uses both PCLK and AUXPLL as driving clocks for the PDM. Signed-off-by: David Jewsbury <[email protected]>
1 parent 0a3102d commit 4c44ee3

File tree

7 files changed

+226
-0
lines changed

7 files changed

+226
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/* Test requires loopbacks:
8+
* - between P1.14 and P1.0,
9+
* - between P1.13 and P1.15.
10+
* For best performance, PDM_CLK shall be on 'Clock pin'.
11+
*/
12+
13+
&pinctrl {
14+
pdm20_default_test: pdm20_default_test {
15+
group1 {
16+
psels = <NRF_PSEL(PDM_CLK, 1, 14)>,
17+
<NRF_PSEL(PDM_DIN, 1, 0)>;
18+
};
19+
};
20+
21+
pdm21_default_test: pdm21_default_test {
22+
group1 {
23+
psels = <NRF_PSEL(PDM_CLK, 1, 13)>,
24+
<NRF_PSEL(PDM_DIN, 1, 15)>;
25+
};
26+
};
27+
};
28+
29+
&pdm20 {
30+
status = "okay";
31+
pinctrl-0 = <&pdm20_default_test>;
32+
pinctrl-names = "default";
33+
clock-source = "PCLK32M";
34+
};
35+
36+
&pdm21 {
37+
status = "okay";
38+
pinctrl-0 = <&pdm21_default_test>;
39+
pinctrl-names = "default";
40+
clock-source = "PCLK32M";
41+
};

tests/drivers/audio/pdm_instances/testcase.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ tests:
1212
- nrf54h20dk/nrf54h20/cpuapp
1313
- nrf54l15dk/nrf54l15/cpuapp
1414
- nrf54lm20dk/nrf54lm20a/cpuapp
15+
- nrf7120pdk/nrf7120/cpuapp
1516
integration_platforms:
1617
- nrf54h20dk/nrf54h20/cpuapp
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
/* Loopback between P1.0 and P1.14 required */
7+
8+
/ {
9+
gpio_test {
10+
compatible = "gpio-leds";
11+
pulse_counter: pulse_counter {
12+
gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
13+
};
14+
};
15+
};
16+
17+
&pinctrl {
18+
pdm20_default_alt: pdm20_default_alt {
19+
group1 {
20+
psels = <NRF_PSEL(PDM_CLK, 1, 14)>,
21+
<NRF_PSEL(PDM_DIN, 1, 12)>;
22+
};
23+
};
24+
};
25+
26+
pdm_dev: &pdm20 {
27+
status = "okay";
28+
pinctrl-0 = <&pdm20_default_alt>;
29+
pinctrl-names = "default";
30+
clock-source = "PCLK32M";
31+
};
32+
33+
&gpio1 {
34+
status = "okay";
35+
};
36+
37+
&timer00 {
38+
status = "okay";
39+
};
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
/* Loopback between P1.0 and P1.14 required */
7+
8+
/ {
9+
gpio_test {
10+
compatible = "gpio-leds";
11+
pulse_counter: pulse_counter {
12+
gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
13+
};
14+
};
15+
};
16+
17+
&pinctrl {
18+
pdm20_default_alt: pdm20_default_alt {
19+
group1 {
20+
psels = <NRF_PSEL(PDM_CLK, 1, 14)>,
21+
<NRF_PSEL(PDM_DIN, 1, 12)>;
22+
};
23+
};
24+
};
25+
26+
pdm_dev: &pdm20 {
27+
status = "okay";
28+
pinctrl-0 = <&pdm20_default_alt>;
29+
pinctrl-names = "default";
30+
clock-source = "ACLK";
31+
};
32+
33+
&audio_auxpll {
34+
nordic,frequency = <NRF_AUXPLL_FREQ_DIV_AUDIO_44K1>;
35+
status = "okay";
36+
};
37+
38+
&gpio1 {
39+
status = "okay";
40+
};
41+
42+
&timer00 {
43+
status = "okay";
44+
};
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
/* Loopback between P1.0 and P1.14 required */
7+
8+
/ {
9+
gpio_test {
10+
compatible = "gpio-leds";
11+
pulse_counter: pulse_counter {
12+
gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
13+
};
14+
};
15+
};
16+
17+
&pinctrl {
18+
pdm20_default_alt: pdm20_default_alt {
19+
group1 {
20+
psels = <NRF_PSEL(PDM_CLK, 1, 14)>,
21+
<NRF_PSEL(PDM_DIN, 1, 12)>;
22+
};
23+
};
24+
};
25+
26+
pdm_dev: &pdm20 {
27+
status = "okay";
28+
pinctrl-0 = <&pdm20_default_alt>;
29+
pinctrl-names = "default";
30+
clock-source = "ACLK";
31+
};
32+
33+
&audio_auxpll {
34+
nordic,frequency = <NRF_AUXPLL_FREQ_DIV_AUDIO_48K>;
35+
status = "okay";
36+
};
37+
38+
&gpio1 {
39+
status = "okay";
40+
};
41+
42+
&timer00 {
43+
status = "okay";
44+
};

tests/drivers/audio/pdm_loopback/testcase.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,28 @@ tests:
111111
extra_args:
112112
- CONFIG_NRFX_TIMER=y
113113
- CONFIG_TEST_PDM_SAMPLING_TIME=10
114+
drivers.audio.pdm_loopback.nrf7120.1280khz:
115+
platform_allow:
116+
- nrf7120pdk/nrf7120/cpuapp
117+
extra_args:
118+
- CONFIG_NRFX_TIMER=y
119+
- CONFIG_TEST_PDM_SAMPLING_RATE=16000
120+
- CONFIG_TEST_PDM_EXPECTED_FREQUENCY=1280000
121+
drivers.audio.pdm_loopback.nrf7120.auxpll.44k1hz:
122+
platform_allow:
123+
- nrf7120pdk/nrf7120/cpuapp
124+
extra_args:
125+
- CONFIG_NRFX_TIMER=y
126+
- CONFIG_TEST_PDM_SAMPLING_RATE=44100
127+
- CONFIG_TEST_PDM_EXPECTED_FREQUENCY=1411200
128+
- CONFIG_CLOCK_CONTROL=y
129+
- DTC_OVERLAY_FILE="boards/nrf7120pdk_nrf7120_cpuapp_audio_auxpll_44k1hz.overlay"
130+
drivers.audio.pdm_loopback.nrf7120.auxpll.48khz:
131+
platform_allow:
132+
- nrf7120pdk/nrf7120/cpuapp
133+
extra_args:
134+
- CONFIG_NRFX_TIMER=y
135+
- CONFIG_TEST_PDM_SAMPLING_RATE=48000
136+
- CONFIG_TEST_PDM_EXPECTED_FREQUENCY=1536000
137+
- CONFIG_CLOCK_CONTROL=y
138+
- DTC_OVERLAY_FILE="boards/nrf7120pdk_nrf7120_cpuapp_audio_auxpll_48khz.overlay"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/* Test requires loopbacks:
8+
* - between P1.14 and P1.0,
9+
* For best performance, PDM_CLK shall be on 'Clock pin'.
10+
*/
11+
12+
/ {
13+
aliases {
14+
dmic-dev = &pdm20;
15+
};
16+
};
17+
18+
&pinctrl {
19+
pdm20_default_test: pdm20_default_test {
20+
group1 {
21+
psels = <NRF_PSEL(PDM_CLK, 1, 14)>,
22+
<NRF_PSEL(PDM_DIN, 1, 0)>;
23+
};
24+
};
25+
};
26+
27+
&pdm20 {
28+
status = "okay";
29+
pinctrl-0 = <&pdm20_default_test>;
30+
pinctrl-names = "default";
31+
clock-source = "PCLK32M";
32+
};

0 commit comments

Comments
 (0)