<?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 interrupt and RTC</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29827/spi-interrupt-and-rtc</link><description>I&amp;#39;m using the SPI driver and experiencing a hang in the SPI driver because the SPI interrupt is not raised. The reason is in this code from the driver: 
 p_cb-&amp;gt;bytes_transferred = 0;
nrf_spi_int_disable(p_spi, NRF_SPI_INT_READY_MASK);

nrf_spi_event_clear</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 30 Jan 2018 09:13:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29827/spi-interrupt-and-rtc" /><item><title>RE: SPI interrupt and RTC</title><link>https://devzone.nordicsemi.com/thread/118508?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2018 09:13:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:576f6416-a95a-4c04-ae82-7dd03a9a4b6d</guid><dc:creator>Jonathan</dc:creator><description>&lt;p&gt;Hi, yes I did. I moved the interrupt enabling to just before the TXD setting part. Are you using mBed? The problem on my end was the mBed timer that took the execution from the SPI code.&lt;/p&gt;
&lt;p&gt;Another option for me was to switch the mBed driver to use the DMA version of the SPI driver. But that would require more of an effort.&lt;/p&gt;
&lt;p&gt;Do you know what&amp;#39;s causing the problem in your code? We used our nRF52 emulator to figure out what&amp;#39;s disrupting the SPI code. If you&amp;#39;re interested in trying it out, just contact yaniv@jumper.io. It really helped us solve things quickly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI interrupt and RTC</title><link>https://devzone.nordicsemi.com/thread/118507?ContentTypeID=1</link><pubDate>Mon, 29 Jan 2018 22:00:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07e74fab-ac19-469a-9ce8-f8899c2619f8</guid><dc:creator>Hein</dc:creator><description>&lt;p&gt;Jonathan, did you manage to get this figured out in the end ? I have a similar problem with the same piece of code at the moment.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI interrupt and RTC</title><link>https://devzone.nordicsemi.com/thread/118506?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2018 15:50:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f382fad-92db-43a8-96f9-0022b188c081</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;If the RTC handling is executed in the main context/idle loop, this should not preempt the operation you are doing when starting the SPI transfer. This is an issue you will face in all priority-based systems, and it is up to you if it is necessary to implement safety measures if the situation you describe occur. In general it is a good idea to avoid time-consuming tasks in interrupt tasks, to aboid blocking other operations.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI interrupt and RTC</title><link>https://devzone.nordicsemi.com/thread/118505?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2018 20:12:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25879576-bbd9-47f1-baf5-b19b33c89cac</guid><dc:creator>Jonathan</dc:creator><description>&lt;p&gt;I&amp;#39;m using mbed so the RTC is rather time consuming but it&amp;#39;s a part of mbed&amp;#39;s idle loop. They&amp;#39;re also using the non-DMA version of the SPI driver. Sorry for leaving the mbed detail out, guess it&amp;#39;s important.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI interrupt and RTC</title><link>https://devzone.nordicsemi.com/thread/118504?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2018 15:41:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a366b8b5-96e3-48ff-b9a7-27b799fd365b</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Do you mean that the SPI is done transferring already when you enable the interrupt? Are you doing something time-consuming in the RTC handler, since you are experiencing this issue? You could manually check if the NRF_SPI_EVENT_READY event is set when you enable interrupts, to handle cases like this. Is there any reason you are not using the SPIM peripheral (SPI with EasyDMA support) if you are using nRF52832 (as your tags indicate that you do)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>