Skip to content

Commit 4a7d7a3

Browse files
nordic-seglPerMac
authored andcommitted
tests: zephyr: drivers: pwm: Enable loopback test on nRF54LM20A
Add overlay required to run pwm_gpio_loopback test on nrf54lm20apdk/nrf54lm20a/cpuapp. Signed-off-by: Sebastian Głąb <[email protected]>
1 parent 3d5df7e commit 4a7d7a3

File tree

11 files changed

+90
-0
lines changed

11 files changed

+90
-0
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,7 @@
952952
/tests/zephyr/drivers/i2c/i2c_target_api/ @nrfconnect/ncs-low-level-test
953953
/tests/zephyr/drivers/i2s/ @nrfconnect/ncs-low-level-test
954954
/tests/zephyr/drivers/mspi/api/ @nrfconnect/ncs-low-level-test @nrfconnect/ncs-ll-ursus
955+
/tests/zephyr/drivers/pwm/ @nrfconnect/ncs-low-level-test
955956
/tests/zephyr/drivers/retained_mem/ @nrfconnect/ncs-low-level-test
956957
/tests/zephyr/drivers/sensor/ @nrfconnect/ncs-low-level-test
957958
/tests/zephyr/drivers/spi/ @nrfconnect/ncs-low-level-test

scripts/ci/tags.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,3 +1584,8 @@ ci_tests_zephyr_subsys_settings_performance:
15841584
files:
15851585
- nrf/tests/zephyr/subsys/settings/performance/
15861586
- zephyr/tests/subsys/settings/performance/
1587+
1588+
ci_tests_zephyr_drivers_pwm:
1589+
files:
1590+
- nrf/tests/zephyr/drivers/pwm/
1591+
- zephyr/tests/drivers/pwm/
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
cmake_minimum_required(VERSION 3.20.0)
8+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
9+
project(pwm_gpio)
10+
11+
FILE(GLOB app_sources ${ZEPHYR_BASE}/tests/drivers/pwm/pwm_gpio_loopback/src/*.c)
12+
target_sources(app PRIVATE ${app_sources})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source "tests/drivers/pwm/pwm_gpio_loopback/Kconfig"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This sample extends the same-named Zephyr sample to verify it with Nordic development kits.
2+
3+
Source code and basic configuration files can be found in the corresponding folder structure in zephyr/tests/drivers/pwm/pwm_gpio_loopback
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_SKIP_EDGE_NUM=4
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
4+
*
5+
* Test requires jumper between:
6+
* - PWM20 OUT[0] at P1.29 <-> GPIO input at P1.19
7+
*/
8+
9+
/ {
10+
zephyr,user {
11+
pwms = <&pwm20 0 160000 PWM_POLARITY_NORMAL>;
12+
gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
13+
};
14+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_SKIP_EDGE_NUM=4
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
4+
*
5+
* Test requires jumper between:
6+
* - PWM20 OUT[0] at P1.10 <-> GPIO input at P1.11
7+
*/
8+
9+
&pinctrl {
10+
pwm20_alt: pwm20_alt {
11+
group1 {
12+
psels = <NRF_PSEL(PWM_OUT0, 1, 10)>;
13+
};
14+
};
15+
16+
pwm20_alt_sleep: pwm20_alt_sleep {
17+
group1 {
18+
psels = <NRF_PSEL(PWM_OUT0, 1, 10)>;
19+
low-power-enable;
20+
};
21+
};
22+
};
23+
24+
&pwm20 {
25+
pinctrl-0 = <&pwm20_alt>;
26+
pinctrl-1 = <&pwm20_alt_sleep>;
27+
pinctrl-names = "default", "sleep";
28+
};
29+
30+
/ {
31+
zephyr,user {
32+
pwms = <&pwm20 0 160000 PWM_POLARITY_NORMAL>;
33+
gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
34+
};
35+
};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_PWM=y
2+
CONFIG_ZTEST=y

0 commit comments

Comments
 (0)