<?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>nRF5340: SPI CS not working</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81123/nrf5340-spi-cs-not-working</link><description>I&amp;#39;m unable to get SPI to work on my nRF5340DK board. I can see activity on MOSI and SCK pins, but not on CS. The pin is not even initialized and is floating. 
 My overlay file 
 
 
 And my source code: 
 # define SPIDEV DT_NODELABEL ( spi1 ) 
 
 void</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Oct 2021 14:17:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81123/nrf5340-spi-cs-not-working" /><item><title>RE: nRF5340: SPI CS not working</title><link>https://devzone.nordicsemi.com/thread/336254?ContentTypeID=1</link><pubDate>Wed, 27 Oct 2021 14:17:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76d03704-f206-46fd-b370-89a06386cc82</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I can see that you have set&lt;span&gt;&amp;nbsp;.&lt;/span&gt;&lt;span&gt;spi_cfg&lt;/span&gt;.&lt;span&gt;cs&lt;/span&gt;&lt;span&gt;= NULL.&amp;nbsp;&lt;/span&gt;Check out the following ticket for how to go about this:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/73140/nrf9160-and-spi-cs-control-inhibited-no-gpio-device"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/73140/nrf9160-and-spi-cs-control-inhibited-no-gpio-device&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can also take a look at&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.6.99-ncs1/tests/drivers/spi/spi_loopback/src/spi.c"&gt;zephyr/tests/drivers/spi/spi_loopback/src/spi.c&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;to see how to set .cs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.6.99-ncs1/tests/drivers/spi/spi_loopback/src/spi.c#L26-L31"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v2.6.99-ncs1/tests/drivers/spi/spi_loopback/src/spi.c#L26-L31&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.6.99-ncs1/tests/drivers/spi/spi_loopback/src/spi.c#L92-L102"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v2.6.99-ncs1/tests/drivers/spi/spi_loopback/src/spi.c#L92-L102&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.6.99-ncs1/tests/drivers/spi/spi_loopback/src/spi.c#L76"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v2.6.99-ncs1/tests/drivers/spi/spi_loopback/src/spi.c#L76&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340: SPI CS not working</title><link>https://devzone.nordicsemi.com/thread/336177?ContentTypeID=1</link><pubDate>Wed, 27 Oct 2021 11:37:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc2335bc-0a99-40f6-8e0a-5d9825cede7f</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Try setting &lt;code&gt;CONFIG_GPIO=y&lt;/code&gt; in the prj.conf file.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>