<?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 while loop stuck</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15362/spi-while-loop-stuck</link><description>Hello !
I am trying to read WHO_AM_I register from a LSM9DS1 IMU.
I have spi_update_imu_data() as my callback for when the spi transfer completes and inside it I make spi_xfer_done=true.
Inside a timer_timeout_handler, I first call nrf_drv_spi_transfer</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Jul 2016 09:02:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15362/spi-while-loop-stuck" /><item><title>RE: spi while loop stuck</title><link>https://devzone.nordicsemi.com/thread/58699?ContentTypeID=1</link><pubDate>Wed, 27 Jul 2016 09:02:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60e3426c-bf0e-40f7-9b6a-f746f852e237</guid><dc:creator>Robert</dc:creator><description>&lt;p&gt;ok, got it. I will now look more into interrupt levels, priorities etc. Thanks a lot !!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: spi while loop stuck</title><link>https://devzone.nordicsemi.com/thread/58700?ContentTypeID=1</link><pubDate>Tue, 26 Jul 2016 15:01:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03cf9b26-f92b-419e-bc01-60f57ba95fb8</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;is the &lt;code&gt;while(!spi_xfer_done){spi_xfer_done = false;}&lt;/code&gt; inside the timeout handler? If that is the case and spi interrupt and timeout handler are running at the same interrupt level (will do that by default) then you are waiting on one interrupt to happen from another interrupt at the same level, which means that you will wait forever.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>