<?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 Slave NRFX sample</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93054/nrf5340-spi-slave-nrfx-sample</link><description>Hi! 
 I&amp;#39;m trying to run SPI slave on nRF5340 - doesn&amp;#39;t work - project doesn&amp;#39;t even build, the SPI master is running. 
 Can I see an example of NRFX SPI Slave for nRF5340?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 26 Oct 2022 19:33:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93054/nrf5340-spi-slave-nrfx-sample" /><item><title>RE: nRF5340 SPI Slave NRFX sample</title><link>https://devzone.nordicsemi.com/thread/392703?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 19:33:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:756871da-4374-43a9-9ffa-c5b38ab2b306</guid><dc:creator>SergeySK</dc:creator><description>&lt;p&gt;Hi, Simon!&lt;br /&gt;Your advice helped me a lot!&lt;br /&gt; Thank you!&lt;/p&gt;
&lt;pre class="tw-data-text tw-text-large tw-ta" dir="ltr"&gt;&lt;span class="Y2IQFc" lang="en"&gt;But your spi Slave code is not going to the same :)&lt;br /&gt;&lt;br /&gt;This my code:&lt;/span&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; ALT&lt;/span&gt;&lt;span&gt;_SPI_SLAVE&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;DT_LABEL&lt;/span&gt;&lt;span&gt;( &lt;/span&gt;&lt;span&gt;DT_NODELABEL&lt;/span&gt;&lt;span&gt;( alt_spi3_slave ) ) &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;static&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; device &amp;nbsp;&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;spi3_s_dev_alt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;......&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;spi3_s_dev_alt &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;device_get_binding&lt;/span&gt;&lt;span&gt;( ALT_SPI_SLAVE );&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;if&lt;/span&gt;&lt;span&gt;( spi3_s_dev_alt &lt;/span&gt;&lt;span&gt;==&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;NULL&lt;/span&gt;&lt;span&gt; )&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;return&lt;/span&gt;&lt;span&gt; ERR_NO_INIT;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;.....&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;quot;nrf5340dk_nrf5340_cpuapp.overlay&amp;quot;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;/* SPI3 for slave mode&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;alt_spi3_slave&lt;/span&gt;&lt;span&gt;: &lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;spi3&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;compatible&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;nordic,nrf-spis&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;okay&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;pinctrl-0&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;spi3_default&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;pinctrl-1&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;spi3_sleep&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;def-char&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;0x00&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;};&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;&amp;quot;prj.conf&amp;quot;:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;# This is needed for using another SPIM instance via the Zephyr SPI driver.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_SPI&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_SPI_ASYNC&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_SPI_SLAVE&lt;/span&gt;&lt;span&gt;=y &lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;pre id="tw-target-text" class="tw-data-text tw-text-large tw-ta" dir="ltr"&gt;&lt;span class="Y2IQFc" lang="en"&gt;Build fails:&lt;br /&gt;C:\ncs\v2.1.1\zephyr\include\zephyr\devicetree.h:177:29: note: in expansion of macro &amp;#39;DT_CAT&amp;#39;&lt;br /&gt; 177 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)&lt;br /&gt; | ^~~~~~&lt;br /&gt;c:\nRF_prj\myApp\myApp1\src\app_spi3_s.c:18:34: note: in expansion of macro &amp;#39;DT_NODELABEL&amp;#39;&lt;br /&gt; 18 | #define ALT_SPI_SLAVE DT_LABEL( DT_NODELABEL( my_spi3_slave ) )&lt;br /&gt; | ^~~~~~~~~~~~&lt;br /&gt;c:\nRF_prj\myApp\myApp1\src\app_spi3_s.c:46:39: note: in expansion of macro &amp;#39;ALT_SPI_SLAVE&amp;#39;&lt;br /&gt; 46 | spi3_s_dev_alt = device_get_binding( ALT_SPI_SLAVE );&lt;br /&gt; | ^~~~~~~~~~~~~&lt;br /&gt;c:\nRF_prj\myApp\myApp1\build_1\zephyr\include\generated\devicetree_unfixed.h:11795:38: note: each undeclared identifier is reported only once for each function it appears in&lt;br /&gt;11795 | #define DT_N_NODELABEL_my_spi3_slave DT_N_S_soc_S_peripheral_50000000_S_spi_c000&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre id="tw-target-text" class="tw-data-text tw-text-large tw-ta" dir="ltr"&gt;&lt;span class="Y2IQFc" lang="en"&gt;Do not tell me what could be the problem?&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Sergii&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 SPI Slave NRFX sample</title><link>https://devzone.nordicsemi.com/thread/392013?ContentTypeID=1</link><pubDate>Mon, 24 Oct 2022 06:09:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8aec049-7e45-4eed-a2c5-011e2d865baf</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Adding CONFIG_SPI=y and CONFIG_NRFX_SPIM1=y will make the Zephyr API use the &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/b676d4855a86957bab6ede4ef1b3f3c4d1c64d7c/drivers/spi/spi_nrfx_spim.c#L583"&gt;nrfx Zephyr port&lt;/a&gt; for an enabled instance. &lt;a href="https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/boards/nrf/nrfx_prs"&gt;Here&lt;/a&gt; you can see the nrfx peripheral resource sharing example in Zephyr.&lt;/p&gt;
&lt;p&gt;My colleague Håkon&amp;nbsp;also uploaded some nrfx SPI projects for the nRF Connect SDK in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/70105/how-to-use-spi-interface-in-a-zephyr-sample-example/288587"&gt;this ticket&lt;/a&gt;, and also explains how to configure and set up an SPI device for the nRF5340 &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/67065/how-to-configure-and-setup-an-spi-device-to-nrf5340"&gt;here&lt;/a&gt;.&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><item><title>RE: nRF5340 SPI Slave NRFX sample</title><link>https://devzone.nordicsemi.com/thread/391809?ContentTypeID=1</link><pubDate>Fri, 21 Oct 2022 08:52:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb7c994f-4c6d-4444-b613-ad4211f1cee8</guid><dc:creator>SergeySK</dc:creator><description>&lt;pre id="tw-target-text" class="tw-data-text tw-text-large tw-ta" dir="ltr"&gt;&lt;span class="Y2IQFc" lang="en"&gt;Hello Simon.&lt;br /&gt;
Thanks for the great zephyre sample. They didn&amp;#39;t help me at all.&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="tw-data-text tw-text-large tw-ta" dir="ltr"&gt;&lt;span class="Y2IQFc" lang="en"&gt;Perhaps you still have an example for nRF5340 SPI Slave nrfx api?&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="tw-data-text tw-text-large tw-ta" dir="ltr"&gt;&lt;span class="Y2IQFc" lang="en"&gt;Perhaps you have a file &amp;quot;nrf5340.h&amp;quot; or similar that has NRF_SPI_Type defined for nRF5340?&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 SPI Slave NRFX sample</title><link>https://devzone.nordicsemi.com/thread/391796?ContentTypeID=1</link><pubDate>Fri, 21 Oct 2022 07:56:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0af6298b-29ad-4aac-9d33-a3a2a114a4f8</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Here are some SPI slave examples (NCS v2.0.0) made by one of my colleagues:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;&lt;a href="https://github.com/simon-iversen/ncs_samples/tree/master/spi_slave_and_master_ncs_v200"&gt;https://github.com/simon-iversen/ncs_samples/tree/master/spi_slave_and_master_ncs_v200&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/too1/ncs-spi-master-slave-example"&gt;https://github.com/too1/ncs-spi-master-slave-example&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I hope one or both of them will be helpful to you. If you struggle with building a project, please share the build log so we can see where it is failing exactly.&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>