<?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>Soft UART at 19200 baud works only when RTT logging is enabled</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/127245/soft-uart-at-19200-baud-works-only-when-rtt-logging-is-enabled</link><description>Here is a properly structured issue report in professional English. 
 
 Project ID 
 SOFTUART-NRF52-19200-RTT-DEPENDENCY 
 
 Subject 
 Soft UART at 19200 baud works only when RTT logging is enabled 
 
 Description 
 During development of a software UART</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 Mar 2026 06:53:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/127245/soft-uart-at-19200-baud-works-only-when-rtt-logging-is-enabled" /><item><title>RE: Soft UART at 19200 baud works only when RTT logging is enabled</title><link>https://devzone.nordicsemi.com/thread/562505?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2026 06:53:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef9c2af2-6c7f-4f4b-80a7-24e1d5bc2528</guid><dc:creator>Ehsan01</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for the suggestions.&lt;/p&gt;
&lt;p&gt;I performed additional checks regarding the questions you raised.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;HFCLK / HFXO&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I have now explicitly started the HFCLK/HFXO in the firmware using the nrfx clock driver to ensure that TIMER1 runs from a stable high-frequency clock source. This improves overall timing stability, but the behavior regarding RTT still remains noticeable.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Observed Error Pattern&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The framing errors do not appear to follow a fixed periodic pattern (e.g., every Nth byte). Instead, the framing error counter increases continuously when RTT is disabled. This suggests that the issue is not related to a deterministic offset but rather to small timing variations or interrupt latency affecting the sampling point.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Firmware Timing Constraints&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There is currently &lt;strong&gt;no BLE stack or radio activity running in the firmware&lt;/strong&gt;, so there are no hard real-time BLE scheduling events that could interfere with timing.&lt;/p&gt;
&lt;p&gt;The firmware primarily consists of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Soft UART receiver using GPIO interrupt for start-bit detection&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Bit sampling driven by &lt;strong&gt;nrfx_timer (TIMER1)&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Application logic processing received bytes&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The Soft UART implementation is therefore highly sensitive to timing jitter.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Additional Observation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;At &lt;strong&gt;9600 baud&lt;/strong&gt;, communication remains stable with or without RTT enabled.&lt;br /&gt;However, at &lt;strong&gt;19200 baud&lt;/strong&gt;, the bit period (~52 &amp;micro;s) significantly reduces the timing margin. Even small interrupt latency or scheduling jitter can shift the sampling point enough to occasionally misread the stop bit, which leads to framing errors.&lt;/p&gt;
&lt;p&gt;Enabling RTT appears to keep the CPU more active and reduces entry into deeper idle states, which indirectly improves timing consistency.&lt;/p&gt;
&lt;p&gt;Please let me know if there are recommended approaches in Zephyr/NCS to ensure more deterministic timing for this use case, or if forcing HFCLK to remain active during UART reception would be the preferred solution.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Ehsan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft UART at 19200 baud works only when RTT logging is enabled</title><link>https://devzone.nordicsemi.com/thread/562439?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2026 13:47:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3156b341-c4a2-4ab2-a877-fafd06af815a</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;
[quote user=""]&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;19200 baud + RTT disabled → Frequent framing errors&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Framing error counter increases continuously when RTT is disabled&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;[/quote]
&lt;p&gt;Could you try to start the HFXO and see if this helps the stability?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is there a pattern? Ie. does it occur every byte or every 100th byte for instance?&lt;/p&gt;
&lt;p&gt;Do you have anything running in your firmware that skews the timing, for instance a BLE link that has hard real-time requirements?&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></channel></rss>