<?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>It looks like &amp;quot;SPI event handler&amp;quot; is not processed when we control slave select pin manually</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67233/it-looks-like-spi-event-handler-is-not-processed-when-we-control-slave-select-pin-manually</link><description>Hi, 
 we have interfaced Accelerometer Module with NRF52832 using SPI Communication. Psuedo code of code snippet is : 
 &amp;lt;&amp;lt;Place the snippet here&amp;gt;&amp;gt; Expected : After nrf_spi_transfer with accelerometer 1. spi event handler is processed 2. SPIXferdone flasg</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 19 Oct 2020 07:50:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67233/it-looks-like-spi-event-handler-is-not-processed-when-we-control-slave-select-pin-manually" /><item><title>RE: It looks like "SPI event handler" is not processed when we control slave select pin manually</title><link>https://devzone.nordicsemi.com/thread/275500?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2020 07:50:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7896d1ef-1996-427f-9813-d97537d9ee07</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Where do you initialize the spi driver?&lt;/li&gt;
&lt;li&gt;Could you check what the init function returns?&lt;/li&gt;
&lt;li&gt;Do you see any activity on the SPI lines?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: It looks like "SPI event handler" is not processed when we control slave select pin manually</title><link>https://devzone.nordicsemi.com/thread/275397?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 13:40:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd457157-270b-4155-a4e6-baea785b081d</guid><dc:creator>SRINI</dc:creator><description>&lt;div&gt;
&lt;div&gt;Jared, &lt;br /&gt; Thanks for the response.&lt;br /&gt; Sorry for missed portion of code.&lt;br /&gt; code snippet is:&lt;br /&gt; &lt;strong&gt;SPI Event Handler:&lt;/strong&gt;&lt;br /&gt; void spi_event_handler(nrf_drv_spi_evt_t const * p_event, void *p_context)&lt;br /&gt; {&lt;br /&gt; SpiXferDone = true;&lt;br /&gt; }&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;strong&gt;Application Code:&lt;/strong&gt;&lt;br /&gt; SpiXferDone = false;&lt;br /&gt; acc_cs_low();&lt;br /&gt; nrf_drv_spi_transfer();&lt;br /&gt; while (!SpiXferDone) &lt;br /&gt; { &lt;br /&gt; printf(&amp;quot;spi transfer is in progress&amp;quot;); &lt;br /&gt; }&lt;br /&gt; based on above snippet, &lt;br /&gt; &lt;strong&gt;Expected:&lt;/strong&gt;&lt;br /&gt; After nrf_spi_transfer with accelerometer&lt;br /&gt; 1. spi event handler is processed&lt;br /&gt; 2. SPIXferdone flag is set to true&lt;br /&gt; 3. Come out from while loop&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;strong&gt;Actual:&lt;/strong&gt;&lt;br /&gt; Entered into while loop &lt;br /&gt; but Struggled in while loop&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;strong&gt;Observation:&lt;/strong&gt;&lt;br /&gt; It looks like spi event handler is not processed. &lt;br /&gt; so SPIXferdone not updated to true and Struggled in while loop&lt;br /&gt; Please guide us.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: It looks like "SPI event handler" is not processed when we control slave select pin manually</title><link>https://devzone.nordicsemi.com/thread/275250?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 06:59:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d30bfe86-bb78-4769-bbdc-c14122e625f6</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote userid="94362" url="~/f/nordic-q-a/67233/it-looks-like-spi-event-handler-is-not-processed-when-we-control-slave-select-pin-manually/275036#275036"]&lt;div&gt;&lt;div&gt;&lt;div&gt;SpiXferDone = true;&lt;br /&gt; }&lt;/div&gt;
&lt;/div&gt;
acc_cs_low();
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;nrf_drv_spi_transfer()&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;while (!SpiXferDone) { printf(&amp;quot;spi transfer is in progress&amp;quot;); }&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;acc_cs_high();&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I assume that the snippet you shared is what&amp;#39;s&amp;nbsp;being done in main(). Is the application actually entering the while loop? As you&amp;#39;ve shared it will not enter it because&amp;nbsp;&lt;/span&gt;&lt;span&gt;SpiXferDone is not false initially, unless you set it to false in acc_cs_low(). It would be much easier to help you if you actually shared your code.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jared&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: It looks like "SPI event handler" is not processed when we control slave select pin manually</title><link>https://devzone.nordicsemi.com/thread/275036?ContentTypeID=1</link><pubDate>Thu, 15 Oct 2020 10:41:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:756008b2-6394-419b-b8a2-9b079a48e4e9</guid><dc:creator>SRINI</dc:creator><description>&lt;div class="author header thread-starter"&gt;
&lt;div class="avatar"&gt;&lt;a href="https://devzone.nordicsemi.com/members/srini"&gt;&lt;img alt="SRINI" border="0" src="https://devzone.nordicsemi.com/cfs-filesystemfile/__key/communityserver-components-imagefileviewer/system-images/anonymous.gif_2D00_32x32x2.png?_=637367231342356575" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;span class="post-date"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="content"&gt;
&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;we have interfaced Accelerometer Module with NRF52832 using SPI Communication.&lt;br /&gt;Psuedo code of code snippet is :&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;SpiXferDone = true;&lt;br /&gt; }&lt;/div&gt;
&lt;/div&gt;
acc_cs_low();
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;nrf_drv_spi_transfer()&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;while (!SpiXferDone) { printf(&amp;quot;spi transfer is in progress&amp;quot;); }&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;acc_cs_high();&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Expected&lt;/strong&gt;:&lt;br /&gt;After nrf_spi_transfer with accelerometer&lt;br /&gt;1. spi event handler is processed&lt;br /&gt;2. SPIXferdone flasg set to true&lt;br /&gt;3. Come out from while loop&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Actual&lt;/strong&gt;:&lt;br /&gt;Struggled in while loop&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Observation&lt;/strong&gt;:&lt;br /&gt;It looks like SPI event handler is not processed.&lt;br /&gt;so SPIXferdone not updated to true and Struggled in while loop&lt;/p&gt;
&lt;p&gt;Please guide me what was the cause of issue&lt;/p&gt;
&lt;p&gt;Please guide us&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>