<?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>NCS 3.2.1 LPCOMP init failed (NCS 3.2.1, nrfx 4.0.1)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/127122/ncs-3-2-1-lpcomp-init-failed-ncs-3-2-1-nrfx-4-0-1</link><description>Hi everyone, 
 
 For mthe prject I&amp;#39;m working I must use the LPCOMP module to detect a cross. but anytime a init the LPCOMP module my code seems to freeze and nothing else happen. So it put a check inside and my code just loop since the init is never true</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 25 Feb 2026 11:37:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/127122/ncs-3-2-1-lpcomp-init-failed-ncs-3-2-1-nrfx-4-0-1" /><item><title>RE: NCS 3.2.1 LPCOMP init failed (NCS 3.2.1, nrfx 4.0.1)</title><link>https://devzone.nordicsemi.com/thread/562023?ContentTypeID=1</link><pubDate>Wed, 25 Feb 2026 11:37:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2937731c-c694-494f-a07e-cf480f3952b9</guid><dc:creator>S MOUNZEO</dc:creator><description>&lt;p&gt;It&amp;#39;s working fine, I guess i just got some dead pins on my board.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot for your support&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS 3.2.1 LPCOMP init failed (NCS 3.2.1, nrfx 4.0.1)</title><link>https://devzone.nordicsemi.com/thread/562019?ContentTypeID=1</link><pubDate>Wed, 25 Feb 2026 10:29:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffdbf0cc-f6d3-4507-9f8f-69d256212179</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;span&gt;comp_trigger_pin is a regular GPIO output that I connected to the Comparator input to trigger th&amp;nbsp;comparator threshold event. How are you triggering the comparator when you are not using this trigger signal?&lt;/span&gt;&lt;/p&gt;
[quote userid="139199" url="~/f/nordic-q-a/127122/ncs-3-2-1-lpcomp-init-failed-ncs-3-2-1-nrfx-4-0-1/562016"]it seems that if&amp;nbsp;I connect &amp;quot;&lt;span&gt;comp_trigger_pin&amp;quot; to any Pin of Port 1 ( any of the AIN pins) t&lt;/span&gt;[/quote]
&lt;p&gt;&lt;span&gt;You must connect it to the AIN pin you&amp;#39;ve assigned to the&amp;nbsp;comparator. I used AIN4 (P1.11) in my sample.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS 3.2.1 LPCOMP init failed (NCS 3.2.1, nrfx 4.0.1)</title><link>https://devzone.nordicsemi.com/thread/562016?ContentTypeID=1</link><pubDate>Wed, 25 Feb 2026 10:15:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1024bbb3-3990-4518-a4c8-404c0681d5e3</guid><dc:creator>S MOUNZEO</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I ru the sample abnd it works well, but it seems that if&amp;nbsp;I connect &amp;quot;&lt;span&gt;comp_trigger_pin&amp;quot; to any Pin of Port 1 ( any of the AIN pins) the comparator don&amp;#39;t wokr anymore. Can you please check taht behaviour from your side.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS 3.2.1 LPCOMP init failed (NCS 3.2.1, nrfx 4.0.1)</title><link>https://devzone.nordicsemi.com/thread/561916?ContentTypeID=1</link><pubDate>Tue, 24 Feb 2026 09:05:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe6dd9ce-a69b-4af9-bdfa-72d9e63b17c6</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I was not able&amp;nbsp;to reproduce this here. I made a small test project to confirm that the callback gets called, please see attached. I connected the &amp;quot;comp_trigger_pin&amp;quot; to the comparator input to periodically trigger the callback. Please try to run this sample on your end and see if you get the same result.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2100.lpcomp_5F00_test.zip"&gt;devzone.nordicsemi.com/.../2100.lpcomp_5F00_test.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS 3.2.1 LPCOMP init failed (NCS 3.2.1, nrfx 4.0.1)</title><link>https://devzone.nordicsemi.com/thread/561871?ContentTypeID=1</link><pubDate>Mon, 23 Feb 2026 15:35:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebb987b9-ab52-4bd3-b810-97719fe2c0e6</guid><dc:creator>S MOUNZEO</dc:creator><description>&lt;p&gt;HI &lt;a href="https://devzone.nordicsemi.com/members/vibe"&gt;Vidar Berg&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I implement the zephyr comparator but the callback is never called. here is my code&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;comp {	
	status = &amp;quot;okay&amp;quot;;
	psel = &amp;lt;3&amp;gt;;
	refsel = &amp;quot;VDD_9_16&amp;quot;;
	compatible = &amp;quot;nordic,nrf-lpcomp&amp;quot;;
	enable-hyst;
};


static void lpcomp_callback(const struct device *dev, void *user_data)
{
	int val = comparator_get_output(lpcomp);
	nrf_gpio_pin_toggle(SbgGpio2);
	gpio_pin_set_dt(&amp;amp;ledds5, val);
	printk(&amp;quot;Comparator output value %d\n&amp;quot;, val);
}

//Init comp
comparator_set_trigger(lpcomp, COMPARATOR_TRIGGER_BOTH_EDGES);
comparator_set_trigger_callback(lpcomp, lpcomp_callback, NULL);



&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS 3.2.1 LPCOMP init failed (NCS 3.2.1, nrfx 4.0.1)</title><link>https://devzone.nordicsemi.com/thread/561835?ContentTypeID=1</link><pubDate>Mon, 23 Feb 2026 13:12:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f0a6475-1c0f-4d3f-a803-1824187c553a</guid><dc:creator>S MOUNZEO</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/vibe"&gt;Vidar Berg&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m working on a custom boards so I&amp;#39;m&amp;nbsp; not able correctly debug my code and see what&amp;#39;s are the returned errors.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m trying the Zephyr comparator drvier and keep you in touch.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS 3.2.1 LPCOMP init failed (NCS 3.2.1, nrfx 4.0.1)</title><link>https://devzone.nordicsemi.com/thread/561828?ContentTypeID=1</link><pubDate>Mon, 23 Feb 2026 12:53:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0877d620-2684-42fe-a08b-020f84fa6ef4</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Are you able to step through the&amp;nbsp;nrfx_lpcomp_init() with your debugger to see where the error gets returned? I would also recommend you consider using the Zephyr comparator driver. It is used as a wakep source in this sample :&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/commit/ae05388943072019f8ea0697f2eeffee5922a737"&gt;https://github.com/nrfconnect/sdk-zephyr/commit/ae05388943072019f8ea0697f2eeffee5922a737&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>