<?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>nRF51822: extract line number and file name from app_error_fault_handler</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96615/nrf51822-extract-line-number-and-file-name-from-app_error_fault_handler</link><description>Hello, guys! 
 We are using nRF51822 SoC with nRF5 SDK v12.3.0 and s130 SoftDevice. For the devices in the wild, we would like to implement the following health monitoring strategy: 
 
 Detect when the fault events happen (e.g. HardFaults, App Error Faults</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 13 Feb 2023 17:21:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96615/nrf51822-extract-line-number-and-file-name-from-app_error_fault_handler" /><item><title>RE: nRF51822: extract line number and file name from app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/409690?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 17:21:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9696e40a-f185-4cde-808b-c454b866b81e</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="bojan"]Is that possible?[/quote]
&lt;p&gt;No, info is just a pointer(RAM location) where you can find&amp;nbsp;p_file_name and&amp;nbsp;line_num stored. You need to &amp;quot;decode&amp;quot; it on-chip, and send &lt;span&gt;file_name&amp;nbsp;and&amp;nbsp;line_num, instead of info.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822: extract line number and file name from app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/409687?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 17:07:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7673df7c-92bd-4ccd-acc5-df16699fcca3</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;No. &lt;/p&gt;
&lt;p&gt;Every device in the field should catch the &lt;span style="background-color:rgba(204, 255, 204, 1);"&gt;&lt;em&gt;&lt;strong&gt;id&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt; and &lt;span style="background-color:rgba(204, 255, 204, 1);"&gt;&lt;strong&gt;&lt;em&gt;info&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt; parameters of the app error fault and send those two over BLE to the smartphone/Server.&lt;/p&gt;
&lt;p&gt;Then, on the Server side, I would like to somehow be able to get the line number and file name based on &lt;span style="background-color:rgba(204, 255, 204, 1);"&gt;&lt;em&gt;&lt;strong&gt;id&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt; and &lt;span style="background-color:rgba(204, 255, 204, 1);"&gt;&lt;strong&gt;&lt;em&gt;info&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt; parameters. Is that possible?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822: extract line number and file name from app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/409685?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 17:03:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4fa0fe4b-932c-4c43-a286-3232de0d0982</guid><dc:creator>Sigurd</dc:creator><description>[quote user="bojan"]Now that we know the &lt;span style="background-color:rgba(204, 255, 204, 1);"&gt;&lt;em&gt;&lt;strong&gt;id&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt; and &lt;span style="background-color:rgba(204, 255, 204, 1);"&gt;&lt;strong&gt;&lt;em&gt;info&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt; parameters on the Server side, how we can figure out the line number and the file name of the app error that caused the restart?[/quote]
&lt;p&gt;Not sure I understand...You send&amp;nbsp;the&amp;nbsp;&lt;span&gt;file_name&amp;nbsp;and line the error occurred&amp;nbsp;on to the other device, so you can read it there(?)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822: extract line number and file name from app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/409684?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 16:31:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6164932c-ab08-481b-8e7a-75a5e3c52cac</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hi, &lt;a href="https://devzone.nordicsemi.com/members/sigurdon"&gt;Sigurd&lt;/a&gt; . &lt;/p&gt;
&lt;p&gt;We can extract the line number and file name locally by applying the code you shared with us.&lt;/p&gt;
&lt;p&gt;My question relates to the devices in the field. Imagine a scenario when some device restarts due to the app error fault. We are gonna:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Get the &lt;span style="background-color:rgba(204, 255, 204, 1);"&gt;&lt;em&gt;&lt;strong&gt;id&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt; and &lt;span style="background-color:rgba(204, 255, 204, 1);"&gt;&lt;strong&gt;&lt;em&gt;info&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt; parameters with the &lt;span style="background-color:rgba(255, 153, 204, 1);"&gt;&lt;em&gt;&lt;strong&gt;app_error_fault_handler()&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt; and the device will restart.&lt;/li&gt;
&lt;li&gt;Once the device reboots and the BLE connection establishes, we are gonna transfer the &lt;span style="background-color:rgba(204, 255, 204, 1);"&gt;&lt;em&gt;&lt;strong&gt;id&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt; and &lt;span style="background-color:rgba(204, 255, 204, 1);"&gt;&lt;strong&gt;&lt;em&gt;info&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt; parameters to the Server.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now that we know the &lt;span style="background-color:rgba(204, 255, 204, 1);"&gt;&lt;em&gt;&lt;strong&gt;id&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt; and &lt;span style="background-color:rgba(204, 255, 204, 1);"&gt;&lt;strong&gt;&lt;em&gt;info&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt; parameters on the Server side, how we can figure out the line number and the file name of the app error that caused the restart?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Bojan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822: extract line number and file name from app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/409597?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 13:14:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2699a3db-275f-4d98-a70b-0b9131c6c952</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The code in&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/95743/nrf51822-getting-instruction-address-from-the-fault-handlers/405263"&gt;RE: nRF51822: Getting instruction address from the fault handlers&lt;/a&gt;&amp;nbsp;shows how the line_num,p_file_name and and&amp;nbsp;err_code is stored in&amp;nbsp;m_error_data. But not all type of of errors have this information, e.g. hardfault.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>