<?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>Flash write with softdevice during assert handler</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68256/flash-write-with-softdevice-during-assert-handler</link><description>Hi, 
 I need to write a 32-bit value to an NVM flash page whenever my code hits an assert failure. This failure can occur anywhere in the code - my application, the Nordic SDK, the softdevice, etc. I&amp;#39;m using SDK16, the S140 softdevice and FreeRTOS. I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 20 Nov 2020 15:09:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68256/flash-write-with-softdevice-during-assert-handler" /><item><title>RE: Flash write with softdevice during assert handler</title><link>https://devzone.nordicsemi.com/thread/281152?ContentTypeID=1</link><pubDate>Fri, 20 Nov 2020 15:09:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e266a40-1e66-47f8-b2a3-94824c52abb5</guid><dc:creator>Brian</dc:creator><description>&lt;p&gt;Hi Dmitry,&lt;/p&gt;
&lt;p&gt;Thanks for details on what you did to solve this issue.&amp;nbsp; I&amp;#39;ve done the same thing and it&amp;#39;s working well so far.&lt;/p&gt;
&lt;p&gt;Brian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flash write with softdevice during assert handler</title><link>https://devzone.nordicsemi.com/thread/279591?ContentTypeID=1</link><pubDate>Wed, 11 Nov 2020 20:49:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c73efb6-37c0-44c5-9397-797356912e71</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;Hi Brian,&lt;/p&gt;
&lt;p&gt;I did the same trick for assert/hardfault logging in our firmware.&amp;nbsp;As you have pointed out, you can&amp;#39;t rely on state of any module, softdevice, RAM, or even stack pointer. Ensure that you&amp;#39;re writing to an empty area, so that&amp;#39;s no need to perform erase. Disable interrupts, set SP to known location, stop all peripherals that can do EDMA requests in your fw, then use direct access to NVMC, wait for completion and make a CPU reset. With softdevice, you may need to disable MWU, see &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/53248/disable-softdevice-sandboxing-in-fault-handler"&gt;my ticket&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>