<?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>System hangs when using dual UARTs (UART20 &amp;amp; UART30) on nRF54L15</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/126320/system-hangs-when-using-dual-uarts-uart20-uart30-on-nrf54l15</link><description>Hello, 
 I am developing a project on the nRF54L15 and encountered a system hang when using two UART instances simultaneously: UART20 (for logging and printk ) and UART30 (for external device communication). 
 Symptoms: 
 
 
 When compiled with Default</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 02 Jan 2026 16:16:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/126320/system-hangs-when-using-dual-uarts-uart20-uart30-on-nrf54l15" /><item><title>RE: System hangs when using dual UARTs (UART20 &amp; UART30) on nRF54L15</title><link>https://devzone.nordicsemi.com/thread/557838?ContentTypeID=1</link><pubDate>Fri, 02 Jan 2026 16:16:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8eacd1a8-7a07-4148-9438-2a0545137da9</guid><dc:creator>Syed Maysum Abbas Zaidi</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for re-testing, It looks since&amp;nbsp;the same behavior also occurs on the nRF52840 DK (which does not use TF-M) and only depends on the optimization level (-g works, -Os/-O2 hangs), this points to an application-level, optimization-sensitive issue, not a TF-M or UART ownership problem.&amp;nbsp;This type of issue is usually caused by things like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;doing too much work or logging in UART ISRs/callbacks,&lt;/li&gt;
&lt;li&gt;missing synchronization between ISR and thread context,&lt;/li&gt;
&lt;li&gt;or UART buffer/stack usage problems that only show up in optimized builds.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The reason -g appears to “fix” it is that debug builds change timing, code layout, and stack usage, which can hide race conditions, starvation, or marginal stack problems that become visible with -Os/-O2&lt;/p&gt;
&lt;p&gt;As a next step, please check that no LOG_* or printk calls are made from UART callbacks/ISRs, move any heavier processing to a thread or work queue, and make sure UART buffers remain valid until transfers complete. Also double-check stack sizes for threads handling UART and logging.&amp;nbsp;If you can share the UART callback code and relevant config, we can help pinpoint it further.&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;br /&gt;Syed Maysum&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System hangs when using dual UARTs (UART20 &amp; UART30) on nRF54L15</title><link>https://devzone.nordicsemi.com/thread/557768?ContentTypeID=1</link><pubDate>Wed, 31 Dec 2025 08:06:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75ef3c38-d93b-4ba6-acfe-8359292df8b1</guid><dc:creator>odin huang</dc:creator><description>&lt;p&gt;Hi Syed,&lt;/p&gt;
&lt;p&gt;Today, after adding the configuration, I realized that I had forgotten to change the &lt;strong data-start="137" data-end="143"&gt;-g&lt;/strong&gt; option in the build settings back to &lt;strong data-start="181" data-end="196"&gt;Use Default&lt;/strong&gt;.&lt;br data-start="197" data-end="200" /&gt; After switching it to &lt;strong data-start="224" data-end="239"&gt;Use Default&lt;/strong&gt; and flashing it to the target board, I found that it still did not work. Even after adding &lt;code data-start="331" data-end="363"&gt;CONFIG_TFM_LOG_LEVEL_SILENCE=y&lt;/code&gt;, the problem persisted.&lt;br data-start="387" data-end="390" /&gt; It seems the issue is still present. I tried running the same code on the &lt;strong data-start="466" data-end="481"&gt;nRF52840 DK&lt;/strong&gt; and found that it works correctly when compiled with &lt;strong data-start="535" data-end="541"&gt;-g&lt;/strong&gt;, but fails when using &lt;strong data-start="564" data-end="571"&gt;-Os&lt;/strong&gt; or &lt;strong data-start="575" data-end="582"&gt;-O2&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;br data-start="583" data-end="586" /&gt; The compilation conditions are the same for the same program.&lt;/p&gt;
&lt;p&gt;ncs 3.2.0 nrf52840DK for -g pass&lt;br /&gt;ncs 3.2.0 nrf52840DK for -Os fail&lt;br /&gt;ncs 3.2.0 nrf52840DK for -O2 fail&lt;/p&gt;
&lt;p&gt;ncs 3.0.2 nrf52840DK for -g pass&lt;br /&gt;ncs 3.0.2 nrf52840DK for -Os fail&lt;br /&gt;ncs 3.0.2 nrf52840DK for -O2 fail&lt;/p&gt;
&lt;p&gt;ncs 2.9.1 nrf52840DK for -g pass&lt;br /&gt;ncs 2.9.1 nrf52840DK for -Os fail&lt;br /&gt;ncs 2.9.1 nrf52840DK for -O2 fail&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System hangs when using dual UARTs (UART20 &amp; UART30) on nRF54L15</title><link>https://devzone.nordicsemi.com/thread/557751?ContentTypeID=1</link><pubDate>Tue, 30 Dec 2025 16:13:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eaeda48a-2ef3-438f-be1d-28ccdb53fff5</guid><dc:creator>odin huang</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Syed,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I previously tested my project using the cpuapp/ns (Non-Secure) target and confirmed that setting CONFIG_TFM_LOG_LEVEL_SILENCE=y allowed both the application logs and UART_CONSOLE to function correctly.&lt;/p&gt;
&lt;p&gt;Currently, I am building for the cpuapp target. I have the following technical questions regarding the behavior I&amp;#39;ve observed:&lt;/p&gt;
&lt;p&gt;TF-M Activation in cpuapp Builds: When building for the cpuapp target, is TF-M still enabled by default? Specifically, if MCUBoot is included in the project, does it automatically trigger the activation of TF-M (Trusted Firmware-M)?&lt;/p&gt;
&lt;p&gt;Current Workaround: I have confirmed that adding CONFIG_TFM_LOG_LEVEL_SILENCE=y to my current cpuapp build resolves the system hang. Without this setting, the program freezes as soon as UART30 begins transmission.&lt;/p&gt;
&lt;p&gt;Resource Contention: Why does silencing TF-M logs prevent the application from hanging? It appears that the Secure Domain&amp;#39;s logging mechanism conflicts with the application&amp;#39;s interrupt-driven UART (UART30), even when the application is not explicitly built as &amp;quot;Non-Secure.&amp;quot;&lt;/p&gt;
&lt;p&gt;Can the UART output instance of TF-M be switched?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System hangs when using dual UARTs (UART20 &amp; UART30) on nRF54L15</title><link>https://devzone.nordicsemi.com/thread/557747?ContentTypeID=1</link><pubDate>Tue, 30 Dec 2025 15:29:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c168714-26e1-4f4b-836e-cdf2e3d4c5b0</guid><dc:creator>Syed Maysum Abbas Zaidi</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;On the nRF54L15 this behavior is expected if TF-M is enabled and the same UART instance is used by both the secure and non-secure domains. As the system is split into a secure image (TF-M) and a non-secure application. The application you build and run is the non-secure one, while TF-M runs separately in the secure world and is built automatically when enabled. By&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/security/tfm/tfm_logging.html"&gt;default&lt;/a&gt;&amp;nbsp;on nRF54L, the non-secure application typically uses UART20, while TF-M uses UART30 for logging.&lt;/p&gt;
&lt;p&gt;If the non-secure application also configures UART30 (for example, for external device communication with CONFIG_UART_INTERRUPT_DRIVEN), this can lead to undefined behavior or hangs when logging is active, as both domains end up interacting with the same UART. This also explains why the issue disappears when logging is disabled, and why it may not reproduce in a debug (-g) build due to timing and layout differences.&lt;/p&gt;
&lt;p&gt;To resolve this, we recommend one of the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Disable TF-M logging if it is not needed which will&amp;nbsp;free up UART30 by adding this to your prj.conf:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_TFM_LOG_LEVEL_SILENCE=y&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Avoid using UART30 in the non-secure application and move the external device to another UART instance (e.g. UART21 or &lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/uarte.html"&gt;another available UART&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Switch application logging to a non-UART backend, such as RTT, to avoid UART resource conflicts during development.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After applying one of the above, using multiple UARTs concurrently in the non-secure application should work as expected. Best Regards,&lt;/p&gt;
&lt;p&gt;Syed Maysum&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>