<?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>Identifying different types of UART errors</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66853/identifying-different-types-of-uart-errors</link><description>I read here... 
 NRF52840_PS_v1.1.pdf Peripherals &amp;gt; UART (6.33.7) 
 “An ERROR event, in the form of a framing error, will be generated if a valid stop bit is not detected in a frame. Another ERROR event, in the form of a break condition, will be generated</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 09 Oct 2020 08:58:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66853/identifying-different-types-of-uart-errors" /><item><title>RE: Identifying different types of UART errors</title><link>https://devzone.nordicsemi.com/thread/273959?ContentTypeID=1</link><pubDate>Fri, 09 Oct 2020 08:58:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c1f4c77-2da6-458c-b35a-00f3c8895e96</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="nordev"]Thanks so much for your reply.[/quote]
&lt;p&gt;No problem at all, I am happy to help!&lt;/p&gt;
[quote user="nordev"]I have these log-related preprocessor defines:[/quote]
&lt;p&gt;Thank for clarifying! For future reference, it would be easier if you share the contents of the sdk_config file, instead of copying / screenshotting select parts.&lt;/p&gt;
[quote user="nordev"]&lt;p&gt;The errors don&amp;#39;t impede other app function (e.g. I can still&amp;nbsp;establish a BLE connection just fine), so it isn&amp;#39;t a problem in that sense. But &lt;strong&gt;I just want to have the capability to investigate what is causing them.&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For ex: What does error_mask = &lt;span&gt;0x00000004 mean?&amp;nbsp; &lt;strong&gt;Can you tell me how to find the error codes in the code?&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;[/quote][quote user="nordev"]What does that mean that it is missing? Should I type it in directly?[/quote]
&lt;p&gt;Yes, you may add it directly there, please do this, and see if you then get a more detailed error message output to your log.&lt;/p&gt;
[quote user="nordev"]Interestingly, the app usually starts out OK with no errors, and&amp;nbsp;at some point later&amp;nbsp;the flood starts happening. I timed it a few&amp;nbsp;times to see how long after pressing &amp;quot;start&amp;quot; on the debugger the error flood started -- on different occasions, it was 55s, 1m12s, 7m27s, 40s -- so you can see it varies.[/quote][quote user="nordev"]Can you also please answer my question 1-3 from the original message?[/quote]
&lt;p&gt;I think there might be some confusion / double-crossing here between the UART driver, and the serial port library..&lt;br /&gt;Could you verify for me whether you are looking to use the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__nrfx__uart.html"&gt;UART driver&lt;/a&gt; or&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__app__uart.html"&gt; library&lt;/a&gt;, or the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_serial.html"&gt;serial port library&lt;/a&gt;? Please note that the serial port library is more complex, and requires more to make work, than the UART driver and/or library. The Serial port library is also legacy as of SDK v.17. Which SDK version are you using, by the way?&lt;br /&gt;Your original ticket text leads me to believe you are looking to use the UART peripheral with the UART driver / library, but all your included code points to the serial port library instead.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user="nordev"]Note -- the DEBUG statement in this code snippet never prints out[/quote]
&lt;p&gt;What is your LOG level set to, are you sure that you are writing out DEBUG logs?&amp;nbsp;&lt;/p&gt;
[quote user="nordev"]I do have &lt;strong&gt;APP_ERROR_CHECK&lt;/strong&gt; everywhere, except not for gpio operations. i.e. I don&amp;#39;t do APP_ERROR_CHECK after nrf_gpio_cfg_input() etc.[/quote]
&lt;p&gt;Great! No need for APP_ERROR_CHECKS for functions that do not return anything, that is fine.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Identifying different types of UART errors</title><link>https://devzone.nordicsemi.com/thread/273864?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 18:58:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db372e9d-2a0b-47dd-8774-013de9c845a5</guid><dc:creator>nordev</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;Thanks so much for your reply. I have these log-related preprocessor defines:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;#define NRF_LOG_DEFERRED 0&lt;/span&gt;&lt;span style="font-weight:400;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight:400;"&gt;#define NRF_LOG_BACKEND_RTT_ENABLED 1&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-weight:400;"&gt;#define NRF_LOG_ENABLED 1&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1602181377337v1.png" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I believe 4 is debug.&lt;/p&gt;
&lt;p&gt;But DEBUG is not here (see screenshot):&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1602183413508v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What does that mean that it is missing? Should I type it in directly?&amp;nbsp;&lt;/strong&gt;I have never added anything to this list directly&lt;/p&gt;
&lt;p&gt;----------------------------------------------------------------------------------------&lt;/p&gt;
&lt;p&gt;The error I see is just this, over and over again in a constant flood:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1602181701914v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The code that logs the errors is as follows:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void serial_event_handler(struct nrf_serial_s const * p_serial, nrf_serial_event_t event)
{
	switch (event)
	{
	...
	
	case NRF_SERIAL_EVENT_DRV_ERR:
		NRF_LOG_ERROR(&amp;quot;NRF_SERIAL_EVENT_DRV_ERROR&amp;quot;);
		break;
	}
	
	...
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Interestingly, the app usually starts out OK with no errors, and&amp;nbsp;at some point later&amp;nbsp;the flood starts happening. I timed it a few&amp;nbsp;times to see how long after pressing &amp;quot;start&amp;quot; on the debugger the error flood started -- on different occasions, it was 55s, 1m12s, 7m27s, 40s -- so you can see it varies.&lt;/p&gt;
&lt;p&gt;I do have &lt;strong&gt;APP_ERROR_CHECK&lt;/strong&gt; everywhere, except not for gpio operations. i.e. I don&amp;#39;t do APP_ERROR_CHECK after nrf_gpio_cfg_input() etc.&lt;/p&gt;
&lt;p&gt;EX, here&amp;nbsp; is some relevant code:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1602182589617v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Note -- the DEBUG statement in this code snippet never prints out, so it seems like ever time I call nrf_serial_write, I get NRF_SUCCESS.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The errors don&amp;#39;t impede other app function (e.g. I can still&amp;nbsp;establish a BLE connection just fine), so it isn&amp;#39;t a problem in that sense. But &lt;strong&gt;I just want to have the capability to investigate what is causing them.&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For ex: What does error_mask = &lt;span&gt;0x00000004 mean?&amp;nbsp; &lt;strong&gt;Can you tell me how to find the error codes in the code?&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Can you also please answer my question 1-3 from the original message?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Identifying different types of UART errors</title><link>https://devzone.nordicsemi.com/thread/273768?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 13:17:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9f8808e-b6b5-493f-9326-38ad4749d8e4</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;Generally, I would like to know all the different things that trigger &lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;NRF_SERIAL_EVENT_DRV_ERR, &lt;br /&gt;because I am getting a lot of these errors and I would like to figure out the specific source of these errors in order to troubleshoot them. &lt;/span&gt;&lt;/strong&gt;[/quote]
&lt;p&gt;I am sorry to hear that you are facing so many unknown errors.&lt;br /&gt;Could you confirm for me that you have DEBUG defined in your preprocessor defines, and that all calls to Nordic SDK Functions that returns error codes are passed to an APP_ERROR_CHECK?&lt;br /&gt;The following image shows how you may check to see that DEBUG is defined:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/5531.enabling_5F00_debug_5F00_SES.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;If you have DEBUG defined, and make sure to pass the returned error codes to an APP_ERROR_CHECK, then - in the case of an error != NRF_SUCCESS - a the particular error and returning function will be outputted to the log, before the application is reset.&lt;br /&gt;Please check to see if you have done these things, and if you have, please share the message that is output to the logger.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Looking forward to resolving these issues together!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>