<?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 hangs within RTC CC callback</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23108/spi-hangs-within-rtc-cc-callback</link><description>Hi all, 
 I&amp;#39;m transferring data to and from an Atmel AT25040 NVRAM using SPI, and it works perfectly when run within main(). However, if I run the same code from within an RTC CC callback, the blocking call to nrf_drv_spi_transfer() never returns. </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Jun 2017 13:03:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23108/spi-hangs-within-rtc-cc-callback" /><item><title>RE: SPI hangs within RTC CC callback</title><link>https://devzone.nordicsemi.com/thread/90926?ContentTypeID=1</link><pubDate>Wed, 28 Jun 2017 13:03:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e507803-6abc-4aed-8c5a-ae83b6f56be5</guid><dc:creator>Steve H</dc:creator><description>&lt;p&gt;Thanks again, I&amp;#39;ll look again at my code but it seems to be working OK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI hangs within RTC CC callback</title><link>https://devzone.nordicsemi.com/thread/90928?ContentTypeID=1</link><pubDate>Wed, 28 Jun 2017 12:41:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4da0d604-c658-4317-a251-0643abaf9999</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Either you need different priorities, or you can set a flag in your RTC interrupt, check this flag in your main loop, and then transmit when the flag is set.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI hangs within RTC CC callback</title><link>https://devzone.nordicsemi.com/thread/90927?ContentTypeID=1</link><pubDate>Wed, 28 Jun 2017 11:23:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:138d102e-9a44-459f-9c36-02e49c8b4905</guid><dc:creator>Steve H</dc:creator><description>&lt;p&gt;Thanks, Martin, that seemed to fix it. Are there better ways of implementing this scenario?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI hangs within RTC CC callback</title><link>https://devzone.nordicsemi.com/thread/90925?ContentTypeID=1</link><pubDate>Wed, 28 Jun 2017 11:04:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d10c67c-a995-49fc-a195-ee0c982401ae</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What kind of interrupt priorities do you use? If you are calling a blocking function from within an interrupt it might be that the SPI transfer is waiting for the RTC interrupt to complete. However, this will never happen if you use a blocking nrf_drv_spi_transfer() from within the RTC interrupt itself, because even a blocking nrf_drv_spi_transfer() is waiting for an SPI interrupt, only behind the scenes deep down in the drivers. If you haven&amp;#39;t done so already, can you try to increase the interrupt priority of the SPI driver, to something higher than the RTC interrupt? You can do it in sdk_config.h.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>