<?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>MCU crashes due to TWI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35375/mcu-crashes-due-to-twi</link><description>Hello, 
 
 I am having a trouble with my code. There is an RTC sensor Which has the address 0x32. When the sensor is connected to the TWI lines, there is no problem and it works perfect. When I disconnect the sensor, the MCU crashes and &amp;quot;app_error_fault_handler</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Jun 2018 14:24:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35375/mcu-crashes-due-to-twi" /><item><title>RE: MCU crashes due to TWI</title><link>https://devzone.nordicsemi.com/thread/136790?ContentTypeID=1</link><pubDate>Tue, 19 Jun 2018 14:24:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a16d17e9-1728-4491-abe7-6817f03358cc</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Enkavak,&lt;/p&gt;
&lt;p&gt;Well, one suggestion is that you could search if something is on the TWI address&amp;nbsp;0x32 (&lt;em&gt;use the&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Ftwi_scanner_example.html&amp;amp;cp=4_0_0_4_5_41" target="_blank" rel="noopener noreferrer"&gt; twi scanner&lt;/a&gt; as reference)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If not, then do not use the TWI.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;From your RTT output:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Set a breakpoint at line 27 in rtc.c file and &lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/" target="_blank" rel="noopener noreferrer"&gt;debug&lt;/a&gt; the code and check the call stack to see what functions directs you into the error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU crashes due to TWI</title><link>https://devzone.nordicsemi.com/thread/136771?ContentTypeID=1</link><pubDate>Tue, 19 Jun 2018 13:29:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8720dec-0ff7-4e7f-9fcf-e4e2828d829f</guid><dc:creator>enkavak</dc:creator><description>&lt;p&gt;&lt;span&gt;RTT&amp;nbsp;Response&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;0&amp;gt; &amp;lt;info&amp;gt; app: Debug logging for UART over RTT started.&lt;br /&gt; 0&amp;gt; &amp;lt;error&amp;gt; app: ERROR 33281 [NRF_ERROR_DRV_TWI_ERR_ANACK] at E:\Yedek\nRF5_SDK\examples\ble_peripheral\ble_app_uart\rtc.c:27&lt;br /&gt; 0&amp;gt; PC at: 0x00034FED&lt;br /&gt; 0&amp;gt; &amp;lt;error&amp;gt; app: End of error report&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU crashes due to TWI</title><link>https://devzone.nordicsemi.com/thread/136766?ContentTypeID=1</link><pubDate>Tue, 19 Jun 2018 13:19:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:084d61c1-6a0a-4c07-b4d9-cbe21bf3b9cf</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Enkavak,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here is the documentation for &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Flib_nrf_log.html&amp;amp;cp=4_0_0_3_26" target="_blank" rel="noopener noreferrer"&gt;how to use the logger module.&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In short, you should enable it in &amp;quot;sdk_config.h&amp;quot;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;//==========================================================
// &amp;lt;e&amp;gt; NRF_LOG_ENABLED - Logging module for nRF5 SDK
//==========================================================
#ifndef NRF_LOG_ENABLED
#define NRF_LOG_ENABLED 1
#endif&lt;/pre&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;//==========================================================
// &amp;lt;e&amp;gt; NRF_LOG_BACKEND_RTT_ENABLED - nrf_log_backend_rtt - Log RTT backend
//==========================================================
#ifndef NRF_LOG_BACKEND_RTT_ENABLED
#define NRF_LOG_BACKEND_RTT_ENABLED 1
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then open &amp;quot;J-Link RTT viewer&amp;quot; and chose these settings:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-25ce4bf5040c4148a3f62c3c7fb95160/pastedimage1529412946324v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Then you should be able to see info messages in the terminal:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-25ce4bf5040c4148a3f62c3c7fb95160/pastedimage1529412994295v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;A trick to get more information from your application is to increase the &lt;em&gt;&amp;quot;severity level&amp;quot;&amp;nbsp;&lt;/em&gt;in &amp;quot;sdk_config.h&amp;quot; to &lt;span style="background-color:#ffff99;"&gt;4&lt;/span&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
// &amp;lt;o&amp;gt; NRF_LOG_DEFAULT_LEVEL  - Default Severity level
 
// &amp;lt;0=&amp;gt; Off 
// &amp;lt;1=&amp;gt; Error 
// &amp;lt;2=&amp;gt; Warning 
// &amp;lt;3=&amp;gt; Info 
// &amp;lt;4=&amp;gt; Debug 

#ifndef NRF_LOG_DEFAULT_LEVEL
#define NRF_LOG_DEFAULT_LEVEL 4
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Please try to enable RTT and see if you get out any logs that can be helpful.&lt;/p&gt;
&lt;p&gt;Also make sure that you follow these &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/10729/my-device-is-freezing-and-restarting"&gt;tips.&lt;/a&gt;&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: MCU crashes due to TWI</title><link>https://devzone.nordicsemi.com/thread/136652?ContentTypeID=1</link><pubDate>Tue, 19 Jun 2018 07:09:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39b0b6dc-d60f-44ce-8fd3-f2ee89a65818</guid><dc:creator>enkavak</dc:creator><description>&lt;p&gt;Hello I set a break point in the error handler and I get the result below.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2500.Untitled.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I do not want to use twi_handler.&lt;/p&gt;
&lt;p&gt;I enabled the&amp;nbsp;&lt;span&gt;RTT viewer. However I get nothing. It is not working. Is there a document about How tou use&amp;nbsp;RTT viewer&amp;nbsp;?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCU crashes due to TWI</title><link>https://devzone.nordicsemi.com/thread/136073?ContentTypeID=1</link><pubDate>Thu, 14 Jun 2018 07:57:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3ac872b-7e59-4708-b3ad-745d7bcadad9</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hello Enkavak,&lt;/p&gt;
&lt;p&gt;Could you &lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/" target="_blank" rel="noopener noreferrer"&gt;debug your code and set a breakpoint in the error handler&lt;/a&gt;? (&lt;em&gt;it would be really helpful to see what causes this error)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;You should also turn on RTT logging in &amp;quot;sdk_config.h&amp;quot; and run RTT viewer (&lt;em&gt;if you haven&amp;#39;t).&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;//==========================================================
// &amp;lt;e&amp;gt; NRF_LOG_BACKEND_RTT_ENABLED - nrf_log_backend_rtt - Log RTT backend
//==========================================================
#ifndef NRF_LOG_BACKEND_RTT_ENABLED
#define NRF_LOG_BACKEND_RTT_ENABLED 1
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Are you using&amp;nbsp;the newest &lt;a href="http://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/" target="_blank" rel="noopener noreferrer"&gt;SDKv15&lt;/a&gt;, I highly recommend that you check out the &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Ftwi_sensor_example.html&amp;amp;cp=4_0_0_4_5_42" target="_blank" rel="noopener noreferrer"&gt;TWI Sensor example&lt;/a&gt;&amp;nbsp;and use that as reference.&lt;/p&gt;
&lt;p&gt;- why do you choose to not have a &amp;quot;twi_handler&amp;quot; in in &lt;em&gt;nrf_drv_twi_init()?&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>