<?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>NCS/Zephyr SPI CS Issues</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/77402/ncs-zephyr-spi-cs-issues</link><description>I am having issue configuring the chip select (CS) in my little test program. I have read through the SPI drivers and debugged through it and from what I can tell I have everything setup right. I am also monitoring the CS signal on a scope to watch for</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 29 Jul 2021 08:58:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/77402/ncs-zephyr-spi-cs-issues" /><item><title>RE: NCS/Zephyr SPI CS Issues</title><link>https://devzone.nordicsemi.com/thread/322393?ContentTypeID=1</link><pubDate>Thu, 29 Jul 2021 08:58:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6619bd9-459a-4268-baf4-fd2d1c6ea0e7</guid><dc:creator>Carl Richard</dc:creator><description>&lt;p&gt;Hello again, Sam!&lt;br /&gt;&lt;br /&gt;Thank you for your patience with this. I have done some more testing and can verify that I see the same as you on the MOSI line. However, the&amp;nbsp;actual decoded SPI data is correct as the clock (SCK) isn&amp;#39;t running during the first two bytes. I.e: if the end device behaves correctly and starts reading with the SCK it should only get 0x9F.&lt;br /&gt;&lt;br /&gt;Isn&amp;#39;t it responding correctly?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Carl Richard&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS/Zephyr SPI CS Issues</title><link>https://devzone.nordicsemi.com/thread/320991?ContentTypeID=1</link><pubDate>Tue, 20 Jul 2021 19:38:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:223aa595-c6ef-46dd-88bd-af5e9d413049</guid><dc:creator>jansens</dc:creator><description>&lt;p&gt;Carl,&lt;br /&gt;&lt;br /&gt;I had tried hard coding this previously to no success. I just tried doing it via your recommended and I still am having issues with incorrect MOSI output.&lt;br /&gt;&lt;br /&gt;I am expecting to see &amp;quot;1001 1111&amp;quot; (0x9F) on my scope from MOSI. I am seeing &amp;quot;11 1001 1111&amp;quot; (0x39F), see the pictures of my scope below. I took multiple pictures showing the time delta of each high/low.&lt;/p&gt;
&lt;p&gt;Note: I have specified SPI to operate at 256,000 Hz both in code and overlay config. This gives a period of ~4us.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1626809487139v7.jpeg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1626809492826v8.jpeg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1626809498147v9.jpeg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1626809504638v10.jpeg" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;I have stepped through the debugger and can&amp;#39;t see what is wrong based off the values being passed to the Zephyr SPI functions according to their documentation.&amp;nbsp;Here is that screenshot:&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1626809292674v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;And here is the doc page for the OP code I am trying to send in case you want some context:&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1626809341206v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Sam&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS/Zephyr SPI CS Issues</title><link>https://devzone.nordicsemi.com/thread/320926?ContentTypeID=1</link><pubDate>Tue, 20 Jul 2021 13:31:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5e5596a-5945-490c-83fc-e015b31dd3b9</guid><dc:creator>Carl Richard</dc:creator><description>&lt;p&gt;Hello again!&lt;br /&gt;&lt;br /&gt;Just spent some time debugging your code. You need to include the size of your access buffer in order for the tx buffer to be valid for transfer. I made it work using this code:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;	uint8_t access[3] = {0};
	struct spi_buf bufs[] = {
		{
			.buf = access,
            .len = sizeof(access) //ADD HERE
		},
		{
			.buf = data,
			.len = len
		}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Carl Richard&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS/Zephyr SPI CS Issues</title><link>https://devzone.nordicsemi.com/thread/320483?ContentTypeID=1</link><pubDate>Fri, 16 Jul 2021 14:29:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63d96dad-9018-44c8-8c1b-5a283398a21c</guid><dc:creator>jansens</dc:creator><description>&lt;p&gt;Carl,&lt;br /&gt;&lt;br /&gt;I went ahead and updated my overlay to disable UART1, see :&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;spi1 {
	compatible = &amp;quot;nordic,nrf-spim&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	
	mosi-pin = &amp;lt;23&amp;gt;;
	miso-pin = &amp;lt;22&amp;gt;;
	sck-pin = &amp;lt;21&amp;gt;;
	clock-frequency = &amp;lt;4000000&amp;gt;;
	label = &amp;quot;CY15B102QN&amp;quot;;
	cs-gpios = &amp;lt;&amp;amp;gpio0 20 GPIO_ACTIVE_LOW&amp;gt;;
	
	//spidev: spi-device@0 {
    //              reg = &amp;lt;0&amp;gt;;
    //              label = &amp;quot;CY15B102QN&amp;quot;;
    //      };
	
};

&amp;amp;spi2 {
	status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;uart1 {
	status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;i2c1 {
    status = &amp;quot;disabled&amp;quot;;
};

&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I get no errors when running code or building, I simply just see MOSI as silent when trying to read the manufacture ID (see cy15b102qn_read_id(const struct device *spi,&lt;br /&gt; struct spi_config *spi_cfg)).&lt;/p&gt;
&lt;p&gt;Updated main.c :&amp;nbsp;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/*
 * Copyright (c) 2016 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include &amp;lt;errno.h&amp;gt;
#include &amp;lt;zephyr.h&amp;gt;
#include &amp;lt;sys/printk.h&amp;gt;
#include &amp;lt;device.h&amp;gt;
#include &amp;lt;drivers/spi.h&amp;gt;

/**
 * @file Sample app using the Cypress CY15B102QN (driver based on Fujitsu MB85RS64V) FRAM through SPI.
 */

#define CY15B102QN_MANUFACTURER_ID_CMD 0x9f
#define CY15B102QN_WRITE_ENABLE_CMD 0x06
#define CY15B102QN_READ_CMD 0x03
#define CY15B102QN_WRITE_CMD 0x02
#define MAX_USER_DATA_LENGTH 1024

#define SPI_DEV DT_LABEL(DT_NODELABEL(spi1))

static uint8_t data[MAX_USER_DATA_LENGTH], cmp_data[MAX_USER_DATA_LENGTH];

static int cy15b102qn_access(const struct device *spi,
			    struct spi_config *spi_cfg,
			    uint8_t cmd, uint16_t addr, void *data, size_t len)
{
	uint8_t access[3] = {0};
	struct spi_buf bufs[] = {
		{
			.buf = access,
                        //.len = len //DO I NEED THIS? I ADDED!
		},
		{
			.buf = data,
			.len = len
		}
	};
	struct spi_buf_set tx = {
		.buffers = bufs
	};

	access[0] = cmd;

	if (cmd == CY15B102QN_WRITE_CMD || cmd == CY15B102QN_READ_CMD) {
		access[1] = (addr &amp;gt;&amp;gt; 8) &amp;amp; 0xFF;
		access[2] = addr &amp;amp; 0xFF;

		bufs[0].len = 3;
		tx.count = 2;

		if (cmd == CY15B102QN_READ_CMD) {
			struct spi_buf_set rx = {
				.buffers = bufs,
				.count = 2
			};

			return spi_transceive(spi, spi_cfg, &amp;amp;tx, &amp;amp;rx);
		}
	} else {
		tx.count = 1;
                //printk(&amp;quot;tx.buffers.buf: 0x%X\n&amp;quot;, tx.buffers-&amp;gt;buf);
                
	}

	return spi_write(spi, spi_cfg, &amp;amp;tx);
}


static int cy15b102qn_read_id(const struct device *spi,
			     struct spi_config *spi_cfg)
{
	uint8_t id[9] = {0};
	int err;

        printk(&amp;quot;initalized id[0]: 0x%X\n&amp;quot;, id[0]);
        printk(&amp;quot;initalized id[1]: 0x%X\n&amp;quot;, id[1]);
        printk(&amp;quot;initalized id[2]: 0x%X\n&amp;quot;, id[2]);
        printk(&amp;quot;initalized id[3]: 0x%X\n&amp;quot;, id[3]);
        printk(&amp;quot;initalized id[4]: 0x%X\n&amp;quot;, id[4]);
        printk(&amp;quot;initalized id[5]: 0x%X\n&amp;quot;, id[5]);
        printk(&amp;quot;initalized id[6]: 0x%X\n&amp;quot;, id[6]);
        printk(&amp;quot;initalized id[7]: 0x%X\n&amp;quot;, id[7]);
        printk(&amp;quot;initalized id[8]: 0x%X\n&amp;quot;, id[8]);

	err = cy15b102qn_access(spi, spi_cfg,
			       CY15B102QN_MANUFACTURER_ID_CMD, 0, &amp;amp;id, 9);
	if (err) {
		printk(&amp;quot;Error during ID read\n&amp;quot;);
		return -EIO;
	}

        //CY15B102QN-50SXE DEVICE ID: 7F7F7F7F7F7FC22A60
        printk(&amp;quot;read id[0]: 0x%X\n&amp;quot;, id[0]);
        printk(&amp;quot;read id[1]: 0x%X\n&amp;quot;, id[1]);
        printk(&amp;quot;read id[2]: 0x%X\n&amp;quot;, id[2]);
        printk(&amp;quot;read id[3]: 0x%X\n&amp;quot;, id[3]);
        printk(&amp;quot;read id[4]: 0x%X\n&amp;quot;, id[4]);
        printk(&amp;quot;read id[5]: 0x%X\n&amp;quot;, id[5]);
        printk(&amp;quot;read id[6]: 0x%X\n&amp;quot;, id[6]);
        printk(&amp;quot;read id[7]: 0x%X\n&amp;quot;, id[7]);
        printk(&amp;quot;read id[8]: 0x%X\n&amp;quot;, id[8]);
        
	if (id[0] != 0x7F) {
		return -EIO;
	}

	if (id[1] != 0x7F) {
		return -EIO;
	}

	if (id[2] != 0x7F) {
		return -EIO;
	}

	if (id[3] != 0x7F) {
		return -EIO;
	}

        if (id[4] != 0x7F) {
		return -EIO;
	}

        if (id[5] != 0x7F) {
		return -EIO;
	}

        if (id[6] != 0xC2) {
		return -EIO;
	}

        if (id[7] != 0x2A) {
		return -EIO;
	}

        if (id[8] != 0x60) {
		return -EIO;
	}

	return 0;
}

static int write_bytes(const struct device *spi, struct spi_config *spi_cfg,
		       uint16_t addr, uint8_t *data, uint32_t num_bytes)
{
	int err;

	/* disable write protect */
	err = cy15b102qn_access(spi, spi_cfg,
			       CY15B102QN_WRITE_ENABLE_CMD, 0, NULL, 0);
	if (err) {
		printk(&amp;quot;unable to disable write protect\n&amp;quot;);
		return -EIO;
	}

	/* write cmd */
	err = cy15b102qn_access(spi, spi_cfg,
			       CY15B102QN_WRITE_CMD, addr, data, num_bytes);
	if (err) {
		printk(&amp;quot;Error during SPI write\n&amp;quot;);
		return -EIO;
	}

	return 0;
}

static int read_bytes(const struct device *spi, struct spi_config *spi_cfg,
		      uint16_t addr, uint8_t *data, uint32_t num_bytes)
{
	int err;

	/* read cmd */
	err = cy15b102qn_access(spi, spi_cfg,
			       CY15B102QN_READ_CMD, addr, data, num_bytes);
	if (err) {
		printk(&amp;quot;Error during SPI read\n&amp;quot;);
		return -EIO;
	}

	return 0;
}

void main(void)
{
	const struct device *spi;
	struct spi_config spi_cfg = {0};

        //Setup chip select struct / config
        struct spi_cs_control *cs_cfg =
          &amp;amp;(struct spi_cs_control) {
                .gpio_dev = DEVICE_DT_GET(DT_NODELABEL(gpio0)),
                .delay = 2,
                .gpio_pin = 20,
                .gpio_dt_flags = GPIO_ACTIVE_LOW
        };
        spi_cfg.cs = cs_cfg;

        //Set word size
        spi_cfg.operation = SPI_WORD_SET(8);
        //Sets frequency!
	spi_cfg.frequency = 256000U;
        //spi_cfg.frequency = 4000000U;

	printk(&amp;quot;fujitsu FRAM example application\n&amp;quot;);

	spi = device_get_binding(SPI_DEV);
	if (!spi) {
		printk(&amp;quot;Could not find SPI driver\n&amp;quot;);
		return;
	}

	int err;
	err = cy15b102qn_read_id(spi, &amp;amp;spi_cfg);
	if (err) {
		printk(&amp;quot;Could not verify FRAM ID\n&amp;quot;);
		return;
	}

	/* Do one-byte read/write */
	data[0] = 0xAE;
	err = write_bytes(spi, &amp;amp;spi_cfg, 0x00, data, 1);
	if (err) {
		printk(&amp;quot;Error writing to FRAM! errro code (%d)\n&amp;quot;, err);
		return;
	} else {
		printk(&amp;quot;Wrote 0xAE to address 0x00.\n&amp;quot;);
	}

	data[0] = 0x86;
	err = write_bytes(spi, &amp;amp;spi_cfg, 0x01, data, 1);
	if (err) {
		printk(&amp;quot;Error writing to FRAM! error code (%d)\n&amp;quot;, err);
		return;
	} else {
		printk(&amp;quot;Wrote 0x86 to address 0x01.\n&amp;quot;);
	}

	data[0] = 0x00;
	err = read_bytes(spi, &amp;amp;spi_cfg, 0x00, data, 1);
	if (err) {
		printk(&amp;quot;Error reading from FRAM! error code (%d)\n&amp;quot;, err);
		return;
	} else {
		printk(&amp;quot;Read 0x%X from address 0x00.\n&amp;quot;, data[0]);
	}

	data[0] = 0x00;
	err = read_bytes(spi, &amp;amp;spi_cfg, 0x01, data, 1);
	if (err) {
		printk(&amp;quot;Error reading from FRAM! error code (%d)\n&amp;quot;, err);
		return;
	} else {
		printk(&amp;quot;Read 0x%X from address 0x01.\n&amp;quot;, data[0]);
	}

	/* Do multi-byte read/write */
	/* get some random data, and clear out data[] */
	for (uint32_t i = 0; i &amp;lt; sizeof(cmp_data); i++) {
		cmp_data[i] = k_cycle_get_32() &amp;amp; 0xFF;
		data[i] = 0x00;
	}

	/* write them to the FRAM */
	err = write_bytes(spi, &amp;amp;spi_cfg, 0x00, cmp_data, sizeof(cmp_data));
	if (err) {
		printk(&amp;quot;Error writing to FRAM! error code (%d)\n&amp;quot;, err);
		return;
	} else {
		printk(&amp;quot;Wrote %d bytes to address 0x00.\n&amp;quot;,
		       (uint32_t) sizeof(cmp_data));
	}

	err = read_bytes(spi, &amp;amp;spi_cfg, 0x00, data, sizeof(data));
	if (err) {
		printk(&amp;quot;Error reading from FRAM! error code (%d)\n&amp;quot;, err);
		return;
	} else {
		printk(&amp;quot;Read %d bytes from address 0x00.\n&amp;quot;,
		       (uint32_t) sizeof(data));
	}

	err = 0;
	for (uint32_t i = 0; i &amp;lt; sizeof(cmp_data); i++) {
		if (cmp_data[i] != data[i]) {
			printk(&amp;quot;Data comparison failed @ %d.\n&amp;quot;, i);
			err = -EIO;
		}
	}
	if (err == 0) {
		printk(&amp;quot;Data comparison successful.\n&amp;quot;);
	}
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is the serial output I get when running this program :&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.4.99-ncs2-2-g5049afda7b9f  ***
fujitsu FRAM example application
initalized id[0]: 0x0
initalized id[1]: 0x0
initalized id[2]: 0x0
initalized id[3]: 0x0
initalized id[4]: 0x0
initalized id[5]: 0x0
initalized id[6]: 0x0
initalized id[7]: 0x0
initalized id[8]: 0x0
read id[0]: 0x0
read id[1]: 0x0
read id[2]: 0x0
read id[3]: 0x0
read id[4]: 0x0
read id[5]: 0x0
read id[6]: 0x0
read id[7]: 0x0
read id[8]: 0x0
Could not verify FRAM ID&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;As you can see it is failing to read the ID, and when I step through/debug I don&amp;#39;t see any issue. And as I mentioned I see no output on MOSI with my scope, it just sits low.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Updated Zephyr.dts :&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;/dts-v1/;

/ {
	#address-cells = &amp;lt; 0x1 &amp;gt;;
	#size-cells = &amp;lt; 0x1 &amp;gt;;
	model = &amp;quot;Nordic nRF52833 DK NRF52833&amp;quot;;
	compatible = &amp;quot;nordic,nrf52833-dk-nrf52833&amp;quot;;
	chosen {
		zephyr,entropy = &amp;amp;rng;
		zephyr,flash-controller = &amp;amp;flash_controller;
		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;
	};
	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;
	};
	soc {
		#address-cells = &amp;lt; 0x1 &amp;gt;;
		#size-cells = &amp;lt; 0x1 &amp;gt;;
		compatible = &amp;quot;nordic,nRF52833-QIAA&amp;quot;, &amp;quot;nordic,nRF52833&amp;quot;, &amp;quot;nordic,nRF52&amp;quot;, &amp;quot;simple-bus&amp;quot;;
		interrupt-parent = &amp;lt; &amp;amp;nvic &amp;gt;;
		ranges;
		nvic: interrupt-controller@e000e100 {
			compatible = &amp;quot;arm,v7m-nvic&amp;quot;;
			reg = &amp;lt; 0xe000e100 0xc00 &amp;gt;;
			interrupt-controller;
			#interrupt-cells = &amp;lt; 0x2 &amp;gt;;
			arm,num-irq-priority-bits = &amp;lt; 0x3 &amp;gt;;
			phandle = &amp;lt; 0x1 &amp;gt;;
		};
		systick: timer@e000e010 {
			compatible = &amp;quot;arm,armv7m-systick&amp;quot;;
			reg = &amp;lt; 0xe000e010 0x10 &amp;gt;;
			status = &amp;quot;disabled&amp;quot;;
		};
		flash_controller: flash-controller@4001e000 {
			compatible = &amp;quot;nordic,nrf52-flash-controller&amp;quot;;
			reg = &amp;lt; 0x4001e000 0x1000 &amp;gt;;
			#address-cells = &amp;lt; 0x1 &amp;gt;;
			#size-cells = &amp;lt; 0x1 &amp;gt;;
			label = &amp;quot;NRF_FLASH_DRV_NAME&amp;quot;;
			flash0: flash@0 {
				compatible = &amp;quot;soc-nv-flash&amp;quot;;
				label = &amp;quot;NRF_FLASH&amp;quot;;
				erase-block-size = &amp;lt; 0x1000 &amp;gt;;
				write-block-size = &amp;lt; 0x4 &amp;gt;;
				reg = &amp;lt; 0x0 0x80000 &amp;gt;;
				partitions {
					compatible = &amp;quot;fixed-partitions&amp;quot;;
					#address-cells = &amp;lt; 0x1 &amp;gt;;
					#size-cells = &amp;lt; 0x1 &amp;gt;;
					boot_partition: partition@0 {
						label = &amp;quot;mcuboot&amp;quot;;
						reg = &amp;lt; 0x0 0xc000 &amp;gt;;
					};
					slot0_partition: partition@c000 {
						label = &amp;quot;image-0&amp;quot;;
						reg = &amp;lt; 0xc000 0x32000 &amp;gt;;
					};
					slot1_partition: partition@3e000 {
						label = &amp;quot;image-1&amp;quot;;
						reg = &amp;lt; 0x3e000 0x32000 &amp;gt;;
					};
					scratch_partition: partition@70000 {
						label = &amp;quot;image-scratch&amp;quot;;
						reg = &amp;lt; 0x70000 0xa000 &amp;gt;;
					};
					storage_partition: partition@7a000 {
						label = &amp;quot;storage&amp;quot;;
						reg = &amp;lt; 0x7a000 0x6000 &amp;gt;;
					};
				};
			};
		};
		sram0: memory@20000000 {
			compatible = &amp;quot;mmio-sram&amp;quot;;
			reg = &amp;lt; 0x20000000 0x20000 &amp;gt;;
		};
		adc: adc@40007000 {
			compatible = &amp;quot;nordic,nrf-saadc&amp;quot;;
			reg = &amp;lt; 0x40007000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x7 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;ADC_0&amp;quot;;
			#io-channel-cells = &amp;lt; 0x1 &amp;gt;;
		};
		clock: clock@40000000 {
			compatible = &amp;quot;nordic,nrf-clock&amp;quot;;
			reg = &amp;lt; 0x40000000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x0 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;CLOCK&amp;quot;;
		};
		ecb: ecb@4000e000 {
			compatible = &amp;quot;nordic,nrf-ecb&amp;quot;;
			reg = &amp;lt; 0x4000e000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0xe 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;ECB&amp;quot;;
		};
		uart0: uart@40002000 {
			reg = &amp;lt; 0x40002000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x2 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;UART_0&amp;quot;;
			compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
			current-speed = &amp;lt; 0x1c200 &amp;gt;;
			tx-pin = &amp;lt; 0x6 &amp;gt;;
			rx-pin = &amp;lt; 0x8 &amp;gt;;
			rts-pin = &amp;lt; 0x5 &amp;gt;;
			cts-pin = &amp;lt; 0x7 &amp;gt;;
		};
		uart1: arduino_serial: uart@40028000 {
			compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
			reg = &amp;lt; 0x40028000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x28 0x1 &amp;gt;;
			status = &amp;quot;disabled&amp;quot;;
			label = &amp;quot;UART_1&amp;quot;;
			current-speed = &amp;lt; 0x1c200 &amp;gt;;
			rx-pin = &amp;lt; 0x21 &amp;gt;;
			tx-pin = &amp;lt; 0x22 &amp;gt;;
		};
		gpiote: gpiote@40006000 {
			compatible = &amp;quot;nordic,nrf-gpiote&amp;quot;;
			reg = &amp;lt; 0x40006000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x6 0x5 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;GPIOTE_0&amp;quot;;
		};
		gpio0: gpio@50000000 {
			compatible = &amp;quot;nordic,nrf-gpio&amp;quot;;
			gpio-controller;
			reg = &amp;lt; 0x50000000 0x200 0x50000500 0x300 &amp;gt;;
			#gpio-cells = &amp;lt; 0x2 &amp;gt;;
			label = &amp;quot;GPIO_0&amp;quot;;
			status = &amp;quot;okay&amp;quot;;
			port = &amp;lt; 0x0 &amp;gt;;
			phandle = &amp;lt; 0x2 &amp;gt;;
		};
		gpio1: gpio@50000300 {
			compatible = &amp;quot;nordic,nrf-gpio&amp;quot;;
			gpio-controller;
			reg = &amp;lt; 0x50000300 0x200 0x50000800 0x300 &amp;gt;;
			#gpio-cells = &amp;lt; 0x2 &amp;gt;;
			ngpios = &amp;lt; 0xa &amp;gt;;
			label = &amp;quot;GPIO_1&amp;quot;;
			status = &amp;quot;okay&amp;quot;;
			port = &amp;lt; 0x1 &amp;gt;;
			phandle = &amp;lt; 0x6 &amp;gt;;
		};
		i2c0: arduino_i2c: i2c@40003000 {
			#address-cells = &amp;lt; 0x1 &amp;gt;;
			#size-cells = &amp;lt; 0x0 &amp;gt;;
			reg = &amp;lt; 0x40003000 0x1000 &amp;gt;;
			clock-frequency = &amp;lt; 0x186a0 &amp;gt;;
			interrupts = &amp;lt; 0x3 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;I2C_0&amp;quot;;
			compatible = &amp;quot;nordic,nrf-twi&amp;quot;;
			sda-pin = &amp;lt; 0x1a &amp;gt;;
			scl-pin = &amp;lt; 0x1b &amp;gt;;
		};
		i2c1: i2c@40004000 {
			#address-cells = &amp;lt; 0x1 &amp;gt;;
			#size-cells = &amp;lt; 0x0 &amp;gt;;
			reg = &amp;lt; 0x40004000 0x1000 &amp;gt;;
			clock-frequency = &amp;lt; 0x186a0 &amp;gt;;
			interrupts = &amp;lt; 0x4 0x1 &amp;gt;;
			status = &amp;quot;disabled&amp;quot;;
			label = &amp;quot;I2C_1&amp;quot;;
			compatible = &amp;quot;nordic,nrf-twi&amp;quot;;
			sda-pin = &amp;lt; 0x1e &amp;gt;;
			scl-pin = &amp;lt; 0x1f &amp;gt;;
		};
		pwm0: pwm@4001c000 {
			compatible = &amp;quot;nordic,nrf-pwm&amp;quot;;
			reg = &amp;lt; 0x4001c000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x1c 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;PWM_0&amp;quot;;
			#pwm-cells = &amp;lt; 0x1 &amp;gt;;
			ch0-pin = &amp;lt; 0xd &amp;gt;;
			ch0-inverted;
			phandle = &amp;lt; 0x5 &amp;gt;;
		};
		pwm1: pwm@40021000 {
			compatible = &amp;quot;nordic,nrf-pwm&amp;quot;;
			reg = &amp;lt; 0x40021000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x21 0x1 &amp;gt;;
			status = &amp;quot;disabled&amp;quot;;
			label = &amp;quot;PWM_1&amp;quot;;
			#pwm-cells = &amp;lt; 0x1 &amp;gt;;
		};
		pwm2: pwm@40022000 {
			compatible = &amp;quot;nordic,nrf-pwm&amp;quot;;
			reg = &amp;lt; 0x40022000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x22 0x1 &amp;gt;;
			status = &amp;quot;disabled&amp;quot;;
			label = &amp;quot;PWM_2&amp;quot;;
			#pwm-cells = &amp;lt; 0x1 &amp;gt;;
		};
		pwm3: pwm@4002d000 {
			compatible = &amp;quot;nordic,nrf-pwm&amp;quot;;
			reg = &amp;lt; 0x4002d000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x2d 0x1 &amp;gt;;
			status = &amp;quot;disabled&amp;quot;;
			label = &amp;quot;PWM_3&amp;quot;;
			#pwm-cells = &amp;lt; 0x1 &amp;gt;;
		};
		qdec: qdec@40012000 {
			compatible = &amp;quot;nordic,nrf-qdec&amp;quot;;
			reg = &amp;lt; 0x40012000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x12 0x1 &amp;gt;;
			status = &amp;quot;disabled&amp;quot;;
			label = &amp;quot;QDEC&amp;quot;;
		};
		rng: random@4000d000 {
			compatible = &amp;quot;nordic,nrf-rng&amp;quot;;
			reg = &amp;lt; 0x4000d000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0xd 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;RNG&amp;quot;;
		};
		spi0: spi@40003000 {
			#address-cells = &amp;lt; 0x1 &amp;gt;;
			#size-cells = &amp;lt; 0x0 &amp;gt;;
			reg = &amp;lt; 0x40003000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x3 0x1 &amp;gt;;
			status = &amp;quot;disabled&amp;quot;;
			label = &amp;quot;SPI_0&amp;quot;;
			compatible = &amp;quot;nordic,nrf-spi&amp;quot;;
			sck-pin = &amp;lt; 0x1b &amp;gt;;
			mosi-pin = &amp;lt; 0x1a &amp;gt;;
			miso-pin = &amp;lt; 0x1d &amp;gt;;
		};
		spi1: spi@40004000 {
			#address-cells = &amp;lt; 0x1 &amp;gt;;
			#size-cells = &amp;lt; 0x0 &amp;gt;;
			reg = &amp;lt; 0x40004000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x4 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;CY15B102QN&amp;quot;;
			compatible = &amp;quot;nordic,nrf-spim&amp;quot;;
			sck-pin = &amp;lt; 0x15 &amp;gt;;
			mosi-pin = &amp;lt; 0x17 &amp;gt;;
			miso-pin = &amp;lt; 0x16 &amp;gt;;
			clock-frequency = &amp;lt; 0x3d0900 &amp;gt;;
			cs-gpios = &amp;lt; &amp;amp;gpio0 0x14 0x1 &amp;gt;;
		};
		spi2: spi@40023000 {
			#address-cells = &amp;lt; 0x1 &amp;gt;;
			#size-cells = &amp;lt; 0x0 &amp;gt;;
			reg = &amp;lt; 0x40023000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x23 0x1 &amp;gt;;
			status = &amp;quot;disabled&amp;quot;;
			label = &amp;quot;SPI_2&amp;quot;;
		};
		spi3: arduino_spi: spi@4002f000 {
			compatible = &amp;quot;nordic,nrf-spim&amp;quot;;
			#address-cells = &amp;lt; 0x1 &amp;gt;;
			#size-cells = &amp;lt; 0x0 &amp;gt;;
			reg = &amp;lt; 0x4002f000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x2f 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;SPI_3&amp;quot;;
			sck-pin = &amp;lt; 0x17 &amp;gt;;
			miso-pin = &amp;lt; 0x16 &amp;gt;;
			mosi-pin = &amp;lt; 0x15 &amp;gt;;
			cs-gpios = &amp;lt; &amp;amp;arduino_header 0x10 0x1 &amp;gt;;
		};
		rtc0: rtc@4000b000 {
			compatible = &amp;quot;nordic,nrf-rtc&amp;quot;;
			reg = &amp;lt; 0x4000b000 0x1000 &amp;gt;;
			cc-num = &amp;lt; 0x3 &amp;gt;;
			interrupts = &amp;lt; 0xb 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			clock-frequency = &amp;lt; 0x8000 &amp;gt;;
			prescaler = &amp;lt; 0x1 &amp;gt;;
			label = &amp;quot;RTC_0&amp;quot;;
		};
		rtc1: rtc@40011000 {
			compatible = &amp;quot;nordic,nrf-rtc&amp;quot;;
			reg = &amp;lt; 0x40011000 0x1000 &amp;gt;;
			cc-num = &amp;lt; 0x4 &amp;gt;;
			interrupts = &amp;lt; 0x11 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			clock-frequency = &amp;lt; 0x8000 &amp;gt;;
			prescaler = &amp;lt; 0x1 &amp;gt;;
			label = &amp;quot;RTC_1&amp;quot;;
		};
		rtc2: rtc@40024000 {
			compatible = &amp;quot;nordic,nrf-rtc&amp;quot;;
			reg = &amp;lt; 0x40024000 0x1000 &amp;gt;;
			cc-num = &amp;lt; 0x4 &amp;gt;;
			interrupts = &amp;lt; 0x24 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			clock-frequency = &amp;lt; 0x8000 &amp;gt;;
			prescaler = &amp;lt; 0x1 &amp;gt;;
			label = &amp;quot;RTC_2&amp;quot;;
		};
		timer0: timer@40008000 {
			compatible = &amp;quot;nordic,nrf-timer&amp;quot;;
			status = &amp;quot;okay&amp;quot;;
			reg = &amp;lt; 0x40008000 0x1000 &amp;gt;;
			cc-num = &amp;lt; 0x4 &amp;gt;;
			interrupts = &amp;lt; 0x8 0x1 &amp;gt;;
			prescaler = &amp;lt; 0x0 &amp;gt;;
			label = &amp;quot;TIMER_0&amp;quot;;
		};
		timer1: timer@40009000 {
			compatible = &amp;quot;nordic,nrf-timer&amp;quot;;
			status = &amp;quot;okay&amp;quot;;
			reg = &amp;lt; 0x40009000 0x1000 &amp;gt;;
			cc-num = &amp;lt; 0x4 &amp;gt;;
			interrupts = &amp;lt; 0x9 0x1 &amp;gt;;
			prescaler = &amp;lt; 0x0 &amp;gt;;
			label = &amp;quot;TIMER_1&amp;quot;;
		};
		timer2: timer@4000a000 {
			compatible = &amp;quot;nordic,nrf-timer&amp;quot;;
			status = &amp;quot;okay&amp;quot;;
			reg = &amp;lt; 0x4000a000 0x1000 &amp;gt;;
			cc-num = &amp;lt; 0x4 &amp;gt;;
			interrupts = &amp;lt; 0xa 0x1 &amp;gt;;
			prescaler = &amp;lt; 0x0 &amp;gt;;
			label = &amp;quot;TIMER_2&amp;quot;;
			phandle = &amp;lt; 0x4 &amp;gt;;
		};
		timer3: timer@4001a000 {
			compatible = &amp;quot;nordic,nrf-timer&amp;quot;;
			status = &amp;quot;okay&amp;quot;;
			reg = &amp;lt; 0x4001a000 0x1000 &amp;gt;;
			cc-num = &amp;lt; 0x6 &amp;gt;;
			interrupts = &amp;lt; 0x1a 0x1 &amp;gt;;
			prescaler = &amp;lt; 0x0 &amp;gt;;
			label = &amp;quot;TIMER_3&amp;quot;;
		};
		timer4: timer@4001b000 {
			compatible = &amp;quot;nordic,nrf-timer&amp;quot;;
			status = &amp;quot;okay&amp;quot;;
			reg = &amp;lt; 0x4001b000 0x1000 &amp;gt;;
			cc-num = &amp;lt; 0x6 &amp;gt;;
			interrupts = &amp;lt; 0x1b 0x1 &amp;gt;;
			prescaler = &amp;lt; 0x0 &amp;gt;;
			label = &amp;quot;TIMER_4&amp;quot;;
		};
		temp: temp@4000c000 {
			compatible = &amp;quot;nordic,nrf-temp&amp;quot;;
			reg = &amp;lt; 0x4000c000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0xc 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;TEMP_0&amp;quot;;
		};
		usbd: usbd@40027000 {
			compatible = &amp;quot;nordic,nrf-usbd&amp;quot;;
			reg = &amp;lt; 0x40027000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x27 0x1 &amp;gt;;
			num-bidir-endpoints = &amp;lt; 0x1 &amp;gt;;
			num-in-endpoints = &amp;lt; 0x7 &amp;gt;;
			num-out-endpoints = &amp;lt; 0x7 &amp;gt;;
			num-isoin-endpoints = &amp;lt; 0x1 &amp;gt;;
			num-isoout-endpoints = &amp;lt; 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;USBD&amp;quot;;
		};
		wdt: wdt0: watchdog@40010000 {
			compatible = &amp;quot;nordic,nrf-watchdog&amp;quot;;
			reg = &amp;lt; 0x40010000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x10 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;WDT&amp;quot;;
		};
		ficr: ficr@10000000 {
			compatible = &amp;quot;nordic,nrf-ficr&amp;quot;;
			reg = &amp;lt; 0x10000000 0x1000 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
		};
		uicr: uicr@10001000 {
			compatible = &amp;quot;nordic,nrf-uicr&amp;quot;;
			reg = &amp;lt; 0x10001000 0x1000 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
		};
		radio: radio@40001000 {
			compatible = &amp;quot;nordic,nrf-radio&amp;quot;;
			reg = &amp;lt; 0x40001000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x1 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			dfe-ant-num = &amp;lt; 0x0 &amp;gt;;
		};
	};
	cpus {
		#address-cells = &amp;lt; 0x1 &amp;gt;;
		#size-cells = &amp;lt; 0x0 &amp;gt;;
		cpu@0 {
			device_type = &amp;quot;cpu&amp;quot;;
			compatible = &amp;quot;arm,cortex-m4f&amp;quot;;
			reg = &amp;lt; 0x0 &amp;gt;;
		};
	};
	sw_pwm: sw-pwm {
		compatible = &amp;quot;nordic,nrf-sw-pwm&amp;quot;;
		status = &amp;quot;disabled&amp;quot;;
		label = &amp;quot;SW_PWM&amp;quot;;
		generator = &amp;lt; &amp;amp;timer2 &amp;gt;;
		channel-count = &amp;lt; 0x3 &amp;gt;;
		clock-prescaler = &amp;lt; 0x0 &amp;gt;;
		ppi-base = &amp;lt; 0x0 &amp;gt;;
		gpiote-base = &amp;lt; 0x0 &amp;gt;;
		#pwm-cells = &amp;lt; 0x1 &amp;gt;;
	};
	leds {
		compatible = &amp;quot;gpio-leds&amp;quot;;
		led0: led_0 {
			gpios = &amp;lt; &amp;amp;gpio0 0xd 0x1 &amp;gt;;
			label = &amp;quot;Green LED 0&amp;quot;;
		};
		led1: led_1 {
			gpios = &amp;lt; &amp;amp;gpio0 0xe 0x1 &amp;gt;;
			label = &amp;quot;Green LED 1&amp;quot;;
		};
		led2: led_2 {
			gpios = &amp;lt; &amp;amp;gpio0 0xf 0x1 &amp;gt;;
			label = &amp;quot;Green LED 2&amp;quot;;
		};
		led3: led_3 {
			gpios = &amp;lt; &amp;amp;gpio0 0x10 0x1 &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 0xd &amp;gt;;
		};
	};
	buttons {
		compatible = &amp;quot;gpio-keys&amp;quot;;
		button0: button_0 {
			gpios = &amp;lt; &amp;amp;gpio0 0xb 0x11 &amp;gt;;
			label = &amp;quot;Push button switch 0&amp;quot;;
		};
		button1: button_1 {
			gpios = &amp;lt; &amp;amp;gpio0 0xc 0x11 &amp;gt;;
			label = &amp;quot;Push button switch 1&amp;quot;;
		};
		button2: button_2 {
			gpios = &amp;lt; &amp;amp;gpio0 0x18 0x11 &amp;gt;;
			label = &amp;quot;Push button switch 2&amp;quot;;
		};
		button3: button_3 {
			gpios = &amp;lt; &amp;amp;gpio0 0x19 0x11 &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; 0x2 &amp;gt;;
		gpio-map-mask = &amp;lt; 0xffffffff 0xffffffc0 &amp;gt;;
		gpio-map-pass-thru = &amp;lt; 0x0 0x3f &amp;gt;;
		gpio-map = &amp;lt; 0x0 0x0 &amp;amp;gpio0 0x3 0x0 &amp;gt;, &amp;lt; 0x1 0x0 &amp;amp;gpio0 0x4 0x0 &amp;gt;, &amp;lt; 0x2 0x0 &amp;amp;gpio0 0x1c 0x0 &amp;gt;, &amp;lt; 0x3 0x0 &amp;amp;gpio0 0x1d 0x0 &amp;gt;, &amp;lt; 0x4 0x0 &amp;amp;gpio0 0x1e 0x0 &amp;gt;, &amp;lt; 0x5 0x0 &amp;amp;gpio0 0x1f 0x0 &amp;gt;, &amp;lt; 0x6 0x0 &amp;amp;gpio1 0x1 0x0 &amp;gt;, &amp;lt; 0x7 0x0 &amp;amp;gpio1 0x2 0x0 &amp;gt;, &amp;lt; 0x8 0x0 &amp;amp;gpio1 0x3 0x0 &amp;gt;, &amp;lt; 0x9 0x0 &amp;amp;gpio1 0x4 0x0 &amp;gt;, &amp;lt; 0xa 0x0 &amp;amp;gpio1 0x5 0x0 &amp;gt;, &amp;lt; 0xb 0x0 &amp;amp;gpio1 0x6 0x0 &amp;gt;, &amp;lt; 0xc 0x0 &amp;amp;gpio1 0x7 0x0 &amp;gt;, &amp;lt; 0xd 0x0 &amp;amp;gpio1 0x8 0x0 &amp;gt;, &amp;lt; 0xe 0x0 &amp;amp;gpio0 0x11 0x0 &amp;gt;, &amp;lt; 0xf 0x0 &amp;amp;gpio0 0x13 0x0 &amp;gt;, &amp;lt; 0x10 0x0 &amp;amp;gpio0 0x14 0x0 &amp;gt;, &amp;lt; 0x11 0x0 &amp;amp;gpio0 0x15 0x0 &amp;gt;, &amp;lt; 0x12 0x0 &amp;amp;gpio0 0x16 0x0 &amp;gt;, &amp;lt; 0x13 0x0 &amp;amp;gpio0 0x17 0x0 &amp;gt;, &amp;lt; 0x14 0x0 &amp;amp;gpio0 0x1a 0x0 &amp;gt;, &amp;lt; 0x15 0x0 &amp;amp;gpio0 0x1b 0x0 &amp;gt;;
		phandle = &amp;lt; 0x3 &amp;gt;;
	};
};
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS/Zephyr SPI CS Issues</title><link>https://devzone.nordicsemi.com/thread/320310?ContentTypeID=1</link><pubDate>Thu, 15 Jul 2021 14:59:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2522733d-7c31-4321-b30d-3009f90b9b54</guid><dc:creator>Carl Richard</dc:creator><description>&lt;p&gt;Hello again!&lt;br /&gt;&lt;br /&gt;Good to hear that it helped. Are you getting any errors when running the code, or is the MOSI just silent?&lt;br /&gt;&lt;br /&gt;I also see that UART1 is enabled in the DTS. This will conflict with SPI1, so please try to disable UART1 in the overlay or change your SPI instance.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Carl Richard&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS/Zephyr SPI CS Issues</title><link>https://devzone.nordicsemi.com/thread/320117?ContentTypeID=1</link><pubDate>Wed, 14 Jul 2021 21:54:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:535eaa0e-108b-498a-803d-5a43e73c72b7</guid><dc:creator>jansens</dc:creator><description>&lt;p&gt;Hi Carl,&lt;br /&gt;&lt;br /&gt;That did help, but I am still having issues with not seeing anything being output by MOSI line I have hooked up to my scope. See my&amp;nbsp;cy15b102qn_read_id function to see where it is failing, basically when I make the call to&amp;nbsp;spi_write using my OPCODE, I never see anything on MOSI. I have followed through the program using the debugger and am unable to figure out why it is not sending the OPCODE over MOSI.&lt;br /&gt;&lt;br /&gt;I will post my updated code and config below:&lt;br /&gt;main.c:&amp;nbsp;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/*
 * Copyright (c) 2016 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include &amp;lt;errno.h&amp;gt;
#include &amp;lt;zephyr.h&amp;gt;
#include &amp;lt;sys/printk.h&amp;gt;
#include &amp;lt;device.h&amp;gt;
#include &amp;lt;drivers/spi.h&amp;gt;

/**
 * @file Sample app using the Cypress CY15B102QN (driver based on Fujitsu MB85RS64V) FRAM through SPI.
 */

#define CY15B102QN_MANUFACTURER_ID_CMD 0x9f
#define CY15B102QN_WRITE_ENABLE_CMD 0x06
#define CY15B102QN_READ_CMD 0x03
#define CY15B102QN_WRITE_CMD 0x02
#define MAX_USER_DATA_LENGTH 1024

#define SPI_DEV DT_LABEL(DT_NODELABEL(spi1))

static uint8_t data[MAX_USER_DATA_LENGTH], cmp_data[MAX_USER_DATA_LENGTH];

static int cy15b102qn_access(const struct device *spi,
			    struct spi_config *spi_cfg,
			    uint8_t cmd, uint16_t addr, void *data, size_t len)
{
	uint8_t access[3] = {0,0,0};
	struct spi_buf bufs[] = {
		{
			.buf = access,
                        .len = len //DO I NEED THIS? I ADDED!
		},
		{
			.buf = data,
			.len = len
		}
	};
	struct spi_buf_set tx = {
		.buffers = bufs
	};

	access[0] = cmd;

	if (cmd == CY15B102QN_WRITE_CMD || cmd == CY15B102QN_READ_CMD) {
		access[1] = (addr &amp;gt;&amp;gt; 8) &amp;amp; 0xFF;
		access[2] = addr &amp;amp; 0xFF;

		bufs[0].len = 3;
		tx.count = 2;

		if (cmd == CY15B102QN_READ_CMD) {
			struct spi_buf_set rx = {
				.buffers = bufs,
				.count = 2
			};

			return spi_transceive(spi, spi_cfg, &amp;amp;tx, &amp;amp;rx);
		}
	} else {
		tx.count = 1;
                printk(&amp;quot;tx.buffers.buf: 0x%X\n&amp;quot;, tx.buffers-&amp;gt;buf);
                
	}

	return spi_write(spi, spi_cfg, &amp;amp;tx);
}


static int cy15b102qn_read_id(const struct device *spi,
			     struct spi_config *spi_cfg)
{
	uint8_t id[9];
	int err;

        printk(&amp;quot;initalized id[0]: 0x%X\n&amp;quot;, id[0]);

	err = cy15b102qn_access(spi, spi_cfg,
			       CY15B102QN_MANUFACTURER_ID_CMD, 0, &amp;amp;id, 9);
	if (err) {
		printk(&amp;quot;Error during ID read\n&amp;quot;);
		return -EIO;
	}

        
        //CY15B102QN-50SXE DEVICE ID: 7F7F7F7F7F7FC22A60
        printk(&amp;quot;read id[0]: 0x%X\n&amp;quot;, id[0]);
        
	if (id[0] != 0x7F) {
		return -EIO;
	}

	if (id[1] != 0x7F) {
		return -EIO;
	}

	if (id[2] != 0x7F) {
		return -EIO;
	}

	if (id[3] != 0x7F) {
		return -EIO;
	}

        if (id[4] != 0x7F) {
		return -EIO;
	}

        if (id[5] != 0x7F) {
		return -EIO;
	}

        if (id[6] != 0xC2) {
		return -EIO;
	}

        if (id[7] != 0x2A) {
		return -EIO;
	}

        if (id[8] != 0x60) {
		return -EIO;
	}

	return 0;
}

static int write_bytes(const struct device *spi, struct spi_config *spi_cfg,
		       uint16_t addr, uint8_t *data, uint32_t num_bytes)
{
	int err;

	/* disable write protect */
	err = cy15b102qn_access(spi, spi_cfg,
			       CY15B102QN_WRITE_ENABLE_CMD, 0, NULL, 0);
	if (err) {
		printk(&amp;quot;unable to disable write protect\n&amp;quot;);
		return -EIO;
	}

	/* write cmd */
	err = cy15b102qn_access(spi, spi_cfg,
			       CY15B102QN_WRITE_CMD, addr, data, num_bytes);
	if (err) {
		printk(&amp;quot;Error during SPI write\n&amp;quot;);
		return -EIO;
	}

	return 0;
}

static int read_bytes(const struct device *spi, struct spi_config *spi_cfg,
		      uint16_t addr, uint8_t *data, uint32_t num_bytes)
{
	int err;

	/* read cmd */
	err = cy15b102qn_access(spi, spi_cfg,
			       CY15B102QN_READ_CMD, addr, data, num_bytes);
	if (err) {
		printk(&amp;quot;Error during SPI read\n&amp;quot;);
		return -EIO;
	}

	return 0;
}

void main(void)
{
	const struct device *spi;
	struct spi_config spi_cfg = {0};

        //Setup chip select struct / config
        struct spi_cs_control *cs_cfg =
          &amp;amp;(struct spi_cs_control) {
                .gpio_dev = DEVICE_DT_GET(DT_NODELABEL(gpio0)),
                .delay = 2,
                .gpio_pin = 20,
                .gpio_dt_flags = GPIO_ACTIVE_LOW
        };
        spi_cfg.cs = cs_cfg;

        //Set word size
        spi_cfg.operation = SPI_WORD_SET(8);
        //Sets frequency!
	spi_cfg.frequency = 256000U;
        //spi_cfg.frequency = 4000000U;

	printk(&amp;quot;fujitsu FRAM example application\n&amp;quot;);

	spi = device_get_binding(SPI_DEV);
	if (!spi) {
		printk(&amp;quot;Could not find SPI driver\n&amp;quot;);
		return;
	}

	int err;
	err = cy15b102qn_read_id(spi, &amp;amp;spi_cfg);
	if (err) {
		printk(&amp;quot;Could not verify FRAM ID\n&amp;quot;);
		return;
	}

	/* Do one-byte read/write */
	data[0] = 0xAE;
	err = write_bytes(spi, &amp;amp;spi_cfg, 0x00, data, 1);
	if (err) {
		printk(&amp;quot;Error writing to FRAM! errro code (%d)\n&amp;quot;, err);
		return;
	} else {
		printk(&amp;quot;Wrote 0xAE to address 0x00.\n&amp;quot;);
	}

	data[0] = 0x86;
	err = write_bytes(spi, &amp;amp;spi_cfg, 0x01, data, 1);
	if (err) {
		printk(&amp;quot;Error writing to FRAM! error code (%d)\n&amp;quot;, err);
		return;
	} else {
		printk(&amp;quot;Wrote 0x86 to address 0x01.\n&amp;quot;);
	}

	data[0] = 0x00;
	err = read_bytes(spi, &amp;amp;spi_cfg, 0x00, data, 1);
	if (err) {
		printk(&amp;quot;Error reading from FRAM! error code (%d)\n&amp;quot;, err);
		return;
	} else {
		printk(&amp;quot;Read 0x%X from address 0x00.\n&amp;quot;, data[0]);
	}

	data[0] = 0x00;
	err = read_bytes(spi, &amp;amp;spi_cfg, 0x01, data, 1);
	if (err) {
		printk(&amp;quot;Error reading from FRAM! error code (%d)\n&amp;quot;, err);
		return;
	} else {
		printk(&amp;quot;Read 0x%X from address 0x01.\n&amp;quot;, data[0]);
	}

	/* Do multi-byte read/write */
	/* get some random data, and clear out data[] */
	for (uint32_t i = 0; i &amp;lt; sizeof(cmp_data); i++) {
		cmp_data[i] = k_cycle_get_32() &amp;amp; 0xFF;
		data[i] = 0x00;
	}

	/* write them to the FRAM */
	err = write_bytes(spi, &amp;amp;spi_cfg, 0x00, cmp_data, sizeof(cmp_data));
	if (err) {
		printk(&amp;quot;Error writing to FRAM! error code (%d)\n&amp;quot;, err);
		return;
	} else {
		printk(&amp;quot;Wrote %d bytes to address 0x00.\n&amp;quot;,
		       (uint32_t) sizeof(cmp_data));
	}

	err = read_bytes(spi, &amp;amp;spi_cfg, 0x00, data, sizeof(data));
	if (err) {
		printk(&amp;quot;Error reading from FRAM! error code (%d)\n&amp;quot;, err);
		return;
	} else {
		printk(&amp;quot;Read %d bytes from address 0x00.\n&amp;quot;,
		       (uint32_t) sizeof(data));
	}

	err = 0;
	for (uint32_t i = 0; i &amp;lt; sizeof(cmp_data); i++) {
		if (cmp_data[i] != data[i]) {
			printk(&amp;quot;Data comparison failed @ %d.\n&amp;quot;, i);
			err = -EIO;
		}
	}
	if (err == 0) {
		printk(&amp;quot;Data comparison successful.\n&amp;quot;);
	}
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;nrf52833dk_nrf52833.overlay :&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;spi1 {
	compatible = &amp;quot;nordic,nrf-spim&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	
	mosi-pin = &amp;lt;23&amp;gt;;
	miso-pin = &amp;lt;22&amp;gt;;
	sck-pin = &amp;lt;21&amp;gt;;
	clock-frequency = &amp;lt;4000000&amp;gt;;
	
	cs-gpios = &amp;lt;&amp;amp;gpio0 20 GPIO_ACTIVE_LOW&amp;gt;;
	
	
	
};

&amp;amp;spi2 {
	status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;i2c1 {
    status = &amp;quot;disabled&amp;quot;;
};

&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;prj.conf :&amp;nbsp;&lt;/span&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_STDOUT_CONSOLE=y
CONFIG_PRINTK=y

CONFIG_SPI=y
#CONFIG_SPI_1=y
#CONFIG_SPI_NRFX=y

CONFIG_GPIO=y

CONFIG_MAIN_STACK_SIZE=4096&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;zephyr.dts :&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;/dts-v1/;

/ {
	#address-cells = &amp;lt; 0x1 &amp;gt;;
	#size-cells = &amp;lt; 0x1 &amp;gt;;
	model = &amp;quot;Nordic nRF52833 DK NRF52833&amp;quot;;
	compatible = &amp;quot;nordic,nrf52833-dk-nrf52833&amp;quot;;
	chosen {
		zephyr,entropy = &amp;amp;rng;
		zephyr,flash-controller = &amp;amp;flash_controller;
		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;
	};
	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;
	};
	soc {
		#address-cells = &amp;lt; 0x1 &amp;gt;;
		#size-cells = &amp;lt; 0x1 &amp;gt;;
		compatible = &amp;quot;nordic,nRF52833-QIAA&amp;quot;, &amp;quot;nordic,nRF52833&amp;quot;, &amp;quot;nordic,nRF52&amp;quot;, &amp;quot;simple-bus&amp;quot;;
		interrupt-parent = &amp;lt; &amp;amp;nvic &amp;gt;;
		ranges;
		nvic: interrupt-controller@e000e100 {
			compatible = &amp;quot;arm,v7m-nvic&amp;quot;;
			reg = &amp;lt; 0xe000e100 0xc00 &amp;gt;;
			interrupt-controller;
			#interrupt-cells = &amp;lt; 0x2 &amp;gt;;
			arm,num-irq-priority-bits = &amp;lt; 0x3 &amp;gt;;
			phandle = &amp;lt; 0x1 &amp;gt;;
		};
		systick: timer@e000e010 {
			compatible = &amp;quot;arm,armv7m-systick&amp;quot;;
			reg = &amp;lt; 0xe000e010 0x10 &amp;gt;;
			status = &amp;quot;disabled&amp;quot;;
		};
		flash_controller: flash-controller@4001e000 {
			compatible = &amp;quot;nordic,nrf52-flash-controller&amp;quot;;
			reg = &amp;lt; 0x4001e000 0x1000 &amp;gt;;
			#address-cells = &amp;lt; 0x1 &amp;gt;;
			#size-cells = &amp;lt; 0x1 &amp;gt;;
			label = &amp;quot;NRF_FLASH_DRV_NAME&amp;quot;;
			flash0: flash@0 {
				compatible = &amp;quot;soc-nv-flash&amp;quot;;
				label = &amp;quot;NRF_FLASH&amp;quot;;
				erase-block-size = &amp;lt; 0x1000 &amp;gt;;
				write-block-size = &amp;lt; 0x4 &amp;gt;;
				reg = &amp;lt; 0x0 0x80000 &amp;gt;;
				partitions {
					compatible = &amp;quot;fixed-partitions&amp;quot;;
					#address-cells = &amp;lt; 0x1 &amp;gt;;
					#size-cells = &amp;lt; 0x1 &amp;gt;;
					boot_partition: partition@0 {
						label = &amp;quot;mcuboot&amp;quot;;
						reg = &amp;lt; 0x0 0xc000 &amp;gt;;
					};
					slot0_partition: partition@c000 {
						label = &amp;quot;image-0&amp;quot;;
						reg = &amp;lt; 0xc000 0x32000 &amp;gt;;
					};
					slot1_partition: partition@3e000 {
						label = &amp;quot;image-1&amp;quot;;
						reg = &amp;lt; 0x3e000 0x32000 &amp;gt;;
					};
					scratch_partition: partition@70000 {
						label = &amp;quot;image-scratch&amp;quot;;
						reg = &amp;lt; 0x70000 0xa000 &amp;gt;;
					};
					storage_partition: partition@7a000 {
						label = &amp;quot;storage&amp;quot;;
						reg = &amp;lt; 0x7a000 0x6000 &amp;gt;;
					};
				};
			};
		};
		sram0: memory@20000000 {
			compatible = &amp;quot;mmio-sram&amp;quot;;
			reg = &amp;lt; 0x20000000 0x20000 &amp;gt;;
		};
		adc: adc@40007000 {
			compatible = &amp;quot;nordic,nrf-saadc&amp;quot;;
			reg = &amp;lt; 0x40007000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x7 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;ADC_0&amp;quot;;
			#io-channel-cells = &amp;lt; 0x1 &amp;gt;;
		};
		clock: clock@40000000 {
			compatible = &amp;quot;nordic,nrf-clock&amp;quot;;
			reg = &amp;lt; 0x40000000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x0 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;CLOCK&amp;quot;;
		};
		ecb: ecb@4000e000 {
			compatible = &amp;quot;nordic,nrf-ecb&amp;quot;;
			reg = &amp;lt; 0x4000e000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0xe 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;ECB&amp;quot;;
		};
		uart0: uart@40002000 {
			reg = &amp;lt; 0x40002000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x2 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;UART_0&amp;quot;;
			compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
			current-speed = &amp;lt; 0x1c200 &amp;gt;;
			tx-pin = &amp;lt; 0x6 &amp;gt;;
			rx-pin = &amp;lt; 0x8 &amp;gt;;
			rts-pin = &amp;lt; 0x5 &amp;gt;;
			cts-pin = &amp;lt; 0x7 &amp;gt;;
		};
		uart1: arduino_serial: uart@40028000 {
			compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
			reg = &amp;lt; 0x40028000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x28 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;UART_1&amp;quot;;
			current-speed = &amp;lt; 0x1c200 &amp;gt;;
			rx-pin = &amp;lt; 0x21 &amp;gt;;
			tx-pin = &amp;lt; 0x22 &amp;gt;;
		};
		gpiote: gpiote@40006000 {
			compatible = &amp;quot;nordic,nrf-gpiote&amp;quot;;
			reg = &amp;lt; 0x40006000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x6 0x5 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;GPIOTE_0&amp;quot;;
		};
		gpio0: gpio@50000000 {
			compatible = &amp;quot;nordic,nrf-gpio&amp;quot;;
			gpio-controller;
			reg = &amp;lt; 0x50000000 0x200 0x50000500 0x300 &amp;gt;;
			#gpio-cells = &amp;lt; 0x2 &amp;gt;;
			label = &amp;quot;GPIO_0&amp;quot;;
			status = &amp;quot;okay&amp;quot;;
			port = &amp;lt; 0x0 &amp;gt;;
			phandle = &amp;lt; 0x2 &amp;gt;;
		};
		gpio1: gpio@50000300 {
			compatible = &amp;quot;nordic,nrf-gpio&amp;quot;;
			gpio-controller;
			reg = &amp;lt; 0x50000300 0x200 0x50000800 0x300 &amp;gt;;
			#gpio-cells = &amp;lt; 0x2 &amp;gt;;
			ngpios = &amp;lt; 0xa &amp;gt;;
			label = &amp;quot;GPIO_1&amp;quot;;
			status = &amp;quot;okay&amp;quot;;
			port = &amp;lt; 0x1 &amp;gt;;
			phandle = &amp;lt; 0x6 &amp;gt;;
		};
		i2c0: arduino_i2c: i2c@40003000 {
			#address-cells = &amp;lt; 0x1 &amp;gt;;
			#size-cells = &amp;lt; 0x0 &amp;gt;;
			reg = &amp;lt; 0x40003000 0x1000 &amp;gt;;
			clock-frequency = &amp;lt; 0x186a0 &amp;gt;;
			interrupts = &amp;lt; 0x3 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;I2C_0&amp;quot;;
			compatible = &amp;quot;nordic,nrf-twi&amp;quot;;
			sda-pin = &amp;lt; 0x1a &amp;gt;;
			scl-pin = &amp;lt; 0x1b &amp;gt;;
		};
		i2c1: i2c@40004000 {
			#address-cells = &amp;lt; 0x1 &amp;gt;;
			#size-cells = &amp;lt; 0x0 &amp;gt;;
			reg = &amp;lt; 0x40004000 0x1000 &amp;gt;;
			clock-frequency = &amp;lt; 0x186a0 &amp;gt;;
			interrupts = &amp;lt; 0x4 0x1 &amp;gt;;
			status = &amp;quot;disabled&amp;quot;;
			label = &amp;quot;I2C_1&amp;quot;;
			compatible = &amp;quot;nordic,nrf-twi&amp;quot;;
			sda-pin = &amp;lt; 0x1e &amp;gt;;
			scl-pin = &amp;lt; 0x1f &amp;gt;;
		};
		pwm0: pwm@4001c000 {
			compatible = &amp;quot;nordic,nrf-pwm&amp;quot;;
			reg = &amp;lt; 0x4001c000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x1c 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;PWM_0&amp;quot;;
			#pwm-cells = &amp;lt; 0x1 &amp;gt;;
			ch0-pin = &amp;lt; 0xd &amp;gt;;
			ch0-inverted;
			phandle = &amp;lt; 0x5 &amp;gt;;
		};
		pwm1: pwm@40021000 {
			compatible = &amp;quot;nordic,nrf-pwm&amp;quot;;
			reg = &amp;lt; 0x40021000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x21 0x1 &amp;gt;;
			status = &amp;quot;disabled&amp;quot;;
			label = &amp;quot;PWM_1&amp;quot;;
			#pwm-cells = &amp;lt; 0x1 &amp;gt;;
		};
		pwm2: pwm@40022000 {
			compatible = &amp;quot;nordic,nrf-pwm&amp;quot;;
			reg = &amp;lt; 0x40022000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x22 0x1 &amp;gt;;
			status = &amp;quot;disabled&amp;quot;;
			label = &amp;quot;PWM_2&amp;quot;;
			#pwm-cells = &amp;lt; 0x1 &amp;gt;;
		};
		pwm3: pwm@4002d000 {
			compatible = &amp;quot;nordic,nrf-pwm&amp;quot;;
			reg = &amp;lt; 0x4002d000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x2d 0x1 &amp;gt;;
			status = &amp;quot;disabled&amp;quot;;
			label = &amp;quot;PWM_3&amp;quot;;
			#pwm-cells = &amp;lt; 0x1 &amp;gt;;
		};
		qdec: qdec@40012000 {
			compatible = &amp;quot;nordic,nrf-qdec&amp;quot;;
			reg = &amp;lt; 0x40012000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x12 0x1 &amp;gt;;
			status = &amp;quot;disabled&amp;quot;;
			label = &amp;quot;QDEC&amp;quot;;
		};
		rng: random@4000d000 {
			compatible = &amp;quot;nordic,nrf-rng&amp;quot;;
			reg = &amp;lt; 0x4000d000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0xd 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;RNG&amp;quot;;
		};
		spi0: spi@40003000 {
			#address-cells = &amp;lt; 0x1 &amp;gt;;
			#size-cells = &amp;lt; 0x0 &amp;gt;;
			reg = &amp;lt; 0x40003000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x3 0x1 &amp;gt;;
			status = &amp;quot;disabled&amp;quot;;
			label = &amp;quot;SPI_0&amp;quot;;
			compatible = &amp;quot;nordic,nrf-spi&amp;quot;;
			sck-pin = &amp;lt; 0x1b &amp;gt;;
			mosi-pin = &amp;lt; 0x1a &amp;gt;;
			miso-pin = &amp;lt; 0x1d &amp;gt;;
		};
		spi1: spi@40004000 {
			#address-cells = &amp;lt; 0x1 &amp;gt;;
			#size-cells = &amp;lt; 0x0 &amp;gt;;
			reg = &amp;lt; 0x40004000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x4 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;SPI_1&amp;quot;;
			compatible = &amp;quot;nordic,nrf-spim&amp;quot;;
			sck-pin = &amp;lt; 0x15 &amp;gt;;
			mosi-pin = &amp;lt; 0x17 &amp;gt;;
			miso-pin = &amp;lt; 0x16 &amp;gt;;
			clock-frequency = &amp;lt; 0x3d0900 &amp;gt;;
			cs-gpios = &amp;lt; &amp;amp;gpio0 0x14 0x1 &amp;gt;;
		};
		spi2: spi@40023000 {
			#address-cells = &amp;lt; 0x1 &amp;gt;;
			#size-cells = &amp;lt; 0x0 &amp;gt;;
			reg = &amp;lt; 0x40023000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x23 0x1 &amp;gt;;
			status = &amp;quot;disabled&amp;quot;;
			label = &amp;quot;SPI_2&amp;quot;;
		};
		spi3: arduino_spi: spi@4002f000 {
			compatible = &amp;quot;nordic,nrf-spim&amp;quot;;
			#address-cells = &amp;lt; 0x1 &amp;gt;;
			#size-cells = &amp;lt; 0x0 &amp;gt;;
			reg = &amp;lt; 0x4002f000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x2f 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;SPI_3&amp;quot;;
			sck-pin = &amp;lt; 0x17 &amp;gt;;
			miso-pin = &amp;lt; 0x16 &amp;gt;;
			mosi-pin = &amp;lt; 0x15 &amp;gt;;
			cs-gpios = &amp;lt; &amp;amp;arduino_header 0x10 0x1 &amp;gt;;
		};
		rtc0: rtc@4000b000 {
			compatible = &amp;quot;nordic,nrf-rtc&amp;quot;;
			reg = &amp;lt; 0x4000b000 0x1000 &amp;gt;;
			cc-num = &amp;lt; 0x3 &amp;gt;;
			interrupts = &amp;lt; 0xb 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			clock-frequency = &amp;lt; 0x8000 &amp;gt;;
			prescaler = &amp;lt; 0x1 &amp;gt;;
			label = &amp;quot;RTC_0&amp;quot;;
		};
		rtc1: rtc@40011000 {
			compatible = &amp;quot;nordic,nrf-rtc&amp;quot;;
			reg = &amp;lt; 0x40011000 0x1000 &amp;gt;;
			cc-num = &amp;lt; 0x4 &amp;gt;;
			interrupts = &amp;lt; 0x11 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			clock-frequency = &amp;lt; 0x8000 &amp;gt;;
			prescaler = &amp;lt; 0x1 &amp;gt;;
			label = &amp;quot;RTC_1&amp;quot;;
		};
		rtc2: rtc@40024000 {
			compatible = &amp;quot;nordic,nrf-rtc&amp;quot;;
			reg = &amp;lt; 0x40024000 0x1000 &amp;gt;;
			cc-num = &amp;lt; 0x4 &amp;gt;;
			interrupts = &amp;lt; 0x24 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			clock-frequency = &amp;lt; 0x8000 &amp;gt;;
			prescaler = &amp;lt; 0x1 &amp;gt;;
			label = &amp;quot;RTC_2&amp;quot;;
		};
		timer0: timer@40008000 {
			compatible = &amp;quot;nordic,nrf-timer&amp;quot;;
			status = &amp;quot;okay&amp;quot;;
			reg = &amp;lt; 0x40008000 0x1000 &amp;gt;;
			cc-num = &amp;lt; 0x4 &amp;gt;;
			interrupts = &amp;lt; 0x8 0x1 &amp;gt;;
			prescaler = &amp;lt; 0x0 &amp;gt;;
			label = &amp;quot;TIMER_0&amp;quot;;
		};
		timer1: timer@40009000 {
			compatible = &amp;quot;nordic,nrf-timer&amp;quot;;
			status = &amp;quot;okay&amp;quot;;
			reg = &amp;lt; 0x40009000 0x1000 &amp;gt;;
			cc-num = &amp;lt; 0x4 &amp;gt;;
			interrupts = &amp;lt; 0x9 0x1 &amp;gt;;
			prescaler = &amp;lt; 0x0 &amp;gt;;
			label = &amp;quot;TIMER_1&amp;quot;;
		};
		timer2: timer@4000a000 {
			compatible = &amp;quot;nordic,nrf-timer&amp;quot;;
			status = &amp;quot;okay&amp;quot;;
			reg = &amp;lt; 0x4000a000 0x1000 &amp;gt;;
			cc-num = &amp;lt; 0x4 &amp;gt;;
			interrupts = &amp;lt; 0xa 0x1 &amp;gt;;
			prescaler = &amp;lt; 0x0 &amp;gt;;
			label = &amp;quot;TIMER_2&amp;quot;;
			phandle = &amp;lt; 0x4 &amp;gt;;
		};
		timer3: timer@4001a000 {
			compatible = &amp;quot;nordic,nrf-timer&amp;quot;;
			status = &amp;quot;okay&amp;quot;;
			reg = &amp;lt; 0x4001a000 0x1000 &amp;gt;;
			cc-num = &amp;lt; 0x6 &amp;gt;;
			interrupts = &amp;lt; 0x1a 0x1 &amp;gt;;
			prescaler = &amp;lt; 0x0 &amp;gt;;
			label = &amp;quot;TIMER_3&amp;quot;;
		};
		timer4: timer@4001b000 {
			compatible = &amp;quot;nordic,nrf-timer&amp;quot;;
			status = &amp;quot;okay&amp;quot;;
			reg = &amp;lt; 0x4001b000 0x1000 &amp;gt;;
			cc-num = &amp;lt; 0x6 &amp;gt;;
			interrupts = &amp;lt; 0x1b 0x1 &amp;gt;;
			prescaler = &amp;lt; 0x0 &amp;gt;;
			label = &amp;quot;TIMER_4&amp;quot;;
		};
		temp: temp@4000c000 {
			compatible = &amp;quot;nordic,nrf-temp&amp;quot;;
			reg = &amp;lt; 0x4000c000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0xc 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;TEMP_0&amp;quot;;
		};
		usbd: usbd@40027000 {
			compatible = &amp;quot;nordic,nrf-usbd&amp;quot;;
			reg = &amp;lt; 0x40027000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x27 0x1 &amp;gt;;
			num-bidir-endpoints = &amp;lt; 0x1 &amp;gt;;
			num-in-endpoints = &amp;lt; 0x7 &amp;gt;;
			num-out-endpoints = &amp;lt; 0x7 &amp;gt;;
			num-isoin-endpoints = &amp;lt; 0x1 &amp;gt;;
			num-isoout-endpoints = &amp;lt; 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;USBD&amp;quot;;
		};
		wdt: wdt0: watchdog@40010000 {
			compatible = &amp;quot;nordic,nrf-watchdog&amp;quot;;
			reg = &amp;lt; 0x40010000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x10 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			label = &amp;quot;WDT&amp;quot;;
		};
		ficr: ficr@10000000 {
			compatible = &amp;quot;nordic,nrf-ficr&amp;quot;;
			reg = &amp;lt; 0x10000000 0x1000 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
		};
		uicr: uicr@10001000 {
			compatible = &amp;quot;nordic,nrf-uicr&amp;quot;;
			reg = &amp;lt; 0x10001000 0x1000 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
		};
		radio: radio@40001000 {
			compatible = &amp;quot;nordic,nrf-radio&amp;quot;;
			reg = &amp;lt; 0x40001000 0x1000 &amp;gt;;
			interrupts = &amp;lt; 0x1 0x1 &amp;gt;;
			status = &amp;quot;okay&amp;quot;;
			dfe-ant-num = &amp;lt; 0x0 &amp;gt;;
		};
	};
	cpus {
		#address-cells = &amp;lt; 0x1 &amp;gt;;
		#size-cells = &amp;lt; 0x0 &amp;gt;;
		cpu@0 {
			device_type = &amp;quot;cpu&amp;quot;;
			compatible = &amp;quot;arm,cortex-m4f&amp;quot;;
			reg = &amp;lt; 0x0 &amp;gt;;
		};
	};
	sw_pwm: sw-pwm {
		compatible = &amp;quot;nordic,nrf-sw-pwm&amp;quot;;
		status = &amp;quot;disabled&amp;quot;;
		label = &amp;quot;SW_PWM&amp;quot;;
		generator = &amp;lt; &amp;amp;timer2 &amp;gt;;
		channel-count = &amp;lt; 0x3 &amp;gt;;
		clock-prescaler = &amp;lt; 0x0 &amp;gt;;
		ppi-base = &amp;lt; 0x0 &amp;gt;;
		gpiote-base = &amp;lt; 0x0 &amp;gt;;
		#pwm-cells = &amp;lt; 0x1 &amp;gt;;
	};
	leds {
		compatible = &amp;quot;gpio-leds&amp;quot;;
		led0: led_0 {
			gpios = &amp;lt; &amp;amp;gpio0 0xd 0x1 &amp;gt;;
			label = &amp;quot;Green LED 0&amp;quot;;
		};
		led1: led_1 {
			gpios = &amp;lt; &amp;amp;gpio0 0xe 0x1 &amp;gt;;
			label = &amp;quot;Green LED 1&amp;quot;;
		};
		led2: led_2 {
			gpios = &amp;lt; &amp;amp;gpio0 0xf 0x1 &amp;gt;;
			label = &amp;quot;Green LED 2&amp;quot;;
		};
		led3: led_3 {
			gpios = &amp;lt; &amp;amp;gpio0 0x10 0x1 &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 0xd &amp;gt;;
		};
	};
	buttons {
		compatible = &amp;quot;gpio-keys&amp;quot;;
		button0: button_0 {
			gpios = &amp;lt; &amp;amp;gpio0 0xb 0x11 &amp;gt;;
			label = &amp;quot;Push button switch 0&amp;quot;;
		};
		button1: button_1 {
			gpios = &amp;lt; &amp;amp;gpio0 0xc 0x11 &amp;gt;;
			label = &amp;quot;Push button switch 1&amp;quot;;
		};
		button2: button_2 {
			gpios = &amp;lt; &amp;amp;gpio0 0x18 0x11 &amp;gt;;
			label = &amp;quot;Push button switch 2&amp;quot;;
		};
		button3: button_3 {
			gpios = &amp;lt; &amp;amp;gpio0 0x19 0x11 &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; 0x2 &amp;gt;;
		gpio-map-mask = &amp;lt; 0xffffffff 0xffffffc0 &amp;gt;;
		gpio-map-pass-thru = &amp;lt; 0x0 0x3f &amp;gt;;
		gpio-map = &amp;lt; 0x0 0x0 &amp;amp;gpio0 0x3 0x0 &amp;gt;, &amp;lt; 0x1 0x0 &amp;amp;gpio0 0x4 0x0 &amp;gt;, &amp;lt; 0x2 0x0 &amp;amp;gpio0 0x1c 0x0 &amp;gt;, &amp;lt; 0x3 0x0 &amp;amp;gpio0 0x1d 0x0 &amp;gt;, &amp;lt; 0x4 0x0 &amp;amp;gpio0 0x1e 0x0 &amp;gt;, &amp;lt; 0x5 0x0 &amp;amp;gpio0 0x1f 0x0 &amp;gt;, &amp;lt; 0x6 0x0 &amp;amp;gpio1 0x1 0x0 &amp;gt;, &amp;lt; 0x7 0x0 &amp;amp;gpio1 0x2 0x0 &amp;gt;, &amp;lt; 0x8 0x0 &amp;amp;gpio1 0x3 0x0 &amp;gt;, &amp;lt; 0x9 0x0 &amp;amp;gpio1 0x4 0x0 &amp;gt;, &amp;lt; 0xa 0x0 &amp;amp;gpio1 0x5 0x0 &amp;gt;, &amp;lt; 0xb 0x0 &amp;amp;gpio1 0x6 0x0 &amp;gt;, &amp;lt; 0xc 0x0 &amp;amp;gpio1 0x7 0x0 &amp;gt;, &amp;lt; 0xd 0x0 &amp;amp;gpio1 0x8 0x0 &amp;gt;, &amp;lt; 0xe 0x0 &amp;amp;gpio0 0x11 0x0 &amp;gt;, &amp;lt; 0xf 0x0 &amp;amp;gpio0 0x13 0x0 &amp;gt;, &amp;lt; 0x10 0x0 &amp;amp;gpio0 0x14 0x0 &amp;gt;, &amp;lt; 0x11 0x0 &amp;amp;gpio0 0x15 0x0 &amp;gt;, &amp;lt; 0x12 0x0 &amp;amp;gpio0 0x16 0x0 &amp;gt;, &amp;lt; 0x13 0x0 &amp;amp;gpio0 0x17 0x0 &amp;gt;, &amp;lt; 0x14 0x0 &amp;amp;gpio0 0x1a 0x0 &amp;gt;, &amp;lt; 0x15 0x0 &amp;amp;gpio0 0x1b 0x0 &amp;gt;;
		phandle = &amp;lt; 0x3 &amp;gt;;
	};
};
&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: NCS/Zephyr SPI CS Issues</title><link>https://devzone.nordicsemi.com/thread/320035?ContentTypeID=1</link><pubDate>Wed, 14 Jul 2021 13:02:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d34c177b-1aaa-482c-a407-0a42ba12864d</guid><dc:creator>Carl Richard</dc:creator><description>&lt;p&gt;Hello, Jansens!&lt;br /&gt;&lt;br /&gt;The &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/peripherals/spi.html#c.SPI_CS_CONTROL_PTR_DT"&gt;SPI documentation&lt;/a&gt; specifies that a gpio node is supposed to be used when instantiating a spi_cs_control structure. I see that you are using the SPI device for this, which I believe won&amp;#39;t work. Could you try to use a gpio node (like they do in the documentation) instead?&lt;br /&gt;&lt;br /&gt;Please report back your results!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Carl Richard&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>