<?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>app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36178/app_error_fault_handler-called-with-pc-at-0x128a0</link><description>Given this error handler function... 
 
 and this logging from it with the Segger attached... 
 
 how do I debug this? 
 I presume the info passed in is bogus and just points to some random part of memory. 
 75936 is 0x128A0 and that&amp;#39;s in the soft device</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 Aug 2018 08:56:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36178/app_error_fault_handler-called-with-pc-at-0x128a0" /><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/145451?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 08:56:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2baa34cd-9d7d-4c9d-acf5-b9799f6fdbfc</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Thanks. Let us continue in the other case.&lt;/p&gt;
&lt;p&gt;Martin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/145384?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2018 20:36:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0c1eb34-2f7e-4f46-8b5f-7fa47445d71a</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Thanks Martin.&lt;/p&gt;
&lt;p&gt;1.&amp;nbsp;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;SPI_DEFAULT_CONFIG_IRQ_PRIORITY&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;6&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. We have 13 timers configured across 8 modules, all using APP_TIMER_DEF(), app_timer_*(), etc.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3. Not directly. The only thing I can think of that we do that would cause a flash operation is bonding, and it happens only once, in general, for the lifetime of the device.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;4. Never directly in our code. I haven&amp;#39;t read all the SDK sources we link in to see&amp;nbsp;whether SDK code we call&amp;nbsp;does this.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;5. Sure, but it&amp;#39;s too much to link here so I&amp;#39;ve uploaded it in case ID&amp;nbsp;212717.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/144919?ContentTypeID=1</link><pubDate>Mon, 20 Aug 2018 11:34:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f068f9c-b3cf-4d8a-a5df-c7622fee53ac</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry for the slow response. I have been on holiday for a couple of weeks.&amp;nbsp;Have you made any progress?&lt;/p&gt;
&lt;p&gt;Just a short recap: As mentioned before your assert indicates that something is messing with the mechanisms that the Softdevice uses to keep time. To keep time, the Softdevice uses RTC0 and TIMER0 and both peripherals use interrupts that run in priority 0 (highest). So the question is how your application is able to disrupt these timing critical things? It could be one of two root causes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;An inaccurate clock causes the nRF52&amp;#39;s time to tick too slow or fast relative to the rest of the world. Since you are using prefabricated modules and are able to reproduce it on more than one device I find this option unlikely.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Something in your application is messing with the Softdevice&amp;#39;s RTC and Timer interrupts, preventing the them from being executed on time.&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Some questions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;What interrupt priority is your SPI running at?&lt;/li&gt;
&lt;li&gt;What timers are you using?&lt;/li&gt;
&lt;li&gt;Are&amp;nbsp;you doing&amp;nbsp;flash operations in your application?&lt;/li&gt;
&lt;li&gt;Are you at any point disabling interrupts to execute time critical code? (some drivers and libraries in the SDK do this under the hood)&lt;/li&gt;
&lt;li&gt;Do you mind uploading your code?&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/144032?ContentTypeID=1</link><pubDate>Tue, 14 Aug 2018 01:29:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67dc4036-5b0c-476b-a861-8f66ca9e65e1</guid><dc:creator>Austin</dc:creator><description>&lt;p&gt;It&amp;#39;s really up to you which approach you take.&amp;nbsp; My preference would be to use the latest SDK possible as there are often many improvements and bug fixes in comparison to prior releases.&amp;nbsp; If you already have devices in production then this may not be feasible.&lt;/p&gt;
&lt;p&gt;If you have a generally stable product apart from this issue, perhaps it would be a good idea to patch your SDK 14 with the updated logger frontend to first verify if this is in fact the issue you&amp;#39;re facing.&amp;nbsp; I haven&amp;#39;t looked at the differences between SDK 14 and 14.2 so I&amp;#39;m not sure if there were other changes related to logging which may impact this patch.&amp;nbsp; From memory, my logger frontend change was applicable to SDK 14.2.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/144031?ContentTypeID=1</link><pubDate>Tue, 14 Aug 2018 01:20:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:234f9c8a-4231-4675-a090-b96991cce3f2</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;OK, I had in mind to migrate to SDK 14.2 pretty soon anyway, before I implement DFU OTA. Should I do that, patch the logger frontend with your patch, then do a load of testing again?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/144027?ContentTypeID=1</link><pubDate>Mon, 13 Aug 2018 23:17:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d2394eb-3ad5-4a8c-8e86-14069f866745</guid><dc:creator>Austin</dc:creator><description>&lt;p&gt;It appears you&amp;#39;re using SDK14.&amp;nbsp; If you haven&amp;#39;t already, have a look at the known issues list at&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/29796/what-are-sdk-14-x-0-known-issues/"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/29796/what-are-sdk-14-x-0-known-issues/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I had a number of issues with SDK14 related to logging using Segger RTT, especially with the use of APP_LOG_PUSH.&amp;nbsp; The following thread&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/29103/nrf_log-fixes-in-sdk14-1-0"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/29103/nrf_log-fixes-in-sdk14-1-0&lt;/a&gt;&amp;nbsp;describes some of these issues.&amp;nbsp; The accepted answer addresses some bugs with the logging module, but if you scroll down to my answer you will find a suggested nrf_log_frontend.c implementation which addresses a larger set of issues.&lt;/p&gt;
&lt;p&gt;You could try to induce your issue quicker by increasing the amount of logging.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/143821?ContentTypeID=1</link><pubDate>Sun, 12 Aug 2018 19:51:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bc51f17-52e9-44ff-960b-409335d5081f</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Hi Martin, I&amp;#39;ve been able to repro this on a second device. What do we do now?&lt;/p&gt;
&lt;p&gt;Never mind the issue with the RAM log, it was a bug in my logging implementation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/140365?ContentTypeID=1</link><pubDate>Tue, 17 Jul 2018 10:22:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d86e7c92-7b99-47d7-9158-b4906c692186</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Agreed, I don&amp;#39;t understand why the last part of the RAM looks uninitialised. I&amp;#39;ll do some more testing on the circular buffer.&lt;/p&gt;
&lt;p&gt;Nope, I still can&amp;#39;t reliably repro this, even on the first device, so getting it to repro on the second will be a long shot. Will keep testing with the same firmware.&lt;/p&gt;
&lt;p&gt;No problem. Let&amp;#39;s pick it up when you&amp;#39;re back, but it may help if I add the code for the in-RAM log backend to a case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/140363?ContentTypeID=1</link><pubDate>Tue, 17 Jul 2018 10:02:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c6304f8-b62b-49f8-a935-349bab067b81</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Thank you.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In your last log, one could say that the last part of the RAM just looks like random/uninitialized portions for memory. But you say that you are using a circular buffer and that, since there is no init stuff at the beginning, the buffer has already &amp;quot;circled around&amp;quot; at least once. So how come the last part of RAM looks so random if it has actually been used? Just a rhetorical question, but it is sort of contradictory isn&amp;#39;t it?&lt;/p&gt;
&lt;p&gt;Did you have any success replicating the first issue on a second device?&lt;/p&gt;
&lt;p&gt;PS: I&amp;#39;ll be on holiday until next Tuesday. As it is holiday season in Norway it is not certain that any of my colleagues will have time to pick up the case in the meantime.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/140293?ContentTypeID=1</link><pubDate>Mon, 16 Jul 2018 21:21:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a757b2a0-1f2d-4bcc-9202-27dbbaa0c68a</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Sure, added above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/140173?ContentTypeID=1</link><pubDate>Mon, 16 Jul 2018 08:48:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bc9d842-6953-4918-90ac-6aa5e7162ac1</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Can you upload the code that shows how you handle the Softdevice assert and logging?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/140107?ContentTypeID=1</link><pubDate>Fri, 13 Jul 2018 22:23:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52180681-d425-483d-b68e-9ac47a165533</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Added some example logs above. I have code that assures me my retained RAM is working. In a brown out, I&amp;#39;d expect to lose the in-RAM log, but I&amp;#39;d also expect the Nordic to then reset and continue logging again from the top of my log memory region, but that&amp;#39;s not what I&amp;#39;m seeing in the last log above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/140096?ContentTypeID=1</link><pubDate>Fri, 13 Jul 2018 16:27:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b213b6f7-8cf7-4c03-a975-7d644416ef39</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Can you elaborate on what you mean by &amp;quot;the log just stops&amp;quot;? Do you get any information at all or is it all lost?&lt;/p&gt;
&lt;p&gt;As you can see in &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=2_1_0_17_7#unique_832471788"&gt;this table&lt;/a&gt;, the RAM doesn&amp;#39;t survive all reset types. System resets as triggered in the error handler should be fine, but you will lose the content on a brown out for example.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/139681?ContentTypeID=1</link><pubDate>Wed, 11 Jul 2018 07:53:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67837fa4-fab5-496f-8571-957959311521</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;It&amp;#39;s a&amp;nbsp;Wisol SFM20R1 and uses the Nordic nRF52832 variant AAB0. I have one other surviving prototype board on which I can test, but it&amp;#39;ll take a while because I can&amp;#39;t repro this reliably even on the first board.&lt;/p&gt;
&lt;p&gt;Any thoughts on the error logging issue? Can I send you the complete code for that, in a case?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/139673?ContentTypeID=1</link><pubDate>Wed, 11 Jul 2018 07:27:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41b19b61-259b-402f-86a3-88c3efcfc7bd</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Do you have more than one module that you can try? Maybe this one particular module is an outlier with a broken crystal or bad solder joint or something causing the clock to run inaccurately. If the issue occurs on all modules on the other hand, I would be more inclined towards a firmware issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What is the serial number of the module?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/139642?ContentTypeID=1</link><pubDate>Tue, 10 Jul 2018 21:00:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b60dbace-2644-471f-8f94-0da42f48a7ba</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;In that case I may be wrong about not being in a connection. I&amp;#39;m only ever in one connection at a time but I do a lot of logging stuff over a characteristic a bit like the Nordic UART service&amp;#39;s RX characteristic (notify only). I don&amp;#39;t know if that would have the radio busy enough to hit this, but I guess it&amp;#39;s possible. I don&amp;#39;t use the timeslot API.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using a module from Wisol so I haven&amp;#39;t chosen the crystal myself. I could ask them what they used.&lt;/p&gt;
&lt;p&gt;It would help if I could get reliable logging in my&amp;nbsp;app_error_fault_handler() function. At the moment I really only know this is happening on the desk because the debugger breaks in the error handler. In the field, I&amp;#39;d expect to see the same error logging in my in-memory log as I do in the gdb client, but instead the log just stops. My in-memory log is in retained RAM, so it survives a reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/139531?ContentTypeID=1</link><pubDate>Tue, 10 Jul 2018 08:48:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a8cd558-7386-4ca5-918c-2953b7a9b6db</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks. I found the source of the assert. The Softdevice includes what we call a Radio Event Manager (REM), and an assert at 0x128A0 is the REM warning you that a radio event has overstayed its planned duration. This is more likely to happen in complex applications where you have multiple concurrent BLE links, have multiple radio protocols running concurrently, or are using the Timeslot API to allocate time slots to time sensitive peripheral operations. You say that you are not in a connection and just advertising, but do you use the timeslot API? Any other time sensitive things going on at the time?&lt;/p&gt;
&lt;p&gt;Another possibility is that your clock is not accurate enough. If you are not doing anything timecritical as discussed above this possibility might be more likely. It could e.g. be that your crystal is incorrectly loaded. Are you using a custom device or a development kit?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/139477?ContentTypeID=1</link><pubDate>Mon, 09 Jul 2018 22:28:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56f18a87-fb14-4c57-b453-22041b286e5a</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NORDIC_SDK_ROOT := $(HOME)/dev/nRF5_SDK_14.0.0_3bcc1f7

SOFTDEVICE = $(NORDIC_SDK_ROOT)/components/softdevice/s132/hex/s132_nrf52_5.0.0_softdevice.hex
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve seen it about four times in the last month, but I can&amp;#39;t reliably repro it. Happy to send the hex file if it helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler() called with PC at 0x128A0</title><link>https://devzone.nordicsemi.com/thread/139410?ContentTypeID=1</link><pubDate>Mon, 09 Jul 2018 12:06:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecbc3201-2a82-41d9-a104-323f47fc131c</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;That is pretty strange. If you give me the version number of your Softdevice I can take a look under the hood and see&amp;nbsp;what goes on at that specific address.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How frequently does it occur?&lt;/p&gt;
&lt;p&gt;And what SDK are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>