<?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>J-Link RTT Viewer application receives logs with high latency</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64055/j-link-rtt-viewer-application-receives-logs-with-high-latency</link><description>When I open J-Link RTT Viewer application to see logs of a program with set CONFIG_LOG_BACKEND_RTT , then I see logs&amp;#39; output with some delay, comparing to logs of the same program with set CONFIG_LOG_BACKEND_UART . As I understand RTT, there&amp;#39;s an allocated</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 Jul 2020 12:27:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64055/j-link-rtt-viewer-application-receives-logs-with-high-latency" /><item><title>RE: J-Link RTT Viewer application receives logs with high latency</title><link>https://devzone.nordicsemi.com/thread/261777?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2020 12:27:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e95a930d-0a33-41b0-9494-5c55b35cf779</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Unfortunately, you cannot log immediately when using bluetooth, as this will introduce interrupt latency (and thus; might affect the runtime behavior of the BLE stack):&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/subsys/bluetooth/common/dummy.c#L32-L40"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/master/subsys/bluetooth/common/dummy.c#L32-L40&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you only using printk() to get your logging output, and do not rely on the LOG module? If yes, then you can disable LOG (CONFIG_LOG=n), then use RTT for printk() operations. This shall be printed without a scheduler in the background.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: J-Link RTT Viewer application receives logs with high latency</title><link>https://devzone.nordicsemi.com/thread/261624?ContentTypeID=1</link><pubDate>Fri, 24 Jul 2020 14:05:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:739bfb46-9928-4be2-b5eb-0891c4468ea9</guid><dc:creator>RAlexeev</dc:creator><description>&lt;p&gt;Thank you, Simon, for suggestions. I tried to set an option CONFIG_LOG_IMMEDIATE&lt;/p&gt;
&lt;p&gt;In the case of nRF52840 DK it didn&amp;#39;t work because of assertion error:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/CONFIG_5F00_LOG_5F00_IMMEDIATE_5F00_error.txt"&gt;devzone.nordicsemi.com/.../CONFIG_5F00_LOG_5F00_IMMEDIATE_5F00_error.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;In the case of nRF5340 PDK I didn&amp;#39;t notice any differences in log output speed with CONFIG_LOG_IMMEDIATE or without this option. The same output of printk() function to UART works about immediately, but I see the same log output in J-Link RTT Viewer after a significant delay.&lt;br /&gt;&lt;br /&gt;I will read the recommended blogs and try again to cope with slow log output speed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: J-Link RTT Viewer application receives logs with high latency</title><link>https://devzone.nordicsemi.com/thread/261611?ContentTypeID=1</link><pubDate>Fri, 24 Jul 2020 12:53:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd7c7c6c-3b4f-4c87-9b2c-85d35f54ad64</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;If you want faster logging/processing you could enable &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/CONFIG_LOG_IMMEDIATE.html"&gt;CONFIG_LOG_IMMEDIATE&lt;/a&gt;, however, it has some impacts on the performance:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;It impacts performance of the system since time consuming operations are performed in the context of the log entry (e.g. high priority interrupt).&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;These blogs may also be insightful:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://foundries.io/insights/2018/07/24/zephyr-logging-part-1/"&gt;https://foundries.io/insights/2018/07/24/zephyr-logging-part-1/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://foundries.io/insights/2018/08/14/zephyr-logging-part-2/#deferred-logging"&gt;https://foundries.io/insights/2018/08/14/zephyr-logging-part-2/#deferred-logging&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you want to decrease the amount of dropped messages, you could try to follow the tips by Einar in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37424/nrf52-rtt-log-not-showing-all-messages"&gt;this ticket&lt;/a&gt;. Even though it is for the nRF5 SDK and not NCS, I think the tips should still be relevant for you.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>