<?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>hangs at nrf_fstorage_erase(). (debug shows -&amp;gt; Unknown function at 0x00000978)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51452/hangs-at-nrf_fstorage_erase-debug-shows---unknown-function-at-0x00000978</link><description>So I am trying to store a few configuration parameters in flash. I am using nrf_fstorage for that. so before storing the parameters, I am erasing the flash but, it hangs at &amp;quot; return (p_fs-&amp;gt;p_api)-&amp;gt;erase(p_fs, page_addr, len, p_context); &amp;quot; in nrf_fstorage_erase</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 19 Sep 2019 13:05:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51452/hangs-at-nrf_fstorage_erase-debug-shows---unknown-function-at-0x00000978" /><item><title>RE: hangs at nrf_fstorage_erase(). (debug shows -&gt; Unknown function at 0x00000978)</title><link>https://devzone.nordicsemi.com/thread/210717?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2019 13:05:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86f387f8-6636-4ed7-bab1-ac4bc816c7b3</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure. It would be very helpful if we could reproduce it. Would you like to share the project with us? I can make the case private.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is fstorage_erase() called from an interrupt?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The SD APIs cannot be called from an interrupt with higher priority than the SV itself&lt;/p&gt;
&lt;p&gt;https://devzone.nordicsemi.com/f/nordic-q-a/32684/hardfault-on-an-sd_ble_gatts_hvx-call-in-sdk-14-2-0&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hangs at nrf_fstorage_erase(). (debug shows -&gt; Unknown function at 0x00000978)</title><link>https://devzone.nordicsemi.com/thread/210337?ContentTypeID=1</link><pubDate>Wed, 18 Sep 2019 09:46:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52129d49-f663-4b20-aeba-e838cc339954</guid><dc:creator>prithvi25</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1568799175291v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1568799218107v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1568799261640v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;So in the 3rd image after &amp;quot;blx r4&amp;quot;, in the next step, it goes to some random location, shown below&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1568799432932v4.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;and after that, it goes to HardFault Handler&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is the Section Placement Macros&lt;br /&gt;&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1568799570872v5.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And initialisation&lt;br /&gt;&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1568799649340v6.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1568799670629v7.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1568799951264v8.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hangs at nrf_fstorage_erase(). (debug shows -&gt; Unknown function at 0x00000978)</title><link>https://devzone.nordicsemi.com/thread/210139?ContentTypeID=1</link><pubDate>Tue, 17 Sep 2019 13:06:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d80612b-dde5-4b65-9dea-7a8f15c01c51</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You could check the value of the &lt;strong&gt;&amp;nbsp;(p_fs-&amp;gt;p_api)-&amp;gt;erase &lt;/strong&gt;function pointer to see if it&amp;#39;s in a valid range and try to single step in debug mode to see if the program goes into the backend code or directly to the hardfault.&lt;/p&gt;
&lt;p&gt;I have seen some cases where the function pointer is not initialized correctly because of invalid project settings.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Which page are you erasing?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hangs at nrf_fstorage_erase(). (debug shows -&gt; Unknown function at 0x00000978)</title><link>https://devzone.nordicsemi.com/thread/209588?ContentTypeID=1</link><pubDate>Fri, 13 Sep 2019 10:19:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56c937a0-908f-4eb7-af2f-a41cbbbd87d4</guid><dc:creator>prithvi25</dc:creator><description>&lt;p&gt;RAM_START=0x20002a98&lt;br /&gt;&lt;br /&gt;No, the&amp;nbsp;&lt;span&gt;APP timer&amp;nbsp;does not have a higher IRQ priority than the SoftDevice.&lt;br /&gt;&lt;br /&gt;using&amp;nbsp;s140_nrf52_6.1.0_softdevice (SOFTDEVICE).&lt;br /&gt;&lt;br /&gt;Not able to generate debug log with hardfault.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hangs at nrf_fstorage_erase(). (debug shows -&gt; Unknown function at 0x00000978)</title><link>https://devzone.nordicsemi.com/thread/206853?ContentTypeID=1</link><pubDate>Thu, 29 Aug 2019 11:50:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f594cf6-ea09-40f7-b615-f716634f9bda</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;Unfortunately, 0x978 is the HardFault handler of the MBR. The HardFault handler of the MBR will invoke the HardFault handler at&amp;nbsp;&lt;span&gt;0x2635E, which in turn should invoke the HardFault handler of the application.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;So this could indicate that the bootloader is jumping to an address that is not the reset handler of the application, but to a random address, which triggers a HardFault. It is difficult to say what the cause is without being able to step through the code myself.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Could you provide the debug log with hardfault?&amp;nbsp; Please see Vidar&amp;#39;s comments in&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/41376/debug-mode-is-not-working-in-segger-embedded-studio/"&gt;this post&lt;/a&gt;&amp;nbsp;on how to do that.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Which SDK/SoftDevice are you using?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you take a look at&lt;/span&gt;&lt;a href="https://stackoverflow.com/questions/53253652/debugging-a-hard-fault-in-arm-cortex-m4"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;this page&lt;/a&gt;&lt;span&gt;&amp;nbsp;on StackOverflow?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Are you running the APP timer with a higher IRQ priority than the SoftDevice?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What is your setting of&amp;nbsp;RAM_PH_START?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please also see &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/50825/hardfault-debug"&gt;this post&lt;/a&gt;&amp;nbsp;that might help.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hangs at nrf_fstorage_erase(). (debug shows -&gt; Unknown function at 0x00000978)</title><link>https://devzone.nordicsemi.com/thread/206747?ContentTypeID=1</link><pubDate>Thu, 29 Aug 2019 05:52:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ddcb167-7ea3-4ce2-9112-da6e019e191e</guid><dc:creator>prithvi25</dc:creator><description>&lt;p&gt;And if I continue execution and then pause it (in Debug mode), it goes to HardFault_Handler&lt;br /&gt;&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1567057919391v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hangs at nrf_fstorage_erase(). (debug shows -&gt; Unknown function at 0x00000978)</title><link>https://devzone.nordicsemi.com/thread/206746?ContentTypeID=1</link><pubDate>Thu, 29 Aug 2019 05:49:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:064c5d74-c3cd-45c2-acab-9fbcc7491501</guid><dc:creator>prithvi25</dc:creator><description>&lt;p&gt;I went through that thread.&lt;br /&gt;so after&amp;nbsp;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;strong&gt;return (p_fs-&amp;gt;p_api)-&amp;gt;erase(p_fs, page_addr, len, p_context);&lt;/strong&gt;&lt;span&gt;&amp;quot; in nrf_fstorage_erase() it shows &lt;strong&gt;BusFault.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1567057680299v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So what should I do next?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hangs at nrf_fstorage_erase(). (debug shows -&gt; Unknown function at 0x00000978)</title><link>https://devzone.nordicsemi.com/thread/206642?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2019 13:20:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af62697c-5196-44dd-a32e-4fcd5c3930a9</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Could you try to use the&amp;nbsp;&lt;/span&gt;&lt;a title="HardFault handling library" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/lib_hardfault.html?cp=4_0_0_3_20"&gt;HardFault handling library&lt;/a&gt;&lt;span&gt;&amp;nbsp;to determine the cause of the Hardfault? As&amp;nbsp;&lt;/span&gt;my colleague explained in this&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/50769/bug-unable-to-fix-as-going-to-unknown-function-0x00000978"&gt;thread&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hangs at nrf_fstorage_erase(). (debug shows -&gt; Unknown function at 0x00000978)</title><link>https://devzone.nordicsemi.com/thread/206603?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2019 11:39:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b834e3ad-524d-48dd-b920-fd1abfc9ae6c</guid><dc:creator>prithvi25</dc:creator><description>&lt;p&gt;I checked it. I have not used any delay API in my project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hangs at nrf_fstorage_erase(). (debug shows -&gt; Unknown function at 0x00000978)</title><link>https://devzone.nordicsemi.com/thread/206597?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2019 11:29:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aea17056-d709-48ec-b62c-06f07261efde</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you use nrf_delay in the project? If so, is it possible to replace with non-blocking delay?&lt;/p&gt;
&lt;p lang="nb-NO"&gt;Please see a similar case&amp;nbsp;that might help you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>