<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nRF52840 Zephyr dual QSPI MX25R64 flash example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/74886/nrf52840-zephyr-dual-qspi-mx25r64-flash-example</link><description>I am trying to modify the nRF52840dk_nrf52840 spi_flash sample, ncs/zephyr/samples/drivers/spi_flash , to use dual QSPI. 
 Following is my device tree configuration: 
 
 I am using the main.c from the ncs/zephyr/samples/drivers/spi_flash example code</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 09 Jul 2021 13:38:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/74886/nrf52840-zephyr-dual-qspi-mx25r64-flash-example" /><item><title>RE: nRF52840 Zephyr dual QSPI MX25R64 flash example</title><link>https://devzone.nordicsemi.com/thread/319399?ContentTypeID=1</link><pubDate>Fri, 09 Jul 2021 13:38:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56611896-2ff0-40e4-928a-0bd196278fc1</guid><dc:creator>matt_C</dc:creator><description>&lt;p&gt;The following device tree should work for the nRF52840DK&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/*
 * Copyright (c) 2017 Linaro Limited
 *
 * SPDX-License-Identifier: Apache-2.0
 */

/dts-v1/;
#include &amp;lt;nordic/nrf52840_qiaa.dtsi&amp;gt;

/ {
	model = &amp;quot;Nordic nRF52840 DK NRF52840&amp;quot;;
	compatible = &amp;quot;nordic,nrf52840-dk-nrf52840&amp;quot;;

	chosen {
		zephyr,console = &amp;amp;uart0;
		zephyr,shell-uart = &amp;amp;uart0;
		zephyr,uart-mcumgr = &amp;amp;uart0;
		zephyr,bt-mon-uart = &amp;amp;uart0;
		zephyr,bt-c2h-uart = &amp;amp;uart0;
		zephyr,sram = &amp;amp;sram0;
		zephyr,flash = &amp;amp;flash0;
		zephyr,code-partition = &amp;amp;slot0_partition;
	};

	leds {
		compatible = &amp;quot;gpio-leds&amp;quot;;
		led0: led_0 {
			gpios = &amp;lt;&amp;amp;gpio0 13 GPIO_ACTIVE_LOW&amp;gt;;
			label = &amp;quot;Green LED 0&amp;quot;;
		};
		led1: led_1 {
			gpios = &amp;lt;&amp;amp;gpio0 14 GPIO_ACTIVE_LOW&amp;gt;;
			label = &amp;quot;Green LED 1&amp;quot;;
		};
		led2: led_2 {
			gpios = &amp;lt;&amp;amp;gpio0 15 GPIO_ACTIVE_LOW&amp;gt;;
			label = &amp;quot;Green LED 2&amp;quot;;
		};
		led3: led_3 {
			gpios = &amp;lt;&amp;amp;gpio0 16 GPIO_ACTIVE_LOW&amp;gt;;
			label = &amp;quot;Green LED 3&amp;quot;;
		};
	};

	pwmleds {
		compatible = &amp;quot;pwm-leds&amp;quot;;
		pwm_led0: pwm_led_0 {
			pwms = &amp;lt;&amp;amp;pwm0 13&amp;gt;;
		};
	};

	buttons {
		compatible = &amp;quot;gpio-keys&amp;quot;;
		button0: button_0 {
			gpios = &amp;lt;&amp;amp;gpio0 11 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)&amp;gt;;
			label = &amp;quot;Push button switch 0&amp;quot;;
		};
		button1: button_1 {
			gpios = &amp;lt;&amp;amp;gpio0 12 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)&amp;gt;;
			label = &amp;quot;Push button switch 1&amp;quot;;
		};
		button2: button_2 {
			gpios = &amp;lt;&amp;amp;gpio0 24 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)&amp;gt;;
			label = &amp;quot;Push button switch 2&amp;quot;;
		};
		button3: button_3 {
			gpios = &amp;lt;&amp;amp;gpio0 25 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)&amp;gt;;
			label = &amp;quot;Push button switch 3&amp;quot;;
		};
	};

	arduino_header: connector {
		compatible = &amp;quot;arduino-header-r3&amp;quot;;
		#gpio-cells = &amp;lt;2&amp;gt;;
		gpio-map-mask = &amp;lt;0xffffffff 0xffffffc0&amp;gt;;
		gpio-map-pass-thru = &amp;lt;0 0x3f&amp;gt;;
		gpio-map = &amp;lt;0 0 &amp;amp;gpio0 3 0&amp;gt;,	/* A0 */
			   &amp;lt;1 0 &amp;amp;gpio0 4 0&amp;gt;,	/* A1 */
			   &amp;lt;2 0 &amp;amp;gpio0 28 0&amp;gt;,	/* A2 */
			   &amp;lt;3 0 &amp;amp;gpio0 29 0&amp;gt;,	/* A3 */
			   &amp;lt;4 0 &amp;amp;gpio0 30 0&amp;gt;,	/* A4 */
			   &amp;lt;5 0 &amp;amp;gpio0 31 0&amp;gt;,	/* A5 */
			   &amp;lt;6 0 &amp;amp;gpio1 1 0&amp;gt;,	/* D0 */
			   &amp;lt;7 0 &amp;amp;gpio1 2 0&amp;gt;,	/* D1 */
			   &amp;lt;8 0 &amp;amp;gpio1 3 0&amp;gt;,	/* D2 */
			   &amp;lt;9 0 &amp;amp;gpio1 4 0&amp;gt;,	/* D3 */
			   &amp;lt;10 0 &amp;amp;gpio1 5 0&amp;gt;,	/* D4 */
			   &amp;lt;11 0 &amp;amp;gpio1 6 0&amp;gt;,	/* D5 */
			   &amp;lt;12 0 &amp;amp;gpio1 7 0&amp;gt;,	/* D6 */
			   &amp;lt;13 0 &amp;amp;gpio1 8 0&amp;gt;,	/* D7 */
			   &amp;lt;14 0 &amp;amp;gpio1 10 0&amp;gt;,	/* D8 */
			   &amp;lt;15 0 &amp;amp;gpio1 11 0&amp;gt;,	/* D9 */
			   &amp;lt;16 0 &amp;amp;gpio1 12 0&amp;gt;,	/* D10 */
			   &amp;lt;17 0 &amp;amp;gpio1 13 0&amp;gt;,	/* D11 */
			   &amp;lt;18 0 &amp;amp;gpio1 14 0&amp;gt;,	/* D12 */
			   &amp;lt;19 0 &amp;amp;gpio1 15 0&amp;gt;,	/* D13 */
			   &amp;lt;20 0 &amp;amp;gpio0 26 0&amp;gt;,	/* D14 */
			   &amp;lt;21 0 &amp;amp;gpio0 27 0&amp;gt;;	/* D15 */
	};

	arduino_adc: analog-connector {
		compatible = &amp;quot;arduino,uno-adc&amp;quot;;
		#io-channel-cells = &amp;lt;1&amp;gt;;
		io-channel-map = &amp;lt;0 &amp;amp;adc 1&amp;gt;,	/* A0 = P0.3 = AIN1 */
				 &amp;lt;1 &amp;amp;adc 2&amp;gt;,	/* A1 = P0.4 = AIN2 */
				 &amp;lt;2 &amp;amp;adc 4&amp;gt;,	/* A2 = P0.28 = AIN4 */
				 &amp;lt;3 &amp;amp;adc 5&amp;gt;,	/* A3 = P0.29 = AIN5 */
				 &amp;lt;4 &amp;amp;adc 6&amp;gt;,	/* A4 = P0.30 = AIN6 */
				 &amp;lt;5 &amp;amp;adc 7&amp;gt;;	/* A5 = P0.31 = AIN7 */
	};

	/* These aliases are provided for compatibility with samples */
	aliases {
		led0 = &amp;amp;led0;
		led1 = &amp;amp;led1;
		led2 = &amp;amp;led2;
		led3 = &amp;amp;led3;
		pwm-led0 = &amp;amp;pwm_led0;
		sw0 = &amp;amp;button0;
		sw1 = &amp;amp;button1;
		sw2 = &amp;amp;button2;
		sw3 = &amp;amp;button3;
	};
};

&amp;amp;adc {
	status = &amp;quot;okay&amp;quot;;
};

&amp;amp;gpiote {
	status = &amp;quot;okay&amp;quot;;
};

&amp;amp;gpio0 {
	status = &amp;quot;okay&amp;quot;;
};

&amp;amp;gpio1 {
	status = &amp;quot;okay&amp;quot;;
};

&amp;amp;uart0 {
	compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	current-speed = &amp;lt;115200&amp;gt;;
	tx-pin = &amp;lt;6&amp;gt;;
	rx-pin = &amp;lt;8&amp;gt;;
	rts-pin = &amp;lt;5&amp;gt;;
	cts-pin = &amp;lt;7&amp;gt;;
};

arduino_serial: &amp;amp;uart1 {
	status = &amp;quot;okay&amp;quot;;
	current-speed = &amp;lt;115200&amp;gt;;
	rx-pin = &amp;lt;33&amp;gt;;
	tx-pin = &amp;lt;34&amp;gt;;
};

arduino_i2c: &amp;amp;i2c0 {
	compatible = &amp;quot;nordic,nrf-twi&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	sda-pin = &amp;lt;26&amp;gt;;
	scl-pin = &amp;lt;27&amp;gt;;
};

&amp;amp;i2c1 {
	compatible = &amp;quot;nordic,nrf-twi&amp;quot;;
	/* Cannot be used together with spi1. */
	/* status = &amp;quot;okay&amp;quot;; */
	sda-pin = &amp;lt;30&amp;gt;;
	scl-pin = &amp;lt;31&amp;gt;;
};

&amp;amp;pwm0 {
	status = &amp;quot;okay&amp;quot;;
	ch0-pin = &amp;lt;13&amp;gt;;
	ch0-inverted;
};

&amp;amp;spi0 {
	compatible = &amp;quot;nordic,nrf-spi&amp;quot;;
	/* Cannot be used together with i2c0. */
	/* status = &amp;quot;okay&amp;quot;; */
	sck-pin = &amp;lt;27&amp;gt;;
	mosi-pin = &amp;lt;26&amp;gt;;
	miso-pin = &amp;lt;29&amp;gt;;
};

&amp;amp;spi1 {
	compatible = &amp;quot;nordic,nrf-spi&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	sck-pin = &amp;lt;31&amp;gt;;
	mosi-pin = &amp;lt;30&amp;gt;;
	miso-pin = &amp;lt;40&amp;gt;;
};

// &amp;amp;spi2 {
// 	compatible = &amp;quot;nordic,nrf-spi&amp;quot;;
// 	status = &amp;quot;disabled&amp;quot;;
// 	sck-pin = &amp;lt;19&amp;gt;;
// 	mosi-pin = &amp;lt;20&amp;gt;;
// 	miso-pin = &amp;lt;21&amp;gt;;
// };

&amp;amp;qspi {
	status = &amp;quot;okay&amp;quot;;
	sck-pin = &amp;lt;19&amp;gt;;
	io-pins = &amp;lt;20&amp;gt;, &amp;lt;21&amp;gt;;
	csn-pins = &amp;lt;17&amp;gt;;
	mx25r64: mx25r6435f@0 {
		compatible = &amp;quot;nordic,qspi-nor&amp;quot;;
		reg = &amp;lt;0&amp;gt;;
		quad-enable-requirements = &amp;quot;NONE&amp;quot;;
		/* MX24R64 supports only pp and pp4io */
		writeoc = &amp;quot;pp&amp;quot;;
		/* MX24R64 supports all readoc options */
		readoc = &amp;quot;fastread&amp;quot;;
		sck-frequency = &amp;lt;8000000&amp;gt;;
		label = &amp;quot;MX25R64&amp;quot;;
		jedec-id = [c2 28 17];
		sfdp-bfp = [
			e5 20 f1 ff  ff ff ff 03  44 eb 08 6b  08 3b 04 bb
			ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
			10 d8 00 ff  23 72 f5 00  82 ed 04 cc  44 83 68 44
			30 b0 30 b0  f7 c4 d5 5c  00 be 29 ff  f0 d0 ff ff
		];
		size = &amp;lt;67108864&amp;gt;;
		has-dpd;
		t-enter-dpd = &amp;lt;10000&amp;gt;;
		t-exit-dpd = &amp;lt;35000&amp;gt;;
	};
};

arduino_spi: &amp;amp;spi3 {
	status = &amp;quot;okay&amp;quot;;
	sck-pin = &amp;lt;47&amp;gt;;
	miso-pin = &amp;lt;46&amp;gt;;
	mosi-pin = &amp;lt;45&amp;gt;;
	cs-gpios = &amp;lt;&amp;amp;arduino_header 16 GPIO_ACTIVE_LOW&amp;gt;; /* D10 */
};

&amp;amp;flash0 {

	partitions {
		compatible = &amp;quot;fixed-partitions&amp;quot;;
		#address-cells = &amp;lt;1&amp;gt;;
		#size-cells = &amp;lt;1&amp;gt;;

		boot_partition: partition@0 {
			label = &amp;quot;mcuboot&amp;quot;;
			reg = &amp;lt;0x000000000 0x0000C000&amp;gt;;
		};
		slot0_partition: partition@c000 {
			label = &amp;quot;image-0&amp;quot;;
			reg = &amp;lt;0x0000C000 0x00067000&amp;gt;;
		};
		slot1_partition: partition@73000 {
			label = &amp;quot;image-1&amp;quot;;
			reg = &amp;lt;0x00073000 0x00067000&amp;gt;;
		};
		scratch_partition: partition@da000 {
			label = &amp;quot;image-scratch&amp;quot;;
			reg = &amp;lt;0x000da000 0x0001e000&amp;gt;;
		};

		/*
		 * The flash starting at 0x000f8000 and ending at
		 * 0x000fffff is reserved for use by the application.
		 */

		/*
		 * Storage partition will be used by FCB/LittleFS/NVS
		 * if enabled.
		 */
		storage_partition: partition@f8000 {
			label = &amp;quot;storage&amp;quot;;
			reg = &amp;lt;0x000f8000 0x00008000&amp;gt;;
		};
	};
};

&amp;amp;usbd {
	compatible = &amp;quot;nordic,nrf-usbd&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
};
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Zephyr dual QSPI MX25R64 flash example</title><link>https://devzone.nordicsemi.com/thread/319267?ContentTypeID=1</link><pubDate>Fri, 09 Jul 2021 05:14:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3892f6f-004c-4d50-9353-a215a3491db7</guid><dc:creator>Akash Patel</dc:creator><description>&lt;p&gt;Hi Matt,&lt;/p&gt;
&lt;p&gt;If you got this working, can you share the final device tree file you are using? Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Zephyr dual QSPI MX25R64 flash example</title><link>https://devzone.nordicsemi.com/thread/319234?ContentTypeID=1</link><pubDate>Thu, 08 Jul 2021 15:55:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:154722b0-f49b-4012-8a8e-98e8fc9fa931</guid><dc:creator>matt_C</dc:creator><description>&lt;p&gt;I finally got it working, I had mis-labeled one of the pins in the device tree.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Zephyr dual QSPI MX25R64 flash example</title><link>https://devzone.nordicsemi.com/thread/317077?ContentTypeID=1</link><pubDate>Thu, 24 Jun 2021 17:54:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64c45c04-cdc4-421d-83cc-fbbb018bff62</guid><dc:creator>matt_C</dc:creator><description>&lt;p&gt;I removed the SPI1 portion from the device tree and I still have the same error.&lt;/p&gt;
&lt;p&gt;Now that section of my device tree is simply&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;qspi {
	status = &amp;quot;okay&amp;quot;;
	sck-pin = &amp;lt;31&amp;gt;;
	io-pins = &amp;lt;30 45&amp;gt;;
	csn-pins = &amp;lt;29&amp;gt;;
	mx25r64: mx25r6435f@0 {
		compatible = &amp;quot;nordic,qspi-nor&amp;quot;;
		reg = &amp;lt;0&amp;gt;;
		quad-enable-requirements = &amp;quot;NONE&amp;quot;;
		/* MX24R64 supports only pp and pp4io */
		writeoc = &amp;quot;pp&amp;quot;;
		/* MX24R64 supports all readoc options */
		readoc = &amp;quot;fastread&amp;quot;;
		sck-frequency = &amp;lt;8000000&amp;gt;;
		label = &amp;quot;MX25R64&amp;quot;;
		jedec-id = [c2 28 17];
		sfdp-bfp = [
			e5 20 f1 ff  ff ff ff 03  44 eb 08 6b  08 3b 04 bb
			ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
			10 d8 00 ff  23 72 f5 00  82 ed 04 cc  44 83 68 44
			30 b0 30 b0  f7 c4 d5 5c  00 be 29 ff  f0 d0 ff ff
		];
		size = &amp;lt;67108864&amp;gt;;
		has-dpd;
		t-enter-dpd = &amp;lt;10000&amp;gt;;
		t-exit-dpd = &amp;lt;35000&amp;gt;;
	};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And my prj.conf settings are&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_DEBUG=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_FLASH_PAGE_LAYOUT=y&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div class="p-rich_text_section"&gt;Following is my testing code, based on the nRF52840dk_nrf52840 spi_flash sample in&amp;nbsp;&lt;i&gt;ncs/zephyr/samples/drivers/spi_flash,&lt;/i&gt;&lt;span class="c-mrkdwn__br"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;#if (CONFIG_NORDIC_QSPI_NOR - 0) || \
    DT_NODE_HAS_STATUS(DT_INST(0, nordic_qspi_nor), okay)
#define FLASH_DEVICE DT_INST(0, nordic_qspi_nor)

#if DT_NODE_HAS_STATUS(FLASH_DEVICE, okay)
#define FLASH_DEVICE_LABEL DT_LABEL(FLASH_DEVICE)
#define FLASH_NAME         &amp;quot;NORDIC QSPI-NOR&amp;quot;
#else
#error &amp;quot;Your device tree has no enabled nodes with compatible &amp;quot;nordic,qspi_nor&amp;quot;&amp;quot;
#define FLASH_DEVICE_LABEL &amp;quot;&amp;lt;none&amp;gt;&amp;quot;
#endif  ///&amp;lt; #if DT_NODE_HAS_STATUS(FLASH_DEVICE, okay)

#else
#error Unsupported flash driver
#endif

#define FLASH_TEST_REGION_OFFSET 0xff000
#define FLASH_SECTOR_SIZE 4096


void testMx25r64(void) {
    const uint8_t  expected[] = {0x55, 0xaa, 0x66, 0x99};
    const size_t   len        = sizeof(expected);
    uint8_t        buf[sizeof(expected)];
    struct device *flash_dev;
    int            rc;
    
    printk(&amp;quot;\n&amp;quot; FLASH_NAME &amp;quot; SPI flash testing\n&amp;quot;);
    printk(&amp;quot;==========================\n&amp;quot;);
    
    flash_dev = device_get_binding(FLASH_DEVICE_LABEL);
    
    if (!flash_dev) {
        printk(RED(&amp;quot;SPI flash driver %s was not found!\n&amp;quot;),
               FLASH_DEVICE_LABEL);
        return;
    }
    
    /* Write protection needs to be disabled before each write or
	 * erase, since the flash component turns on write protection
	 * automatically after completion of write and erase
	 * operations.
	 */
    printk(&amp;quot;\nTest 1: Flash erase\n&amp;quot;);
    flash_write_protection_set(flash_dev, false);
    
    rc = flash_erase(flash_dev, FLASH_TEST_REGION_OFFSET,
                     FLASH_SECTOR_SIZE);
    if (rc != 0) {
        printk(RED(&amp;quot;Flash erase failed! %d\n&amp;quot;), rc);
    } else {
        printk(&amp;quot;Flash erase succeeded!\n&amp;quot;);
    }
    
    printk(&amp;quot;\nTest 2: Flash write\n&amp;quot;);
    flash_write_protection_set(flash_dev, false);
    
    printk(&amp;quot;Attempting to write %u bytes\n&amp;quot;, len);
    rc = flash_write(flash_dev, FLASH_TEST_REGION_OFFSET, expected, len);
    if (rc != 0) {
        printk(RED(&amp;quot;Flash write failed! %d\n&amp;quot;), rc);
        return;
    }
    
    memset(buf, 0, len);
    rc = flash_read(flash_dev, FLASH_TEST_REGION_OFFSET, buf, len);
    if (rc != 0) {
        printk(RED(&amp;quot;Flash read failed! %d\n&amp;quot;), rc);
        return;
    }
    
    if (memcmp(expected, buf, len) == 0) {
        printk(&amp;quot;Data read matches data written. Good!!\n&amp;quot;);
    } else {
        const uint8_t *wp  = expected;
        const uint8_t *rp  = buf;
        const uint8_t *rpe = rp + len;
        
        printk(RED(&amp;quot;Data read does not match data written!!\n&amp;quot;));
        while (rp &amp;lt; rpe) {
            printk(RED(&amp;quot;%08x wrote %02x read %02x %s\n&amp;quot;),
                   (uint32_t)(FLASH_TEST_REGION_OFFSET + (rp - buf)),
                   *wp, *rp, (*rp == *wp) ? &amp;quot;match&amp;quot; : &amp;quot;MISMATCH&amp;quot;);
            ++rp;
            ++wp;
        }
    }
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In this testing code I get &amp;ldquo;SPI flash driver MX25R64 was not found!&lt;b&gt;&amp;rdquo;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Zephyr dual QSPI MX25R64 flash example</title><link>https://devzone.nordicsemi.com/thread/312814?ContentTypeID=1</link><pubDate>Tue, 01 Jun 2021 10:08:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de34b1e8-d61b-4fc3-80a4-c4ddd102a2b9</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Response;&lt;/p&gt;
&lt;p&gt;&amp;quot;I think the problem here is that the spi1 node is enabled with the same pins assigned that the QSPI is to use. The spi_flash sample by default enables SPI, so such configuration leads to two peripherals trying to use the same pins. As the Product Specification says, this &amp;quot;may result in unpredictable behavior&amp;quot;.&lt;/p&gt;
&lt;p&gt;Otherwise, the configuration looks okay. I tried to use the&amp;nbsp;MX25R64 on nRF52840 DK in the two IO pins configuration with&amp;nbsp;&amp;quot;pp&amp;quot; and&amp;nbsp;&amp;quot;fastread&amp;quot; operation modes, and it worked fine. I tried this with the recent Zephyr (commit&amp;nbsp;3d39f72a88b3100ac83e7c6c285ae567aca640d0).&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Zephyr dual QSPI MX25R64 flash example</title><link>https://devzone.nordicsemi.com/thread/311237?ContentTypeID=1</link><pubDate>Mon, 24 May 2021 11:05:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7fdc658-3c77-4986-9c7b-d718bc80f44f</guid><dc:creator>matt_C</dc:creator><description>&lt;p&gt;&lt;span&gt;From the following&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=/ps_nrf52840/qspi.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fqspi.html&lt;/a&gt;&lt;span&gt;, it mentions that the QSPI can be used for&amp;nbsp;&amp;ldquo;Single/dual/quad SPI input/output&amp;rdquo;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Zephyr dual QSPI MX25R64 flash example</title><link>https://devzone.nordicsemi.com/thread/311091?ContentTypeID=1</link><pubDate>Fri, 21 May 2021 14:14:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77d673ad-ef6d-47c5-9dee-abae810e91c0</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;I will ask about this internally. I&amp;#39;m not sure if what you are trying to do is supposed to work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Zephyr dual QSPI MX25R64 flash example</title><link>https://devzone.nordicsemi.com/thread/310156?ContentTypeID=1</link><pubDate>Tue, 18 May 2021 12:38:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfe35fc5-a881-469c-b2c5-888503c7d23b</guid><dc:creator>matt_C</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/hakon"&gt;Hakon&lt;/a&gt;&amp;nbsp;does my RESET# pin need to be defined in the qspi portion of my device tree (*.dts), or is there something else I need to do for dual QSPI to work?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Zephyr dual QSPI MX25R64 flash example</title><link>https://devzone.nordicsemi.com/thread/309664?ContentTypeID=1</link><pubDate>Thu, 13 May 2021 14:01:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a3bdf82-b439-46ee-b5a2-fa0491df7d4d</guid><dc:creator>matt_C</dc:creator><description>&lt;p&gt;Using the nRF52840DK I was able to get dual-SPI to work using the following overlay.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nrf52840dk_5F00_nrf52840.overlay"&gt;devzone.nordicsemi.com/.../nrf52840dk_5F00_nrf52840.overlay&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;However, I am still not able to get the dual-SPI to work on my custom board.&lt;/p&gt;
&lt;p&gt;The only difference I see is that the version of the MX25R64 on the nRF52840DK has the the function HOLD# as a dual function on SIO3 and the version of the MX25R64 that I am using has RESET# as the dual function on SIO3.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To address this I soldered a wire to always pull the RESET# high, but this did not work and I get the same error.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;I had been setting RESET# high in the following board.c file that is enabled before the kernel, like I have done successfully with pins used for I2C power and pull-up, but this did not fix the flash problem.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;quot;board.h&amp;quot;

#include &amp;lt;hal/nrf_gpio.h&amp;gt;
#include &amp;lt;init.h&amp;gt;

static int custom_board_nRF52840_init(struct device *dev) {
    ARG_UNUSED(dev);

    /// Enable the I2C power.
    nrf_gpio_cfg_output(BOARD_I2C_ENABLE_POWER_PIN_MAP);

    nrf_gpio_pin_set(BOARD_I2C_ENABLE_POWER_PIN_MAP);

    /// Enable the I2C pullup.
    nrf_gpio_cfg_output(BOARD_I2C_PULLUP_PIN_MAP);

    nrf_gpio_pin_set(BOARD_I2C_PULLUP_PIN_MAP);

    /// Turn off the active low pin reset for the mx25r64 NOR flash.
    nrf_gpio_cfg_output(BOARD_NOR_FLASH_RESET_PIN_MAP);

    nrf_gpio_pin_set(BOARD_NOR_FLASH_RESET_PIN_MAP);

    return 0;
}

SYS_INIT(custom_board_nRF52840_init, PRE_KERNEL_1,
         CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;and using the following CMakeLists.txt file in my custom board folder.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# SPDX-License-Identifier: Apache-2.0

zephyr_library()

zephyr_library_sources(board.c)

zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Zephyr dual QSPI MX25R64 flash example</title><link>https://devzone.nordicsemi.com/thread/309583?ContentTypeID=1</link><pubDate>Wed, 12 May 2021 18:35:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9780378a-129e-496f-9fb9-af0c199aa6e3</guid><dc:creator>matt_C</dc:creator><description>&lt;p&gt;I just debugged the driver initialization and I get a &amp;quot;NRFX_ERROR_TIMEOUT&amp;quot; in&amp;nbsp;qspi_ready_wait()&amp;nbsp;&lt;/p&gt;
&lt;p style="padding-left:60px;"&gt;&lt;strong&gt;From: &amp;nbsp; &amp;nbsp;&lt;em&gt;qspi_nor_init() -&amp;gt;&amp;nbsp;qspi_nor_configure() -&amp;gt;&amp;nbsp;qspi_nrfx_configure() -&amp;gt;&amp;nbsp;nrfx_qspi_init()&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Following are the values of the nrfx qspi variables before entering this function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;p_config-&amp;gt;xip_offset = 0

p_config-&amp;gt;pins.sck_pin = 31
p_config-&amp;gt;pins.csn_pin = 29
p_config-&amp;gt;pins.io0_pin = 30
p_config-&amp;gt;pins.io1_pin = 45
p_config-&amp;gt;pins.io2_pin = 255
p_config-&amp;gt;pins.io3_pin = 255

p_config-&amp;gt;prot_if.readoc  = NRF_QSPI_READOC_FASTREAD
p_config-&amp;gt;prot_if.writeof = NRP_QSPI_WRITEOC_PP
p_config-&amp;gt;prot_if.addrmode = NRF_QSPI_ADDRMODE_24BIT
p_config-&amp;gt;prot_if.dpmconfig = false

p_config-&amp;gt;phy_if.sck_delay = 0
p_config-&amp;gt;phy_if.dpmen = false
p_config-&amp;gt;phy_if.spi_mode = NRF_QSPI_MODE_0
p_config-&amp;gt;phy_if.sck_freq = NRF_QSPI_FREQ_DIV4

p_config-&amp;gt;irq_priority = 1

handler = qspi_handler

p_context = qspi_nor_memory_data&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Zephyr dual QSPI MX25R64 flash example</title><link>https://devzone.nordicsemi.com/thread/309490?ContentTypeID=1</link><pubDate>Wed, 12 May 2021 12:14:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4efd2fea-3c96-471a-892b-6377a3d62403</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;have you tried debugging the driver initialization? Have you checked qspi_nor_init() and qspi_nor_configure() for any errors?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>