<?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>nrf52840 SPI clock line contention causing SPI driver to hang</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37732/nrf52840-spi-clock-line-contention-causing-spi-driver-to-hang</link><description>Hello, 
 I encountered an interesting issue with SPI0 on the nrf52840 that I cannot explain. In short, my SPI bus would stop working shortly after communicating with my slave device. After an extensive investigation and trying different pins to use for</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 Aug 2018 18:48:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37732/nrf52840-spi-clock-line-contention-causing-spi-driver-to-hang" /><item><title>RE: nrf52840 SPI clock line contention causing SPI driver to hang</title><link>https://devzone.nordicsemi.com/thread/145572?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 18:48:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb9b3e2b-a915-44af-9e1f-674ce6287427</guid><dc:creator>droberson</dc:creator><description>&lt;p&gt;Thanks for the feedback! I will implement&amp;nbsp;some sort of timer interrupt to power cycle the SPI peripheral in case this happens again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 SPI clock line contention causing SPI driver to hang</title><link>https://devzone.nordicsemi.com/thread/145570?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 18:43:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e90ca2d9-15fb-4535-b5fc-2d8f6bfb4c54</guid><dc:creator>droberson</dc:creator><description>&lt;p&gt;Daniel,&lt;/p&gt;
&lt;p&gt;Unfortunately I do not have captures of my SPI clock waveforms. I was still seeing the clock line toggling but the voltage range was 0V to something small like 50 mV.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 SPI clock line contention causing SPI driver to hang</title><link>https://devzone.nordicsemi.com/thread/145552?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 15:33:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc49bc6e-cb05-47fd-a33d-db07d26eb3dd</guid><dc:creator>awneil</dc:creator><description>[quote userid="73492" url="~/f/nordic-q-a/37732/nrf52840-spi-clock-line-contention-causing-spi-driver-to-hang"]Should there be some sort of safety timeout here?&amp;nbsp;[/quote]
&lt;p&gt;Not really.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In SPI, the Clock line should only ever be driven by the master - never by any slave.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 SPI clock line contention causing SPI driver to hang</title><link>https://devzone.nordicsemi.com/thread/145521?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 12:58:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:970ce955-ccea-49a5-9b8b-ff478b130223</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This is due to internal design. In short:&lt;/p&gt;
&lt;p&gt;The clock line is looped back through the pin to the SPI peripheral to ensure that timing of MISO and MOSI are identical,&amp;nbsp;as a side effect this also means that the internal circuitry&amp;nbsp;will not see the clock if the pin is forced low externally, and thereby &amp;quot;hang&amp;quot; until valid clock is present. I guess a serial resistor on the clock line could solve this and/or start an timer that can timeout and application can power cycle the SPI peripheral to recover.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 SPI clock line contention causing SPI driver to hang</title><link>https://devzone.nordicsemi.com/thread/145389?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2018 22:50:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c674bbed-6309-4df2-bb98-9b037c0f1834</guid><dc:creator>Daniel Sullivan</dc:creator><description>&lt;p&gt;Just a note to add to this: I&amp;#39;ve also had this same issue when using an external SPI display. When the display was connected incorrectly and its own MCU wasn&amp;#39;t booting correctly, it would load the SPI lines in strange ways causing transfers to fail / the driver to stop in the same place.&lt;/p&gt;
&lt;p&gt;droberson: Do you have a logic analyser result you can add to this post? I was finding very long rise times when SPI was being held down by the peripheral.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>