<?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>Unstable RTT logging</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/116860/unstable-rtt-logging</link><description>Hello, 
 I would love to use RTT in a nRF5340 project. I&amp;#39;m using Nordic Connect SDK v2.7.99-cs2. In a debug build, I very often see the problem, that some of expected log messages do not show up in JlinkRTTView: 
 Sometimes, I see the complete message</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 11 Dec 2024 14:29:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/116860/unstable-rtt-logging" /><item><title>RE: Unstable RTT logging</title><link>https://devzone.nordicsemi.com/thread/514552?ContentTypeID=1</link><pubDate>Wed, 11 Dec 2024 14:29:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbb36061-cdb3-4e19-8e84-1744913de601</guid><dc:creator>Nathan Bourgeois</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/torsten-robitzki"&gt;Torsten Robitzki&lt;/a&gt;&amp;nbsp;, hi &lt;a href="https://devzone.nordicsemi.com/members/charlie-shao"&gt;Charlie&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I do encounter the exact same issue, very repeatable too. Here&amp;#39;s some info of my setup :&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;nrf52833&lt;/li&gt;
&lt;li&gt;NCS v2.7.0&lt;/li&gt;
&lt;li&gt;sysbuild with MCUboot&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;prj.conf&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;################
# Board config #
################
CONFIG_EVENTS=y
CONFIG_SMF=y

# Enable PWM led 
CONFIG_PWM=y
CONFIG_NRFX_PWM0=y
CONFIG_LED=y

# Enable ADC
CONFIG_ADC=y

# Enable log module though RTT
CONFIG_LOG=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=n

################
# Flash config #
################
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
CONFIG_HEAP_MEM_POOL_SIZE=1024

##############
# BLE config #
##############
CONFIG_BT=y
CONFIG_BT_CTLR=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME=&amp;quot;Blinker&amp;quot;
CONFIG_BT_SMP=y

# Enable storing pairing key in flash
CONFIG_BT_SETTINGS=y

# BLE services
CONFIG_BT_BAS=y

# In order to correctly tune the stack sizes for the threads the following
# Configurations can enabled to print the current use:
# CONFIG_THREAD_NAME=y
# CONFIG_THREAD_ANALYZER=y
# CONFIG_THREAD_ANALYZER_AUTO=y
# CONFIG_THREAD_ANALYZER_RUN_UNLOCKED=y
# CONFIG_THREAD_ANALYZER_USE_PRINTK=y
# CONFIG_CONSOLE=y
# CONFIG_UART_CONSOLE=y
# CONFIG_SERIAL=y
# CONFIG_PRINTK=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the output i get after connecting to RTT from VScode :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;SEGGER J-Link V7.94e - Real time terminal output
SEGGER J-Link V9.6, SN=69665320
Process: JLink.exe
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
[00:00:00.008,117] &amp;lt;inf&amp;gt; fs_nvs: 2 Sectors of 4096 bytes
[00:00:00.008,117] &amp;lt;inf&amp;gt; fs_nvs: alloc wra: 0, fe8
[00:00:00.008,148] &amp;lt;inf&amp;gt; fs_nvs: data wra: 0, 0
[00:00:00.008,300] &amp;lt;inf&amp;gt; bt_sdc_hci_driver: SoftDevice Controller build revision: 
                                            d6 da c7 ae 08 db 72 6f  2a a3 26 49 2a 4d a8 b3 |......ro *.&amp;amp;I*M..
                                            98 0e 07 7f                                      |....             
[00:00:00.010,833] &amp;lt;inf&amp;gt; bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.010,864] &amp;lt;inf&amp;gt; bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.010,894] &amp;lt;inf&amp;gt; bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 214.51162 Build 1926957230
[00:00:00.011,322] &amp;lt;inf&amp;gt; bt_hci_core: No ID address. App must call settings_load()
[00:00:00.011,779] &amp;lt;inf&amp;gt; bt_0m&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;However if i put another log before initializing the ble stack which produce log, i can somehow reduce the output :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;SEGGER J-Link V7.94e - Real time terminal output
SEGGER J-Link V9.6, SN=69665320
Process: JLink.exe
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
[00:00:00.000,366] &amp;lt;dbg&amp;gt; fsm: init_entry: 
[00:00:00.007,720] &amp;lt;inf&amp;gt; fs_nvs: 2 Sectors of 4096 bytes
[00:00:00.007,720] &amp;lt;inf&amp;gt; fs_nvs: alloc wra: 0, fe8
[00:00:00.007,720] &amp;lt;inf&amp;gt; fs_nvs: data wra: 0, 0
[00:00:00.007,873] &amp;lt;inf&amp;gt; bt_sdc_hci_driver: SoftDevice Controller build revision: 
                                            d6 da c7 ae 08 db 72 6f  2a a3 26 49 2a 4d a8 b3 |......ro *.&amp;amp;I*M..
                                            98 0e 07 7f                                      |....             
[00:00:00.010,437] &amp;lt;inf&amp;gt; bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.010,467] &amp;lt;inf&amp;gt; bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.010,498] &amp;lt;inf&amp;gt; bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 214.51162 Build 1926957230
[00:00:00.010,925] &amp;lt;inf&amp;gt; bt_hci_core: No ID address. App musload()&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And this is alway the same. So i suspected an overflow somewhere but changing settings like buffer length or message index in log module or RTT backend don&amp;#39;t make a difference.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Both our problem are linked to bt_hci_core logging maybe too much, i&amp;#39;m looking into that.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Nathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unstable RTT logging</title><link>https://devzone.nordicsemi.com/thread/513567?ContentTypeID=1</link><pubDate>Thu, 05 Dec 2024 08:34:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6db844cf-dd72-46f5-8521-3593483387e5</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Hi Charlie,&lt;/p&gt;
&lt;p&gt;thanks for looking into this. The cited thread is already 5 years old and it&amp;#39;s more about the missing &amp;quot;...&amp;quot;-marks that should indicate missing log messages. I&amp;#39;ve configured the log buffer to be 64k, so I would not expect overruns.&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Torsten&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unstable RTT logging</title><link>https://devzone.nordicsemi.com/thread/512945?ContentTypeID=1</link><pubDate>Mon, 02 Dec 2024 11:28:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5921b289-ab5d-4e44-a3ca-2fc371ec3f73</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Torsten,&lt;/p&gt;
&lt;p&gt;Thank you for reaching out with your questions. I recommend switching to the formal release of NCS 2.8.0 for debugging. While NCS 2.7.99-cs2 should have the same behavior as NCS 2.8.0 regarding RTT usage, using the official release ensures stability and compatibility.&lt;/p&gt;
&lt;p&gt;To verify if the issue is related to the logging system, I suggest switching to the UART backend and testing again.&lt;/p&gt;
&lt;p&gt;I also found a related report on GitHub: &lt;strong&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/issues/21514" target="_new"&gt;&lt;span&gt;Logging&lt;/span&gt;&lt;span&gt; - Strange&lt;/span&gt;&lt;span&gt; Behavior&lt;/span&gt;&lt;span&gt; with&lt;/span&gt;&lt;span&gt; RTT&lt;/span&gt;&lt;span&gt; on&lt;/span&gt;&lt;span&gt; nRF53&lt;/span&gt;&lt;/a&gt;&lt;/strong&gt;. According to the discussion, a fix for this issue has already been implemented. If the problem persists, please feel free to continue the discussion there. The logging system a subsystem of Zephyr.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Charlie&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>