<?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>Any way to put system into &amp;quot;OFF&amp;quot; state in hard fault handler with SD enabled?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21603/any-way-to-put-system-into-off-state-in-hard-fault-handler-with-sd-enabled</link><description>Long title, but basically sums it up - is there any way to put the nRF51 into the off state from within the hard-fault handler if the soft-device was enabled prior to the fault? The complication is that the soft-device seems to protect the NRF_POWER peripheral</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 24 May 2017 10:30:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21603/any-way-to-put-system-into-off-state-in-hard-fault-handler-with-sd-enabled" /><item><title>RE: Any way to put system into "OFF" state in hard fault handler with SD enabled?</title><link>https://devzone.nordicsemi.com/thread/84809?ContentTypeID=1</link><pubDate>Wed, 24 May 2017 10:30:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:789d7f40-3268-470c-9ddc-bb96e3a7d1de</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;It&amp;#39;s good you found some kind of solution at least. With the current architecture it is challenging to handle hard faults gracefully. The assumption is that this should only happen during development, and in the rare case that it would happen in production a software reset would be sufficient.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Any way to put system into "OFF" state in hard fault handler with SD enabled?</title><link>https://devzone.nordicsemi.com/thread/84808?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 20:58:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86c69fe4-f9a3-4023-88e9-ca78835aca97</guid><dc:creator>MarcF</dc:creator><description>&lt;p&gt;Unfortunately, not really... this was for production code, so I couldn&amp;#39;t just clear UICRs, halt, or use the UART.  I ultimately had to set things to generate an interrupt on WDT, quickly preserve some state in shared RAM between bootloader and application, issue a softreset, and then in the bootloader I check if the WDT is running or not, and if it is, I put the system into OFF and have it wake immediately back up using a GPIO-detect on a signal with a guaranteed state.  It&amp;#39;s not pretty, but it ensures I will always have a clean system on restart, and that shared RAM is preserved through all resets except power-on and pin-reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Any way to put system into "OFF" state in hard fault handler with SD enabled?</title><link>https://devzone.nordicsemi.com/thread/84810?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 07:37:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0c4e4ab-b744-488e-96b4-6924455af8f3</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Did you have any luck with this?&lt;/p&gt;
&lt;p&gt;It should be possible to disable the peripheral protection by erasing the CLENR0 register in the UICR, but it might be better to find some other way to get the information you need, such as halting with the debugger, writing to the UART, or something similar.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Any way to put system into "OFF" state in hard fault handler with SD enabled?</title><link>https://devzone.nordicsemi.com/thread/84804?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2017 13:45:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6969234-e76f-4d33-84a4-90e9fa7b84ea</guid><dc:creator>MarcF</dc:creator><description>&lt;p&gt;For better or worse, the WDT stays active through system resets - only power-on, pin, and wake-from-off will reset/disable the WDT.  So unfortunately, NVIC_SystemReset() won&amp;#39;t help on its own.  I&amp;#39;m experimenting with doing a system reset and then putting the system to sleep on startup if the WDT was running... but it&amp;#39;s not ideal yet.  But it may wind up doing what I need it to do.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Any way to put system into "OFF" state in hard fault handler with SD enabled?</title><link>https://devzone.nordicsemi.com/thread/84807?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2017 10:58:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8bc477c-752e-4fc9-bcc8-aa46ea117353</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Did you try just calling &lt;code&gt;NVIC_SystemReset()&lt;/code&gt; to disable the WDT?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Any way to put system into "OFF" state in hard fault handler with SD enabled?</title><link>https://devzone.nordicsemi.com/thread/84806?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2017 23:55:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8a3ae33-643f-464f-905d-158ba4c8a4cb</guid><dc:creator>MarcF</dc:creator><description>&lt;p&gt;Fair enough... nRF51822, S110v8, SDKv10.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Any way to put system into "OFF" state in hard fault handler with SD enabled?</title><link>https://devzone.nordicsemi.com/thread/84805?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2017 23:49:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8289259e-3302-4776-9dea-f070dbb91370</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Which chip, which softdevice version, the answer (if there is one) will probably be different based on that information.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>