<?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>PIN_CNF Sense change state</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89017/pin_cnf-sense-change-state</link><description>Hello, I am developing a custom board based on nRF52832 that should spend most of it&amp;#39;s time in SystemOFF mode. Eventually, it will wake up on an GPIO event caused by the external magnetic switch (LF11115TMR). Now, the switch behaves funny - it retains</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Aug 2022 08:52:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89017/pin_cnf-sense-change-state" /><item><title>RE: PIN_CNF Sense change state</title><link>https://devzone.nordicsemi.com/thread/381495?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2022 08:52:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9ce9968-4c2f-4469-88c4-f26a30028628</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you are entering system off mode while the debug session is active, you&amp;#39;re in &amp;quot;emulated system off&amp;quot;, where it is strongly recommended that you add a loop after the systemoff call, as explained here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=4_2_0_17_1_0#unique_1150026639"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=4_2_0_17_1_0#unique_1150026639&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you tried setting a pull-resistor before flipping&amp;nbsp;the sense orientation?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PIN_CNF Sense change state</title><link>https://devzone.nordicsemi.com/thread/381439?ContentTypeID=1</link><pubDate>Sat, 13 Aug 2022 16:32:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:faff254d-f029-4a10-a8da-b82c10565100</guid><dc:creator>Pero Krivic</dc:creator><description>&lt;p&gt;Hello Hakon, after 2 months, I am back on this issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am working in the debug mode, but I dont get any assert.. It is my understanding that debugger doesn&amp;#39;t let me go into the &lt;span&gt;SYSTEMOFF, so I cant really see what is actually going on in&amp;nbsp;SYSTEMOFF, can I?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But, for the sake of investigation, I have commented out the line&amp;nbsp;&amp;nbsp;sd_power_system_off(); and observed the above described isue, that .SENSE gets inverted.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PIN_CNF Sense change state</title><link>https://devzone.nordicsemi.com/thread/373672?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 11:56:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:092aa51c-bbda-4a0b-ae34-08140b49c9c0</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sounds like mcuboot is consuming your event.&lt;/p&gt;
&lt;p&gt;Try to disable CONFIG_GPIO in mcuboot. This can be done by creating the folder my_project/child_image/&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And in the child_image catalog, you create the file &amp;quot;mcuboot.conf&amp;quot; holding:&lt;/p&gt;
&lt;p&gt;CONFIG_GPIO=n&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PIN_CNF Sense change state</title><link>https://devzone.nordicsemi.com/thread/373563?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2022 04:36:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:939d3175-a53a-460b-9667-7f6b0bf73d39</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;Thanks Hakon.&amp;nbsp; That explains the start up delay.&amp;nbsp; I think I can work around that with my SYS_INIT approach.&lt;/p&gt;
&lt;p&gt;Looks like my issue with the LATCH register is related to having the following in my proj.config&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BOOTLOADER_MCUBOOT&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;With that enabled, I will get LATCH reset if I have a second GPIO trigger within the 400msec start up period, even if I disable all inputs within my SYS_INIT function.&amp;nbsp; Without that in my proj.config, things seem to run as I would like them to - the first GPIO will trigger the device out of System OFF and any subsequent ones are just ignored.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;I have the&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;CONFIG_BOOTLOADER_MCUBOOT&lt;/span&gt;&lt;span&gt;=y in my proj.config because in my end applicaiton, I want to implement OTA DFU, and it was indicated in the example code that was required.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Are you able to explain why that is impacting the LATCH register, but not the RESETREAS register, and whether there is a way to fix it and still be able to do OTA DFU?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Mike&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PIN_CNF Sense change state</title><link>https://devzone.nordicsemi.com/thread/373231?ContentTypeID=1</link><pubDate>Mon, 20 Jun 2022 12:26:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa8da3d5-79ce-40ab-a2ba-37a207de5572</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You seem to be using NCS, based on the defines that you mention. When booting up, it requires the LFCLK source to run, which can take several 100 ms to start up.&lt;/p&gt;
&lt;p&gt;This will occur before main() is entered, and you&amp;#39;ve mitigated this issue by configuring your GPIOs in PRE_KERNEL, which is the preferred solution.&lt;/p&gt;
&lt;p&gt;Regarding LATCH issues, there are certain erratum&amp;#39;s related to this that you should be aware of:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev3/ERR/nRF52832/Rev3/latest/anomaly_832_173.html#anomaly_832_173"&gt;https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev3/ERR/nRF52832/Rev3/latest/anomaly_832_173.html#anomaly_832_173&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev3/ERR/nRF52832/Rev3/latest/anomaly_832_210.html#anomaly_832_210"&gt;https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev3/ERR/nRF52832/Rev3/latest/anomaly_832_210.html#anomaly_832_210&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That being mentioned, if you have an on-going thread, please use this thread to continue discussing your specific scenario.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PIN_CNF Sense change state</title><link>https://devzone.nordicsemi.com/thread/373226?ContentTypeID=1</link><pubDate>Mon, 20 Jun 2022 12:19:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81f60109-6bc3-45ae-b74d-11fb180cdd99</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;the nrfx_gpiote port event is setup to simulate edge triggering with a level triggered hardware signal.&lt;/p&gt;
&lt;p&gt;It therefore uses the cpu to invert the .SENSE field to be able to provide an event when input signal occurs and when it goes back to idle state.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In the SYSTEMOFF scenario, we have to differentiate between a wake-up scenario and a interrupt scenario.&lt;/p&gt;
&lt;p&gt;All pins with SENSE configured with either HIGH or LOW can generate a wake-up scenario from SYSTEMOFF, regardless of if the GPIOTE PORT event is enabled or not.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you fear that you&amp;#39;re getting interrupted while executing code in sleep_mode_enter, I would recommend that you wrap around the sensitive code and disable the GPIOTE&amp;nbsp;IRQ before configuring and entering SystemOFF.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]My system either goes to sleep like everything&amp;#39;s fine or it ends up in an infinite reset loop hell.[/quote]
&lt;p&gt;This is more concerning. Is this due to an assert upon wakeup?&lt;/p&gt;
&lt;p&gt;Have you tried to add the preprocessor symbol &amp;quot;DEBUG&amp;quot; to see where you assert?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PIN_CNF Sense change state</title><link>https://devzone.nordicsemi.com/thread/373125?ContentTypeID=1</link><pubDate>Sun, 19 Jun 2022 23:14:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92ad3e1e-cd03-4d20-a4ba-3754a77bf8df</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;I suspect we are encountering similar problems.&amp;nbsp; Unfortunately I&amp;#39;ve not yet come up with the answer!&lt;/p&gt;
&lt;p&gt;I&amp;#39;m also working on a project with the nRF52832 spending most of its time in System OFF.&amp;nbsp; In mine, I have one of three different GPIO configured to trigger the device out of sleep mode. I then check the status of RESETREAS and LATCH, to determine what caused the exit from System Off (GPIO, NFC, harware reset etc) and in the case of a GPIO trigger, which GPIO caused it (via LATCH)&lt;/p&gt;
&lt;p&gt;I&amp;#39;m having two issues, which I am not sure if they are related:&lt;/p&gt;
&lt;p&gt;1.&amp;nbsp; There is upwards of a 500msec delay between my GPIO triggering, and my main.c code starting up.&amp;nbsp; Still working with the Nordic engineers on why this is, but I would be interested to see if you have something similar going on.&amp;nbsp; I just measure this by toggling a GPIO as the first thing I do in my code, then measuring the time between the GPIO trigger and this GPIO toggle on my scope&lt;/p&gt;
&lt;p&gt;2. If I get a second GPIO trigger in this 500msec period, it seems to reset my chip again, and I lose the contents of the LATCH register.&amp;nbsp; The RESETREAS register remains valid, but LATCH ends up getting reset to 0, which means I can&amp;#39;t determine which GPIO caused the exit from System OFF.&amp;nbsp; I&amp;#39;ve even tried having a SYS_INIT call in PRE_KERNEL_2, where I make a change to the PIN_CNF[x] register for the appropriate GPIO, using&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;NRF_GPIO&lt;/span&gt;&lt;span&gt;-&amp;gt;PIN_CNF[x&lt;/span&gt;&lt;span&gt;] &amp;amp;= &lt;/span&gt;&lt;span&gt;0x02&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;so that I am disabling any influence these GPIO might have on the DETECT signal as early as possible.&amp;nbsp; That code gets run within the first 200-400usec of the GPIO trigger, when my trigger signal is still in the active state.&amp;nbsp; But its still not resolving my &amp;quot;sets LATCH to 0&amp;quot; problem.&lt;/p&gt;
&lt;p&gt;Sorry I&amp;#39;m not helping solve your issue, but between what I am doing, and what you are doing, we might collectively get to the bottom of it!&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>