<?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 when accessing different peripherals connected to the same SPI line</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58115/spi-hangs-when-accessing-different-peripherals-connected-to-the-same-spi-line</link><description>I know this may be a duplicate of this: https://devzone.nordicsemi.com/f/nordic-q-a/37732/nrf52840-spi-clock-line-contention-causing-spi-driver-to-hang/145521#145521 
 I say that because my code is hanging in the same line of code. Buy my hardware is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Feb 2020 15:16:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58115/spi-hangs-when-accessing-different-peripherals-connected-to-the-same-spi-line" /><item><title>RE: SPI hangs when accessing different peripherals connected to the same SPI line</title><link>https://devzone.nordicsemi.com/thread/236930?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2020 15:16:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc2a4302-8e64-41cb-9167-6231a00d456f</guid><dc:creator>Jose Cazarin</dc:creator><description>&lt;p&gt;Yes, I don&amp;#39;t have any of this available. One thing that I could do is to use the timer to generate an interrupt and the handler would write to the flash that the configuration is invalid and then reboot the chip, and then it will try to boot up using another set of pins (hopefully the correct one this time). This way I don&amp;#39;t need to change the SDK.&lt;br /&gt;Thanks for the tips!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI hangs when accessing different peripherals connected to the same SPI line</title><link>https://devzone.nordicsemi.com/thread/236578?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2020 13:55:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ddad590-d4c4-4201-9a3a-001e2b78b426</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This is a HW design choice which means that there is limited to what you can do in SW to &amp;quot;fix&amp;quot; this. My guess is that you don&amp;#39;t have any GPIOs that you can control from either the IMU or the ETH chip and use to signalize which peripheral that is connected?&lt;/p&gt;
&lt;p&gt;I still think a timer which forces the application to jump out of the loop and eventually shift the pin configuration and reset would be good enough solution.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI hangs when accessing different peripherals connected to the same SPI line</title><link>https://devzone.nordicsemi.com/thread/236392?ContentTypeID=1</link><pubDate>Tue, 25 Feb 2020 22:17:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:076555ab-2937-4f54-ad55-331755c61f2f</guid><dc:creator>Jose Cazarin</dc:creator><description>&lt;p&gt;I know this shouldn&amp;#39;t happen. What I&amp;#39;m saying is: if the code is expecting to talk with the IMU and you accidentally flash the wrong build on the board, then the pin configuration gets messed up.&lt;br /&gt;Whats happens in this case is:&lt;br /&gt;&lt;br /&gt;Code Side&amp;nbsp; |&amp;nbsp; &amp;nbsp;IMU Side&lt;br /&gt;&lt;br /&gt;CLK Pin&amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp;INT pin&lt;br /&gt;MOSI&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp;INT pin&lt;br /&gt;MISO&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp;INT pin&lt;br /&gt;&amp;nbsp; SS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp;DATA enable pin&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This wrong setup of pins causes the SPI to hang on the first time it tries to read a WHO_AM_I register in the IMU, so I can&amp;#39;t have a firmware solution that could check if the IMU is really present by reading this register and then switching to the correct pin configuration. I wonder if there&amp;#39;s something some kind of configuration in the SDK that would prevent this from happening. I think that the SDK should not let the SPI code hang so &amp;quot;easily&amp;quot; (I know it&amp;#39;s a bit of an overkill because I&amp;#39;m using a completely wrong pin config).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI hangs when accessing different peripherals connected to the same SPI line</title><link>https://devzone.nordicsemi.com/thread/235888?ContentTypeID=1</link><pubDate>Mon, 24 Feb 2020 09:28:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dd5a165-3ba2-4d4f-b17d-6fabe3d3f2e3</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;First, I would like to point out that the slave shouldn&amp;#39;t drive the SCLK line as this should only be done by the master according to the TWI specification. The driver is designed accordingly to the specification which means that if you want it to work in a scenario which doesn&amp;#39;t follow the specification then you would need to modify it. I think your suggestion of using a timer is a valid workaround &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&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></channel></rss>