<?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>Clock Control Configuration Confirmation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119503/clock-control-configuration-confirmation</link><description>Hello, I am utilizing a Laird (now ezurio) bl5340 module on my custom board which requires the internal 13.5pF caps to be set for the high frequency 32Mhz clock source as specified by their datasheet: I have done this by adding the following to my custom</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 07 Mar 2025 11:34:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119503/clock-control-configuration-confirmation" /><item><title>RE: Clock Control Configuration Confirmation</title><link>https://devzone.nordicsemi.com/thread/526335?ContentTypeID=1</link><pubDate>Fri, 07 Mar 2025 11:34:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3688ea4d-78b1-4110-9158-4037056b741f</guid><dc:creator>Bendik Heiskel</dc:creator><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;Apologies for the delay.&lt;/p&gt;
&lt;p&gt;0x40004000 is the base address used in non secure. If you are building for bl5340_dvk_nrf5340_cpuapp you need to use 0x50004000 as the base address .&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Bendik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clock Control Configuration Confirmation</title><link>https://devzone.nordicsemi.com/thread/526066?ContentTypeID=1</link><pubDate>Wed, 05 Mar 2025 21:13:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:976c7524-c201-4eb3-b217-b119b159f99a</guid><dc:creator>blue_dew</dc:creator><description>&lt;p&gt;I&amp;#39;m dumb. I found the base address and offset for the bypass register within the link you posted. Ty again bendik.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I tried:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define NRF_XOSC32KI_BYPASS_REG (*(volatile uint32_t *)(0x40004000UL + 0x6C0UL)) // Register for bypassing the LFCLK crystal oscillator, board dependant and needs to be updated to use the board config to determine base address

static int lfclk_bypass_full_swing(void)
{
 NRF_XOSC32KI_BYPASS_REG = 1;
 return 0;
}

SYS_INIT(lfclk_bypass_full_swing, EARLY,0);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;Unfortunately, this causes the system to hang and I get no output. I need some more guidance here.&amp;nbsp;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clock Control Configuration Confirmation</title><link>https://devzone.nordicsemi.com/thread/526059?ContentTypeID=1</link><pubDate>Wed, 05 Mar 2025 19:12:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9abd4d3-a5b7-461c-92ee-d4e18d78ec02</guid><dc:creator>blue_dew</dc:creator><description>&lt;p&gt;Hey Bendik,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I spoke too soon. That include &amp;lt;nrf.h&amp;gt; file doesn&amp;#39;t define any &amp;quot;NRF&amp;quot; struct. I&amp;#39;m attempting to use ncs 2.9.0. I also don&amp;#39;t see any NRF struct inside of the zephyr/init.h file. The docs linked are helpful for understanding the registers but don&amp;#39;t indicate how I can access or modify them. Please advise.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clock Control Configuration Confirmation</title><link>https://devzone.nordicsemi.com/thread/526035?ContentTypeID=1</link><pubDate>Wed, 05 Mar 2025 15:18:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14eee5fd-aeeb-4758-8795-a6ebeb349e66</guid><dc:creator>blue_dew</dc:creator><description>&lt;p&gt;Thank you so much Bendik! That was very helpful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Clock Control Configuration Confirmation</title><link>https://devzone.nordicsemi.com/thread/526028?ContentTypeID=1</link><pubDate>Wed, 05 Mar 2025 14:54:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4c3712b-83e0-4f32-a22d-a656c87afab1</guid><dc:creator>Bendik Heiskel</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The configuration for the HFXO looks correct.&lt;/p&gt;
[quote user=""]When I look at the bl5340_dvk defconfig file for example, they have the same settings for the HFXO clock, so I think that is right, but that dev kit also uses an external low frequency oscillator, but I don&amp;#39;t see an explicit config for setting the low frequency controller to use the external source.&amp;nbsp;Am I misunderstanding what the &amp;quot;CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y&amp;quot; option does? Is this not required, and does the system automatically know to utilize the external source? [/quote]
&lt;p&gt;&lt;code&gt;CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y&lt;/code&gt; is needed to use the external oscillator source. I assume the development kit for the module doesn&amp;#39;t set this as default since the module doesn&amp;#39;t have the crystal internally.&lt;/p&gt;
[quote user=""]Do I need to set &amp;quot;&lt;span&gt;CONFIG_CLOCK_CONTROL_NRF_K32SRC_20PPM&lt;/span&gt;&lt;span&gt;=y&amp;quot; as that is the lowest option, my source is rated at 5ppm?&lt;/span&gt;[/quote]
&lt;p&gt;Yes, this config is for crystalls/oscillators with 0-20ppm accuracy.&lt;/p&gt;
[quote user=""] I&amp;#39;m assuming I don&amp;#39;t need to set any of the internal LFXO caps due to our rail to rail clock setu[/quote]
&lt;p&gt;It doesn&amp;#39;t hurt to explicitly disable the internal load caps by adding:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_SOC_LFXO_CAP_EXTERNAL=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You also need to set the &lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf5340/page/chapters/oscillators/doc/oscillators.html#ariaid-title9"&gt;XOSC32KI.BYPASS &lt;/a&gt;register, to bypass the LFCLK crystall oscillator when using a rail-to-rail external source.&lt;/p&gt;
&lt;p&gt;This can be done by adding:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;zephyr/init.h&amp;gt;
#include &amp;lt;nrf.h&amp;gt;

static int lfclk_bypass_full_swing(void)
{
	NRF-&amp;gt;OSCILLATORS.XOSC32KI.BYPASS=1;
	return 0;
}

SYS_INIT(lfclk_bypass_full_swing, EARLY,0);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Bendik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>