<?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 SPIM3, HFCLK, and anomaly 244</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81293/nrf52840-spim3-hfclk-and-anomaly-244</link><description>We&amp;#39;re working on a board with an nRF52840 running BLE with softdevice S140 and SDK 17. The board has an external SPI flash, and when we realized that SPIM3 can be run at higher speeds than the other SPIM instances, we thought we&amp;#39;d use that to speed up</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 02 Nov 2021 11:21:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81293/nrf52840-spim3-hfclk-and-anomaly-244" /><item><title>RE: nRF52840 SPIM3, HFCLK, and anomaly 244</title><link>https://devzone.nordicsemi.com/thread/337051?ContentTypeID=1</link><pubDate>Tue, 02 Nov 2021 11:21:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52d39119-7498-4cea-99ff-1404a2ac2520</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi there!&lt;/p&gt;
[quote user=""]We&amp;#39;re not using it in QSPI mode but I bet that it applied to non-QSPI SPIM3 too, and I think I was right. Now when we prepare to do any SPIM3 transfer, we call sd_clock_hfclk_is_running() to see if HFCLK is &amp;quot;running&amp;quot; (which I think actually means it&amp;#39;s using HFXO), and if it&amp;#39;s not running, we call sd_clock_hfclk_request(). This seems to have fixed the issue, but I just wanted to make sure I&amp;#39;m approaching the workaround correctly.[/quote]
&lt;p&gt;This&amp;nbsp;is a reasonable conclusion, and I would say that manually enabling the HFXO seems like the correct workaround for your case. I have seen cases where other peripherals which use the HFXO are affected by the switching due to the Softdevice. In these cases I usually recommend starting the HFXO manually as in this case.&amp;nbsp;&lt;span style="font-family:inherit;"&gt;Forcing HFXO to be ON will indeed consume a considerable higher current, which is why we suggest turning it OFF after the peripheral is done using it.&lt;/span&gt;&lt;/p&gt;
[quote user=""]Should we call sd_clock_hfclk_release() at the end of SPI activity, or might we be interrupting some other process that needs HFCLK?[/quote]
&lt;p&gt;If you&amp;#39;re only using the Softdevice then it&amp;#39;s ok to just call sd_clock_hfclk_release(). If some parts of your application is already using the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/hardware_driver_clock.html"&gt;CLOCK &lt;/a&gt;driver then you should use that API instead.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>