<?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>Flushing the LTE modem trace buffer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/123594/flushing-the-lte-modem-trace-buffer</link><description>Dear Nordic, 
 We’ve developed an application which runs on an nRF9151 DK using NCS 2.8.2. The device is running modem fw nrf91x1_2.0.2. Our application has enabled modem traces using the following Kconfig settings: 
 
 CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 02 Sep 2025 23:56:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/123594/flushing-the-lte-modem-trace-buffer" /><item><title>RE: Flushing the LTE modem trace buffer</title><link>https://devzone.nordicsemi.com/thread/547548?ContentTypeID=1</link><pubDate>Tue, 02 Sep 2025 23:56:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7c6d730-f3ea-4a49-b59a-6fa964b7e809</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Hi Peter,&amp;nbsp;&lt;/p&gt;
[quote user="Neal Riedel"]It seems to be sending data to the host PC since I can observe the serial data line toggling on an oscilloscope. However, the nrfutil trace application reports &amp;quot;0 bytes&amp;quot;.[/quote]
&lt;p&gt;&lt;span&gt;Where do you inspect with the oscilloscope? Between the device and board controller, or between the board controller and computer? &lt;br /&gt;&lt;br /&gt;Do you have access to an external UART to serial bridge to try with (connected where you now have the oscilloscope)? &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Peter Murphy"]The results seem to suggest that running the &lt;code&gt;nrfutil trace lte ...&lt;/code&gt; command at the linux command line sometime behaves differently than when using the Cellular Monitor application to capture modem traces.[/quote]
&lt;p&gt;Will check with the developers of the tool here and get back to you.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flushing the LTE modem trace buffer</title><link>https://devzone.nordicsemi.com/thread/547547?ContentTypeID=1</link><pubDate>Tue, 02 Sep 2025 23:00:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb833b43-6cc6-40fe-91e5-3a4ef52d3eea</guid><dc:creator>Peter Murphy</dc:creator><description>&lt;p&gt;Hi Jonathan,&lt;/p&gt;
&lt;p&gt;We re-ran our tests using the &lt;code&gt;Cellular Monitor v2.4.4&lt;/code&gt;&amp;nbsp;application and don&amp;#39;t see the issue of the trace files sometimes being empty.&amp;nbsp; The tests were carried out on the same linux computer used to generate the results detailed earlier. In addition, the same application code was installed on the 9151DK. The results seem to suggest that running the &lt;code&gt;nrfutil trace lte ...&lt;/code&gt; command at the linux command line sometime behaves differently than when using the Cellular Monitor application to capture modem traces. Using the Cellular Monitor application is not an option for us because we&amp;#39;re doing things in a scripted test automation framework.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flushing the LTE modem trace buffer</title><link>https://devzone.nordicsemi.com/thread/546379?ContentTypeID=1</link><pubDate>Thu, 21 Aug 2025 21:45:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b1d118e-bd93-4b65-b756-3c6ebdab0d3c</guid><dc:creator>JONATHAN LL</dc:creator><description>[quote user="Neal Riedel"]We are not using RTT, we are using the UART backend[/quote]
&lt;p&gt;It was a possible partial explanation on why the data was gone sometimes, if RTT was used it could cause data being dropped.&amp;nbsp; But since you are not using RTT this is not the likely case. But data would be droppede either way with HWFC on or off. Its just if a response is created or not when the data is dropped.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user="Neal Riedel"]It seems to be sending data to the host PC since I can observe the serial data line toggling on an oscilloscope. However, the nrfutil trace application reports &amp;quot;0 bytes&amp;quot;.[/quote]
&lt;p&gt;Will try to find an explanation for this, but do you have a logic analyzer, or can you check the data that is being transmitted?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flushing the LTE modem trace buffer</title><link>https://devzone.nordicsemi.com/thread/546378?ContentTypeID=1</link><pubDate>Thu, 21 Aug 2025 21:09:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:940d0368-1cef-405c-b762-79c46da75d7a</guid><dc:creator>Neal Riedel</dc:creator><description>&lt;p&gt;I don&amp;#39;t understand.&amp;nbsp; We are not using RTT, we are using the UART backend.&amp;nbsp; It is connected to uart1.&amp;nbsp; THe behavior seems to be the same with and without HW flow control.&lt;/p&gt;
&lt;p&gt;It seems to be sending data to the host PC since I can observe the serial data line toggling on an oscilloscope. However, the nrfutil trace application reports &amp;quot;0 bytes&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flushing the LTE modem trace buffer</title><link>https://devzone.nordicsemi.com/thread/546376?ContentTypeID=1</link><pubDate>Thu, 21 Aug 2025 20:34:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:765bb47f-c180-4a93-82bd-62f9b30bf9fe</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;The HWFC is not the issue, enabled or not the difference would be if the trace data is silently dropped or that the dropped data is registered as a dropped event. But the trace data is gone either way.&lt;br /&gt;&lt;br /&gt;This happens if RTT is used and since RTT holdes priority it will take over while the buffer is filled up, if the buffer is full the trace data will be dropped&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Having HWFC enabled does not enable a greater risk of missing traces if RTT is on, though it would be more visible in the binary trace than if HWFC is disabled.&lt;br /&gt;&lt;br /&gt; &lt;/span&gt;&lt;br /&gt;An alterative route is to use other pins for for UART and use UART to serial and get the data that way. But there can be issues here as&amp;nbsp;&lt;span&gt;baudrate used is 1 000 000.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flushing the LTE modem trace buffer</title><link>https://devzone.nordicsemi.com/thread/546370?ContentTypeID=1</link><pubDate>Thu, 21 Aug 2025 17:50:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e09e757-3be6-4c1f-85b8-08a4571a8842</guid><dc:creator>Neal Riedel</dc:creator><description>&lt;p&gt;Thanks, Jonathan.&lt;/p&gt;
&lt;p&gt;I tried disabling the HW flow control on uart1, but it had no effect on this problem.&lt;/p&gt;
&lt;p&gt;I also connected a scope to the uart1 TXD pin and monitoring the activity when the problem occurs.&amp;nbsp; The nrfutil trace command displays this:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Saving trace to trace_log3.pcapng (0 bytes)&lt;/p&gt;
&lt;p&gt;However I can clearly see activity on the TXD pin, indicating that the 9151 is sending data to the nrfutil application.&amp;nbsp; So I wonder if the trace data is actually being queue in the linux PC?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flushing the LTE modem trace buffer</title><link>https://devzone.nordicsemi.com/thread/546268?ContentTypeID=1</link><pubDate>Wed, 20 Aug 2025 23:52:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50bd2526-9309-4da1-baa4-b9f41784f1fa</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Hi Neal,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;This looks ok.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user="Neal Riedel"]We do have HW flow control set on this port.&amp;nbsp; Could that be the issue?[/quote]
&lt;p&gt;Still checking with the devz and discussing here what could be the reason.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flushing the LTE modem trace buffer</title><link>https://devzone.nordicsemi.com/thread/545820?ContentTypeID=1</link><pubDate>Fri, 15 Aug 2025 18:13:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d760ba04-851f-4d94-8eb3-7049ba9e824d</guid><dc:creator>Neal Riedel</dc:creator><description>&lt;p&gt;Hi Jonathan,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m the guy writing the software. ;)&lt;/p&gt;
&lt;p&gt;We use the&amp;nbsp;nrf91-modem-trace-uart snippet in the build.&amp;nbsp; Double-checking the&amp;nbsp; generated zephyr.dts file, it has this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;        chosen {
                zephyr,entropy = &amp;amp;psa_rng;
                zephyr,flash-controller = &amp;amp;flash_controller;
                zephyr,console = &amp;amp;uart0;
                zephyr,shell-uart = &amp;amp;uart0;
                zephyr,uart-mcumgr = &amp;amp;uart0;
                zephyr,flash = &amp;amp;flash0;
                zephyr,sram = &amp;amp;sram0_ns_app;
                zephyr,code-partition = &amp;amp;slot0_ns_partition;
                nordic,pm-ext-flash = &amp;amp;gd25wb256;
                nordic,modem-trace-uart = &amp;amp;uart1;
        };
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And also this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;                        uart1: arduino_serial: uart@9000 {
                                compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
                                reg = &amp;lt; 0x9000 0x1000 &amp;gt;;
                                interrupts = &amp;lt; 0x9 0x1 &amp;gt;;
                                status = &amp;quot;okay&amp;quot;;
                                current-speed = &amp;lt; 0xf4240 &amp;gt;;
                                pinctrl-0 = &amp;lt; &amp;amp;uart1_default &amp;gt;;
                                pinctrl-1 = &amp;lt; &amp;amp;uart1_sleep &amp;gt;;
                                pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
                                hw-flow-control;
                        };
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So I think it is correct.&amp;nbsp; We do have HW flow control set on this port.&amp;nbsp; Could that be the issue?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Neal Riedel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flushing the LTE modem trace buffer</title><link>https://devzone.nordicsemi.com/thread/545775?ContentTypeID=1</link><pubDate>Fri, 15 Aug 2025 11:36:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ecc4a93-5b7b-4f91-bfd0-0dd2e63a2858</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Update from devz:&lt;/p&gt;
&lt;p&gt;Do&amp;nbsp;they have the Device Tree overlay as given in the nrf91-modem-trace-uart snippet?&lt;br /&gt;&lt;br /&gt;&lt;code&gt;/* Enable uart1 for tracing. */&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;amp;uart1 {&lt;/code&gt;&lt;br /&gt;&lt;code&gt; status = &amp;quot;okay&amp;quot;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; current-speed = &amp;lt; 1000000 &amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;};&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/ {&lt;/code&gt;&lt;br /&gt;&lt;code&gt; chosen {&lt;/code&gt;&lt;br /&gt;&lt;code&gt; nordic,modem-trace-uart = &amp;amp;uart1;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; };&lt;/code&gt;&lt;br /&gt;&lt;code&gt;};&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;If not, modem will likely drop a lot of trace messages because of the uart baud rate. Not sure if that can explain the &lt;span&gt;PCAP&lt;/span&gt; being completely blank though. Enabling &lt;span&gt;HWFC&lt;/span&gt; would help on loosing traces in the board controller if &lt;span&gt;RTT&lt;/span&gt; is enabled, as RTT has priority.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flushing the LTE modem trace buffer</title><link>https://devzone.nordicsemi.com/thread/545634?ContentTypeID=1</link><pubDate>Thu, 14 Aug 2025 08:38:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fc35fb5-dd98-4d57-ba87-61d33325fc95</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Hi Peter,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Looking in to this and have forwarded the question to our devz, will update.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;But the documentation says that the modem buffers the data.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span&gt;The trace backend needs to handle trace data at ~1 Mbps to avoid filling up the buffer in the modem. If the modem buffer is full, the modem drops modem traces until the buffer has space available again.&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Ref:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/modem/nrf_modem_lib/nrf_modem_lib_trace.html#modem_trace_flash_backend"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/modem/nrf_modem_lib/nrf_modem_lib_trace.html#modem_trace_flash_backend&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>