Skip to content

Commit d5ae219

Browse files
mmahadevan108nashif
authored andcommitted
test: frdm_mcxn947_mcxn947: Add config and overlay for QSPI variant
Add config and overlay files for the QSPI variant of the NXP FRDM-MCXN947 board Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent 99131b9 commit d5ae219

File tree

9 files changed

+175
-0
lines changed

9 files changed

+175
-0
lines changed

boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0_qspi.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@ toolchain:
1515
- gnuarmemb
1616
- xtools
1717
supported:
18+
- can
1819
- dma
1920
- gpio
21+
- spi
22+
- i2c
2023
- watchdog
2124
- pwm
2225
- counter
2326
- sdhc
27+
- regulator
2428
- usb_device
2529
vendor: nxp
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright 2024 NXP
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <zephyr/dt-bindings/adc/adc.h>
7+
#include <zephyr/dt-bindings/adc/mcux-lpadc.h>
8+
9+
/ {
10+
zephyr,user {
11+
io-channels = <&lpadc0 0>, <&lpadc0 1>;
12+
};
13+
};
14+
15+
&lpadc0 {
16+
#address-cells = <1>;
17+
#size-cells = <0>;
18+
19+
channel@0 {
20+
reg = <0>;
21+
zephyr,gain = "ADC_GAIN_1";
22+
zephyr,reference = "ADC_REF_EXTERNAL1";
23+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
24+
zephyr,resolution = <12>;
25+
zephyr,input-positive = <MCUX_LPADC_CH1A>;
26+
};
27+
28+
channel@1 {
29+
reg = <1>;
30+
zephyr,gain = "ADC_GAIN_1";
31+
zephyr,reference = "ADC_REF_EXTERNAL1";
32+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
33+
zephyr,resolution = <12>;
34+
zephyr,input-positive = <MCUX_LPADC_CH2A>;
35+
};
36+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_TEST_ALL_BITRATES=y
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_I2C_VIRTUAL=n
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
&pinctrl {
7+
pinmux_flexcomm1_lpi2c: pinmux_flexcomm1_lpi2c {
8+
group0 {
9+
pinmux = <FC1_P0_PIO0_24>,
10+
<FC1_P1_PIO0_25>;
11+
slew-rate = "fast";
12+
drive-strength = "low";
13+
input-enable;
14+
bias-pull-up;
15+
drive-open-drain;
16+
};
17+
};
18+
};
19+
20+
&flexcomm1 {
21+
status = "okay";
22+
};
23+
24+
/* We cannot enable SPI and I2C on the same flexcomm */
25+
&flexcomm1_lpspi1 {
26+
status = "disabled";
27+
};
28+
29+
/* To test this sample, connect
30+
* LPI2C1 SCL(J2-12, P1_25/FC1_P1) --> LPI2C2 SCL(J2-20, P4_1/FC2_P1)
31+
* LPI2C1 SDA(J2-8, P1_24/FC1_P0) --> LPI2C2 SDA(J2-18, P4_0/FC2_P0)
32+
*/
33+
&flexcomm1_lpi2c1 {
34+
pinctrl-0 = <&pinmux_flexcomm1_lpi2c>;
35+
pinctrl-names = "default";
36+
clock-frequency = <I2C_BITRATE_STANDARD>;
37+
status = "okay";
38+
eeprom0: eeprom@54 {
39+
compatible = "zephyr,i2c-target-eeprom";
40+
reg = <0x54>;
41+
size = <1024>;
42+
};
43+
};
44+
45+
&flexcomm2_lpi2c2 {
46+
eeprom1: eeprom@56 {
47+
compatible = "zephyr,i2c-target-eeprom";
48+
reg = <0x56>;
49+
size = <1024>;
50+
};
51+
};
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright 2024 NXP
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <zephyr/dt-bindings/adc/adc.h>
7+
#include <zephyr/dt-bindings/adc/mcux-lpadc.h>
8+
#include <zephyr/dt-bindings/regulator/nxp_vref.h>
9+
10+
/* To do this test, connect LPADC0 channel 2A(J8 pin 28) to VREF_OUT (TP1) */
11+
12+
/ {
13+
resources: resources {
14+
compatible = "test-regulator-voltage";
15+
regulators = <&vref>;
16+
tolerance-microvolt = <10000>;
17+
set-read-delay-ms = <1>;
18+
adc-avg-count = <10>;
19+
io-channels = <&lpadc0 0>;
20+
min-microvolt = <1000000>;
21+
max-microvolt = <2100000>;
22+
};
23+
};
24+
25+
&vref {
26+
regulator-initial-mode = <NXP_VREF_MODE_INTERNAL_REGULATOR>;
27+
};
28+
29+
&lpadc0 {
30+
#address-cells = <1>;
31+
#size-cells = <0>;
32+
33+
/* In this case, the LPADC reference source cannot be set to VREFO,
34+
* switch the reference source to VDD_ANA.
35+
*/
36+
voltage-ref= <2>;
37+
38+
channel@0 {
39+
reg = <0>;
40+
zephyr,gain = "ADC_GAIN_1";
41+
zephyr,reference = "ADC_REF_EXTERNAL0";
42+
zephyr,vref-mv = <3300>;
43+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
44+
zephyr,resolution = <12>;
45+
zephyr,input-positive = <MCUX_LPADC_CH2A>;
46+
};
47+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# Copyright 2024 NXP
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
CONFIG_SPI_MCUX_LPSPI_DMA=y
7+
CONFIG_SPI_ASYNC=n
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* Connect J2-10 and J2-8 */
8+
&flexcomm1_lpspi1 {
9+
slow@0 {
10+
compatible = "test-spi-loopback-slow";
11+
reg = <0>;
12+
spi-max-frequency = <500000>;
13+
};
14+
fast@0 {
15+
compatible = "test-spi-loopback-fast";
16+
reg = <0>;
17+
spi-max-frequency = <16000000>;
18+
};
19+
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright 2024 NXP
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/*
7+
* To test this sample connect P4_2(J1-4) to P4_3(J1-2)
8+
*/
9+
dut: &flexcomm2_lpuart2 {};

0 commit comments

Comments
 (0)