<?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>Assertion during startup when declaring an uart in the device tree</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/121235/assertion-during-startup-when-declaring-an-uart-in-the-device-tree</link><description>We get the following assertion during startup if we include uart2 in the DTS. 
 *** Booting My Application v2.1.0-dev-ae1ee57f3906 *** *** Using nRF Connect SDK v3.0.1-9eb5615da66b *** *** Using Zephyr OS v4.0.99-77f865b8f8d0 *** I: Starting bootloader</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 May 2025 15:15:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/121235/assertion-during-startup-when-declaring-an-uart-in-the-device-tree" /><item><title>RE: Assertion during startup when declaring an uart in the device tree</title><link>https://devzone.nordicsemi.com/thread/536260?ContentTypeID=1</link><pubDate>Tue, 20 May 2025 15:15:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41352ea2-1019-4964-b959-071402519ea9</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="tmaltesen"]&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But this does not seem to do the trick. If I remove my previous fix, I am back to the old behaviour. OR maybe it does actually work - doing some prestine builds to verify.&lt;/p&gt;[/quote]
&lt;p&gt;I would recommend that you delete your build directory and create an new build instead of doing pristine.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you still have issues, please share the build/my_app/mcuboot/zephyr/zephyr.dts and .config.&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: Assertion during startup when declaring an uart in the device tree</title><link>https://devzone.nordicsemi.com/thread/536207?ContentTypeID=1</link><pubDate>Tue, 20 May 2025 12:40:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc0acade-e21c-47fa-84de-0b27ac9869d8</guid><dc:creator>Thomas</dc:creator><description>&lt;p&gt;Not much saved in mcuboot, but thats fine.&lt;/p&gt;
&lt;p&gt;FLASH saved 156 byte RAM saved 24 bytes.&lt;/p&gt;
&lt;p&gt;But this does not seem to do the trick. If I remove my previous fix, I am back to the old behaviour. OR maybe it does actually work - doing some prestine builds to verify.&lt;/p&gt;
&lt;p&gt;But I have devices in the field, will that not be a problem because they do not get mcuboot updated (or?)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assertion during startup when declaring an uart in the device tree</title><link>https://devzone.nordicsemi.com/thread/534821?ContentTypeID=1</link><pubDate>Mon, 12 May 2025 08:24:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1983061-52a0-4b0c-a12a-abb4e7ecea8e</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;Thank you for posting the workaround on your side. I will report this internally.&lt;/p&gt;
&lt;p&gt;This explains why I had issues reproducing it, as I do not have anything connected to those specific uart lines on my side.&lt;/p&gt;
&lt;p&gt;What happens is that mcuboot does not do a cleanup of that specific uart instance, and&amp;nbsp;this specific uart instance generates an event while tf-m is executing.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Your fix is valid, but another fix is to disable this instance in mcuboot:&lt;/p&gt;
&lt;p&gt;sysbuild/mcuboot/boards/$(BOARD).overlay&lt;/p&gt;
&lt;p&gt;for PMI8004:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;pmi8004_nrf9151.overlay (Note: lack of&amp;nbsp;&lt;strong&gt;ns&lt;/strong&gt; prefix)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Holding:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;uart2 {
    status = &amp;quot;disabled&amp;quot;;
};&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This will save you space in the mcuboot image, given that you do not use uart2 for mcuboot-recovery services.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Håkon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assertion during startup when declaring an uart in the device tree</title><link>https://devzone.nordicsemi.com/thread/534500?ContentTypeID=1</link><pubDate>Thu, 08 May 2025 14:22:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7227fbc-fc5e-4fbc-b644-c7aa2859c363</guid><dc:creator>Thomas</dc:creator><description>&lt;p&gt;Really strange we have replicated the same thing at least 10 times with new project and build.&amp;nbsp;But last time we updated from SDK 3.0.0 to 3.0.1 and we saw a little difference. But&amp;nbsp;I&amp;#39;m quite sure that after correcting&amp;nbsp;Kconfig we had same problem. We have been working in several parallel tracks.&lt;/p&gt;
&lt;p&gt;Did you include the board file in the project boards folder. The&amp;nbsp;nrf9151dk_nrf9151_ns.conf?&lt;/p&gt;
&lt;p&gt;It was a college of mine that have reproduced it the last few times.&lt;/p&gt;
&lt;p&gt;Right now we are runing with a workaround where we have patched SDK files. We have added the following that at least seems to do the trick:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In the file: &amp;lt;sdk&amp;gt;\bootloader\mcuboot\boot\zephyr\nrf_cleanup.c&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#if defined(NRF_UARTE_CLEANUP)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;static NRF_UARTE_Type *nrf_uarte_to_clean[] = {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#if defined(NRF_UARTE0)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; NRF_UARTE0,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#endif&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#if defined(NRF_UARTE1)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; NRF_UARTE1,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#endif&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#if defined(NRF_UARTE2)&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; NRF_UARTE2,&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#endif&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#if defined(NRF_UARTE20)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; NRF_UARTE20,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#endif&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#if defined(NRF_UARTE30)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; &amp;nbsp; NRF_UARTE30,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#endif&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#endif&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assertion during startup when declaring an uart in the device tree</title><link>https://devzone.nordicsemi.com/thread/534495?ContentTypeID=1</link><pubDate>Thu, 08 May 2025 14:05:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f56e152a-0171-4db3-af40-95fc317956b5</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;Thank you for the board files. I ran your board, in azure_iot_hub, with pmi8004_nrf9151_ns.conf (basically copied from the other files), checked that the modbus entry exists, and it boots:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting My Application v2.1.0-dev-ae1ee57f3906 ***
*** Using nRF Connect SDK v3.0.1-9eb5615da66b ***
*** Using Zephyr OS v4.0.99-77f865b8f8d0 ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Image index: 0, Swap type: none
I: Bootloader chainload address offset: 0x10000
I: Image version: v0.0.0
�All pins have been configured as non-secure
Booting TF-M v2.1.1-ncs4-1
[Sec Thread] Secure image initializing!
*** Booting nRF Connect SDK v3.0.1-9eb5615da66b ***
*** Using Zephyr OS v4.0.99-77f865b8f8d0 ***
[00:00:00.253,936] &amp;lt;inf&amp;gt; azure_iot_hub_sample: Azure IoT Hub sample started
[00:00:00.253,967] &amp;lt;inf&amp;gt; azure_iot_hub_sample: Bringing network interface up and connecting to the network
[00:00:00.539,031] &amp;lt;inf&amp;gt; azure_iot_hub_sample: Device ID: my-device
[00:00:00.539,062] &amp;lt;inf&amp;gt; azure_iot_hub_sample: Host name: 
+CGEV: EXCE STATUS 0
+CEREG: 2,&amp;quot;8169&amp;quot;,&amp;quot;014A0302&amp;quot;,7
%MDMEV: PRACH CE-LEVEL 0
+CSCON: 1
+CGEV: ME PDN ACT 0
%MDMEV: SEARCH STATUS 2
+CEREG: 1,&amp;quot;8169&amp;quot;,&amp;quot;014A0302&amp;quot;,7,,,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
[00:00:04.934,326] &amp;lt;inf&amp;gt; azure_iot_hub_sample: Network connectivity established and IP address assigned
[00:00:04.934,448] &amp;lt;inf&amp;gt; azure_iot_hub_sample: Connected to network
[00:00:04.934,997] &amp;lt;inf&amp;gt; azure_fota: Current firmware version: 0.0.0-dev
[00:00:04.935,028] &amp;lt;inf&amp;gt; azure_iot_hub_sample: Azure IoT Hub library initialized
[00:00:04.935,028] &amp;lt;inf&amp;gt; azure_iot_hub_sample: AZURE_IOT_HUB_EVT_CONNECTING
[00:00:04.935,272] &amp;lt;err&amp;gt; mqtt_helper: getaddrinfo() failed, error -2
[00:00:04.935,302] &amp;lt;err&amp;gt; azure_iot_hub: mqtt_helper_connect failed, error: 2
[00:00:04.935,333] &amp;lt;inf&amp;gt; azure_iot_hub_sample: Connection request sent to IoT Hub
+CGEV: IPV6 0
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I also checked the compiled zephyr.dts, and the uart2 entry is as you describe it.&lt;/p&gt;
&lt;p&gt;Could you try to delete your build folder (ie. not pristine build) and regenerate the build in vscode to see if this helps the scenario?&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: Assertion during startup when declaring an uart in the device tree</title><link>https://devzone.nordicsemi.com/thread/534425?ContentTypeID=1</link><pubDate>Thu, 08 May 2025 09:20:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e6a4295-093d-4911-ab5a-57d738fd7ec9</guid><dc:creator>Thomas</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/PMI8004.zip"&gt;devzone.nordicsemi.com/.../PMI8004.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I have attached my board file.&lt;/p&gt;
&lt;p&gt;Project itself is the Azure sample with just the two CONFIG modifications that makes it buildable (maybe only one is needed, but I used two).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assertion during startup when declaring an uart in the device tree</title><link>https://devzone.nordicsemi.com/thread/534417?ContentTypeID=1</link><pubDate>Thu, 08 May 2025 08:53:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:520ba935-e040-44df-a378-0b8aacf5497b</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;Could you share the full modifications that you used?&lt;/p&gt;
&lt;p&gt;Did you try turning off logging in TFM to see if this helped?&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: Assertion during startup when declaring an uart in the device tree</title><link>https://devzone.nordicsemi.com/thread/534279?ContentTypeID=1</link><pubDate>Wed, 07 May 2025 12:49:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47b2d0c4-114f-496d-ae71-8ae5c0f0973e</guid><dc:creator>Thomas</dc:creator><description>&lt;p&gt;I have not set anything up for TFM. I&amp;#39;m using out of the box sample.&lt;/p&gt;
&lt;p&gt;This can be recreated by&amp;nbsp;using the sample and just modifying a DK board DTS to use uart2.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assertion during startup when declaring an uart in the device tree</title><link>https://devzone.nordicsemi.com/thread/534274?ContentTypeID=1</link><pubDate>Wed, 07 May 2025 11:57:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77cfee19-2f9d-46cd-a539-4226fbc12e84</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=""]Best guess it is related to TF-M, but I have now used a week without figuring out what&amp;nbsp;need to be modified. I guess a single CONFIG ting will fix it but which?[/quote]
&lt;p&gt;By default, TFM uses uart1 for logging, and this can be silenced/disabled using:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_TFM_SECURE_UART=n
CONFIG_TFM_LOG_LEVEL_SILENCE=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you setup your custom board with a different uart for tfm, and this crashes with either the pins or the instance (uart2) ?&lt;/p&gt;
&lt;p&gt;Do you still see an assert after disabling logging in tfm?&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>