<?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>SPI slave configuration &amp;amp; overlay</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83514/spi-slave-configuration-overlay</link><description>Hi, 
 
 I am using BL653 dvk to write an application for SPI, In my prj.conf, I added below parameters: 
 Now when I am debugging SPI master code, execution enters the file &amp;quot;spi_nrfx_spi.c&amp;quot;, and transfers data &amp;amp; rest is fine. But when I try to use SPI</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 13 Jan 2022 11:08:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83514/spi-slave-configuration-overlay" /><item><title>RE: SPI slave configuration &amp; overlay</title><link>https://devzone.nordicsemi.com/thread/347557?ContentTypeID=1</link><pubDate>Thu, 13 Jan 2022 11:08:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f11c800-1cd3-4eac-8b79-38196c1faaf1</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;This new issue will be handled in this new case:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/83583/spi-slave-always-returns--etimedout"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/83583/spi-slave-always-returns--etimedout&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Closing this case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave configuration &amp; overlay</title><link>https://devzone.nordicsemi.com/thread/347489?ContentTypeID=1</link><pubDate>Thu, 13 Jan 2022 06:01:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b44c4e4d-df9a-4c29-815e-47ab13daa5b6</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Hello Sigurd,&lt;br /&gt;&lt;br /&gt;Thanks for the kind help,&lt;br /&gt;&lt;br /&gt;Now the code execution is on track on bl653 running spi slave driver.&lt;br /&gt;&lt;br /&gt;But the s&lt;span&gt;pi_read always returns -116, that is&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;-&lt;/span&gt;&lt;span&gt;ETIMEDOUT.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But I do not understand why slave driver always returns&amp;nbsp;-ETIMEDOUT. Master board is sending data, i checked on USB logic analyzer for the same.&lt;br /&gt;&lt;br /&gt;I traced the flow of execution all the way to the source of the error and here is what I found&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;spi_read( ) -&amp;gt; transceive (in file &amp;quot;spi_nrfx_spis.c&amp;quot;) -&amp;gt;&amp;nbsp;&lt;/span&gt;spi_context_wait_for_completion( in file &amp;quot;spi_context.h&amp;quot;) -&amp;gt; and the source of error is as attached in the below snap in #else part&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/pastedimage1641980486229v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Without debug mode as well I am getting the same&amp;nbsp;&lt;/span&gt;&lt;span&gt;-&lt;/span&gt;&lt;span&gt;ETIMEDOUT.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Kindly suggest on if I have missed out on configuring something.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;adding my overlay file details for your reference:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;spi1 {
	compatible = &amp;quot;nordic,nrf-spis&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	sck-pin = &amp;lt;41&amp;gt;;
	mosi-pin = &amp;lt;40&amp;gt;;
	miso-pin = &amp;lt;4&amp;gt;;
	cs-gpios = &amp;lt;&amp;amp;gpio1 23 0&amp;gt;;
	csn-pin = &amp;lt;23&amp;gt;;
	def-char = &amp;lt;0xFF&amp;gt;;
};&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kindly suggest&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave configuration &amp; overlay</title><link>https://devzone.nordicsemi.com/thread/347121?ContentTypeID=1</link><pubDate>Tue, 11 Jan 2022 10:27:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d30d625-5ec9-430d-9288-34192ffa5eb1</guid><dc:creator>Sigurd</dc:creator><description>[quote user="Ubaid_M"]1. what do csn-pin &amp;amp; def-char attributes do..?[/quote]
&lt;p&gt;Here is the documentation for these attributes:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.8.0/zephyr/reference/devicetree/bindings/spi/nordic,nrf-spis.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.8.0/zephyr/reference/devicetree/bindings/spi/nordic,nrf-spis.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.7.0-ncs1/dts/bindings/spi/nordic,nrf-spis.yaml"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v2.7.0-ncs1/dts/bindings/spi/nordic,nrf-spis.yaml&lt;/a&gt;&lt;/p&gt;
[quote user="Ubaid_M"]so is my definition right..?[/quote]
&lt;p&gt;Looks correct&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave configuration &amp; overlay</title><link>https://devzone.nordicsemi.com/thread/347073?ContentTypeID=1</link><pubDate>Tue, 11 Jan 2022 08:13:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38cffaa2-b3df-4c33-bdb5-207636234411</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/sigurdon"&gt;Sigurd&lt;/a&gt;,&lt;br /&gt;&lt;br /&gt;Sorry for the chain of updates, I was able to solve it,&lt;br /&gt;Now execution is entering the slave driver file &amp;quot;spi_nrfx_spis.c&amp;quot;&lt;br /&gt;&lt;br /&gt;I had to define extra properties in spi1 node in bl653_dvk.dts as:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;spi1 {
	compatible = &amp;quot;nordic,nrf-spis&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	sck-pin = &amp;lt;41&amp;gt;;
	mosi-pin = &amp;lt;40&amp;gt;;
	miso-pin = &amp;lt;4&amp;gt;;
	cs-gpios = &amp;lt;&amp;amp;gpio1 23 0&amp;gt;;
	csn-pin = &amp;lt;23&amp;gt;; #extra property defined
	def-char = &amp;lt;0xFF&amp;gt;;#extra property defined
};&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now Please help me with &lt;br /&gt;&lt;br /&gt;1. what do csn-pin &amp;amp; def-char attributes do..?&lt;br /&gt;2. I need to define slave chip select on gpio0, pin:23.,&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;csn-pin&lt;/span&gt;&lt;span&gt; = &amp;lt;&lt;/span&gt;&lt;span&gt;23&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; = &amp;lt;&lt;/span&gt;&lt;span&gt;0xFF&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;so is my definition right..?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave configuration &amp; overlay</title><link>https://devzone.nordicsemi.com/thread/347068?ContentTypeID=1</link><pubDate>Tue, 11 Jan 2022 07:58:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a421c28-b47b-4bf1-898b-90af88fb8900</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Please find build errors when i include overlay file:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;[0/1] Re-running CMake...
Including boilerplate (Zephyr base (cached)): D:/Nordic_Sample_App/Nordic_SDK/v1.8.0/zephyr/cmake/app/boilerplate.cmake
-- Application: D:/PXZ_Sample_App
-- Zephyr version: 2.7.0 (D:/Nordic_Sample_App/Nordic_SDK/v1.8.0/zephyr), build: v2.7.0-ncs1
-- Found west (found suitable version &amp;quot;0.12.0&amp;quot;, minimum required is &amp;quot;0.7.1&amp;quot;)
-- Board: bl653_dvk
-- Cache files will be written to: D:/Nordic_Sample_App/Nordic_SDK/v1.8.0/zephyr/.cache
-- Found dtc: D:/Nordic_Sample_App/Nordic_SDK/v1.8.0/toolchain/opt/bin/dtc.exe (found suitable version &amp;quot;1.4.7&amp;quot;, minimum required is &amp;quot;1.4.6&amp;quot;)
-- Found toolchain: gnuarmemb (d:/Nordic_Sample_App/Nordic_SDK/v1.8.0/toolchain/opt)
-- Found BOARD.dts: D:/Nordic_Sample_App/Nordic_SDK/v1.8.0/zephyr/boards/arm/bl653_dvk/bl653_dvk.dts
-- Found devicetree overlay: D:/PXZ_Sample_App/bl653_dvk.overlay
devicetree error: &amp;#39;def-char&amp;#39; is marked as required in &amp;#39;properties:&amp;#39; in D:/Nordic_Sample_App/Nordic_SDK/v1.8.0/zephyr/dts/bindings\spi\nordic,nrf-spis.yaml, but does not appear in &amp;lt;Node /soc/spi@40004000 in &amp;#39;bl653_dvk.dts.pre.tmp&amp;#39;&amp;gt;
CMake Error at D:\Nordic_Sample_App\Nordic_SDK\v1.8.0\zephyr\cmake\dts.cmake:251 (message):
  gen_defines.py failed with return code: 1
Call Stack (most recent call first):
  D:\Nordic_Sample_App\Nordic_SDK\v1.8.0\zephyr\cmake\app\boilerplate.cmake:545 (include)
  D:\Nordic_Sample_App\Nordic_SDK\v1.8.0\zephyr\share\zephyr-package\cmake\ZephyrConfig.cmake:24 (include)
  D:\Nordic_Sample_App\Nordic_SDK\v1.8.0\zephyr\share\zephyr-package\cmake\ZephyrConfig.cmake:40 (include_boilerplate)
  d:\PXZ_Sample_App\build\CMakeLists.txt:4 (find_package)
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave configuration &amp; overlay</title><link>https://devzone.nordicsemi.com/thread/347066?ContentTypeID=1</link><pubDate>Tue, 11 Jan 2022 07:46:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0cd0db36-2f35-4b8a-b70a-129d95f14443</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Also, I am wondering about including overlay in CMakeLists.txt, Do i need to add &amp;quot;&lt;span&gt;DTC_OVERLAY_FILE&lt;/span&gt;&amp;quot;..?&lt;br /&gt;Because whenever I am trying to include overlay file, I am getting boiler plate error,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave configuration &amp; overlay</title><link>https://devzone.nordicsemi.com/thread/347049?ContentTypeID=1</link><pubDate>Tue, 11 Jan 2022 06:17:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b08896ec-7ef0-4e26-bf81-f64aa6f604e6</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/sigurdon"&gt;Sigurd&lt;/a&gt;,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="15146" url="~/f/nordic-q-a/83514/spi-slave-configuration-overlay/347008#347008"].slave = 1 in&amp;nbsp;spi_config ?[/quote]
&lt;p&gt;.slave =1 i have set.&lt;br /&gt;&lt;br /&gt;Yet it&amp;nbsp;execution is entering to&amp;nbsp; the same file &amp;quot;spi_nrfx_spi.c&amp;quot;:&lt;/p&gt;
[quote userid="108934" url="~/f/nordic-q-a/83514/spi-slave-configuration-overlay"]xecution enters the same file&amp;nbsp;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;spi_nrfx_spi.c&lt;/span&gt;[/quote]
&lt;p&gt;&lt;br /&gt;I also noticed that, maybe something is wrong with my overlay, my overlay name is &amp;quot;bl653_dvk.overlay&amp;quot; &amp;amp; it is placed in project directory with the configuration as:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;spi1 {
	compatible = &amp;quot;nordic,nrf-spis&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	sck-pin = &amp;lt;41&amp;gt;;
	mosi-pin = &amp;lt;40&amp;gt;;
	miso-pin = &amp;lt;4&amp;gt;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1. I am saying this as I do not see overlay being included, in project dts structure as in below, is the name &lt;span&gt;&amp;quot;bl653_dvk.overlay&amp;quot; proper..?&lt;/span&gt;&lt;br /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1641881719021v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2. In &amp;quot;prj.conf&amp;quot;, I have the following configurations, do I need to add anything more..?&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;#SPI
CONFIG_SPI=y
CONFIG_SPI_ASYNC=y
CONFIG_SPI_SLAVE=y
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kindly suggest where I am mistaken.&lt;/p&gt;
&lt;p&gt;Attaching the bl653_dvk.dts &amp;amp;&amp;nbsp;&lt;span&gt;bl653_dvk.overlay for your reference.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/bl653_5F00_dvk.dts"&gt;devzone.nordicsemi.com/.../bl653_5F00_dvk.dts&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/bl653_5F00_dvk.overlay"&gt;devzone.nordicsemi.com/.../bl653_5F00_dvk.overlay&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Ubaid&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave configuration &amp; overlay</title><link>https://devzone.nordicsemi.com/thread/347008?ContentTypeID=1</link><pubDate>Mon, 10 Jan 2022 17:23:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74fd37d3-7e2a-450e-8522-f599c71d1fc4</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Did you set this?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_SPI_SLAVE=y&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;and&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;.slave = 1 in&amp;nbsp;spi_config ? Snippet:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;static const struct spi_config spi_cfg = {
	.operation = SPI_WORD_SET(8) | SPI_TRANSFER_MSB | SPI_OP_MODE_SLAVE |
		     SPI_MODE_CPOL | SPI_MODE_CPHA,
	.frequency = 4000000,
	.slave = 1,
};&lt;/pre&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Some sample code:&amp;nbsp;&lt;a href="https://github.com/sigurdnev/ncs-playground/blob/master/samples/spis_thread_test/src/main.c"&gt;https://github.com/sigurdnev/ncs-playground/blob/master/samples/spis_thread_test/src/main.c&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>