Skip to content

Commit 1585577

Browse files
committed
tests: drivers: pwm: Add MCXWX flexio-pwm testing
Enabled testing for the flexio pwm on MCXW7X Platforms. Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
1 parent e0ca7bf commit 1585577

File tree

5 files changed

+65
-0
lines changed

5 files changed

+65
-0
lines changed

boards/nxp/frdm_mcxw71/frdm_mcxw71-pinctrl.dtsi

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,13 @@
8080
slew-rate = "fast";
8181
};
8282
};
83+
84+
pinmux_flexio_pwm: pinmux_flexio_pwm {
85+
group0 {
86+
pinmux = <FLEXIO0_D20_PTC4>;
87+
drive-strength = "low";
88+
slew-rate = "fast";
89+
};
90+
};
91+
8392
};

boards/nxp/frdm_mcxw72/frdm_mcxw72-pinctrl.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,12 @@
7777
drive-open-drain;
7878
};
7979
};
80+
81+
pinmux_flexio_pwm: pinmux_flexio_pwm {
82+
group0 {
83+
pinmux = <FLEXIO0_D20_PTC4>;
84+
drive-strength = "low";
85+
slew-rate = "fast";
86+
};
87+
};
8088
};
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2025 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
aliases {
9+
pwm-0 = &flexio_pwm;
10+
};
11+
};
12+
13+
/* Conflicting gpio pins */
14+
&flexcan0 {
15+
status = "disabled";
16+
};
17+
18+
&flexio {
19+
status = "okay";
20+
flexio_pwm: flexio_pwm {
21+
status = "okay";
22+
pinctrl-0 = <&pinmux_flexio_pwm>;
23+
pinctrl-names = "default";
24+
25+
pwm_0 {
26+
pin-id = <20>;
27+
prescaler = <1>;
28+
};
29+
};
30+
};

tests/drivers/pwm/pwm_api/src/test_pwm.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@
7575
#define DEFAULT_PULSE_CYCLE 16384
7676
#define DEFAULT_PERIOD_NSEC 2000000
7777
#define DEFAULT_PULSE_NSEC 500000
78+
#elif defined(CONFIG_SOC_SERIES_MCXW)
79+
#define DEFAULT_PERIOD_CYCLE 64000
80+
#define DEFAULT_PULSE_CYCLE 32000
81+
#define DEFAULT_PERIOD_NSEC 4000000
82+
#define DEFAULT_PULSE_NSEC 2000000
7883
#else
7984
#define DEFAULT_PERIOD_CYCLE 64000
8085
#define DEFAULT_PULSE_CYCLE 32000

tests/drivers/pwm/pwm_api/testcase.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,16 @@ tests:
5353
- native_sim
5454
integration_platforms:
5555
- native_sim
56+
drivers.pwm.mcxw7x_flexio_pwm:
57+
tags:
58+
- drivers
59+
- pwm
60+
- userspace
61+
extra_args: DTC_OVERLAY_FILE="boards/frdm_mcxw7x_flexio_pwm.overlay"
62+
platform_allow:
63+
- frdm_mcxw71
64+
- frdm_mcxw72/mcxw727c/cpu0
65+
filter: (dt_alias_exists("pwm-0") or dt_alias_exists("pwm-1") or dt_alias_exists("pwm-2")
66+
or dt_alias_exists("pwm-3")) and CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and
67+
CONFIG_DT_HAS_NXP_FLEXIO_PWM_ENABLED
68+
depends_on: pwm

0 commit comments

Comments
 (0)