<?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>Simple SPI device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/115251/simple-spi-device</link><description>Hi 
 I am trying to make a SPI connection with a device which doesn&amp;#39;t already have a driver build into Zephyr. 
 Is there some kind of genereic device i can use since i just need a simple SPI connection. 
 I&amp;#39;ve found a lot of very old examples, and i</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Oct 2024 13:59:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/115251/simple-spi-device" /><item><title>RE: Simple SPI device</title><link>https://devzone.nordicsemi.com/thread/505026?ContentTypeID=1</link><pubDate>Fri, 04 Oct 2024 13:59:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:915fe835-8185-46cc-b1f5-3c6959dcf72c</guid><dc:creator>JonathanRJ</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Thank you so much for your anwser, the attached zip file got the SPI up and running in no time!&lt;/p&gt;
&lt;p&gt;If there is someone else, like me, who is using the nRF9151dk then all you have to add is the following to the prj.conf file:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_TFM_SECURE_UART&lt;/span&gt;&lt;span&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_TFM_LOG_LEVEL_SILENCE&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I&amp;#39;ve also noticed that the deafult clock freq of 40MHz was gave errors in the readings when MOSI and MISO was shorted, so if you get errors then be sure to change the frequency in the spi_config struct.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Again, thank you very much for the help!&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple SPI device</title><link>https://devzone.nordicsemi.com/thread/505015?ContentTypeID=1</link><pubDate>Fri, 04 Oct 2024 13:23:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29f8c077-a895-4817-9fdb-e93994be141c</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I suggest you have a look at &lt;a href="https://github.com/too1/ncs-spi-master-slave-example/tree/master"&gt;this unofficial sample&lt;/a&gt;&amp;nbsp;which demonstrate both SPI master and slave. Note that this use the Zephyr polling API with signals which makes sense in this particular case,&amp;nbsp;but often it makes sense to do SPI communication as blocking operations in separate threads. This is just a minor change though, where you use the blocking SPI API functions insated (those without the _signal suffix). See the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.7.0/page/zephyr/hardware/peripherals/spi.html"&gt;SPI API doc&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;(Attaching a modified version of the unofficial smaple I linked to here which use blocking calls in separate threads and in separate projects for separate boards. I did not test it now and honestly don&amp;#39;t know if it works, but you can refer to it for inspiration: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/spi_5F00_master_5F00_slave_5F00_separate.zip"&gt;devzone.nordicsemi.com/.../spi_5F00_master_5F00_slave_5F00_separate.zip&lt;/a&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>