Skip to content

Commit 0e8005e

Browse files
nvlsianpucarlescufi
authored andcommitted
sample/drivers/jesd216: spi-nor config for nrf52840dk
Added configuration which allows to test the sample using SPI_NOR driver instead of NRF_QSPI driver. SPI_NOR driver is generic, so nice to add possibility to check how it is working. Signed-off-by: Andrzej Puzdrowski <[email protected]>
1 parent 510dca5 commit 0e8005e

File tree

4 files changed

+70
-5
lines changed

4 files changed

+70
-5
lines changed

samples/drivers/jesd216/boards/nrf52840dk_nrf52840.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77

88
CONFIG_SPI=n
99
CONFIG_SPI_NOR=n
10-
CONFIG_NORDIC_QSPI_NOR=y
10+
#CONFIG_NORDIC_QSPI_NOR=y
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright (c) 2022 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
CONFIG_SPI=y
8+
CONFIG_SPI_NOR=y
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright (c) 2022 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* This DTS overlay allows to test MX25R6435F using SPI_NOR driver */
8+
9+
&pinctrl {
10+
spi1_alt_default: spi1_alt_default {
11+
group1 {
12+
psels = <NRF_PSEL(SPIM_SCK, 0, 19)>,
13+
<NRF_PSEL(SPIM_MOSI, 0, 20)>,
14+
<NRF_PSEL(SPIM_MISO, 0, 21)>;
15+
};
16+
};
17+
18+
spi1_alt_sleep: spi1_alt_sleep {
19+
group1 {
20+
psels = <NRF_PSEL(SPIM_SCK, 0, 19)>,
21+
<NRF_PSEL(SPIM_MOSI, 0, 20)>,
22+
<NRF_PSEL(SPIM_MISO, 0, 21)>;
23+
low-power-enable;
24+
};
25+
};
26+
};
27+
28+
/delete-node/ &mx25r64;
29+
30+
&spi1 {
31+
compatible = "nordic,nrf-spi";
32+
status = "okay";
33+
cs-gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
34+
pinctrl-0 = <&spi1_alt_default>;
35+
pinctrl-1 = <&spi1_alt_sleep>;
36+
pinctrl-names = "default", "sleep";
37+
mx25r64: mx25r6435f@0 {
38+
compatible = "jedec,spi-nor";
39+
reg = <0>;
40+
spi-max-frequency = <33000000>;
41+
jedec-id = [c2 28 17];
42+
size = <67108864>;
43+
wp-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
44+
hold-gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
45+
};
46+
};
47+
48+
&qspi {
49+
status = "disabled";
50+
};
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
sample:
22
name: JESD216 Sample
3-
tests:
4-
sample.drivers.jesd216:
3+
common:
54
tags: spi flash
6-
platform_exclude: hifive1 hifive_unleashed hifive_unmatched mimxrt1170_evk_cm7 mimxrt1170_evk_cm4
7-
filter: dt_compat_enabled("jedec,spi-nor")
85
harness: console
96
harness_config:
107
type: multi_line
118
ordered: true
129
regex:
1310
- "sfdp-bfp ="
1411
- "jedec-id ="
12+
tests:
13+
sample.drivers.jesd216:
14+
platform_exclude: hifive1 hifive_unleashed hifive_unmatched mimxrt1170_evk_cm7 mimxrt1170_evk_cm4
15+
filter: dt_compat_enabled("jedec,spi-nor")
1516
depends_on: spi
17+
sample.drivers.jesd216.nrf52840dk_spi:
18+
extra_args: DTC_OVERLAY_FILE=boards/nrf52840dk_nrf52840_spi.overlay
19+
OVERLAY_CONFIG=boards/nrf52840dk_nrf52840_spi.conf
20+
platform_allow: nrf52840dk_nrf52840
21+
integration_platforms:
22+
- nrf52840dongle_nrf52840

0 commit comments

Comments
 (0)