<?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>Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114321/firmware-reset-failing-with-mcuboot-and-wdt</link><description>Hi all, 
 We have an application which uses both MCUboot and a watchdog timer. This combination seems to be causing issues anytime we attempt a soft reset using sys_reboot or NVIC reset directly. Our system; 
 
 Custom board using nRF5340 
 ncs v2.2.0</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 Nov 2024 11:56:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114321/firmware-reset-failing-with-mcuboot-and-wdt" /><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/508937?ContentTypeID=1</link><pubDate>Mon, 04 Nov 2024 11:56:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d1c712f-1ed3-4923-8f2e-6a1e17003dc2</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Yes, but I would recommend using v2.5.3&amp;nbsp;to get the latest fixes available for that branch.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/508912?ContentTypeID=1</link><pubDate>Mon, 04 Nov 2024 09:59:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:392880ad-2c9a-479d-abd6-f4995851ed74</guid><dc:creator>hugzy123</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;br /&gt;&lt;br /&gt;Thanks for updating me.&lt;/p&gt;
&lt;p&gt;From the ticket you attached, if I upgrade to at least SDK v2.5.0 I should be fine?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Otherwise, i&amp;#39;ll create a new&amp;nbsp;&lt;span&gt;nrf_reset_network_force_off() function&amp;nbsp;in my board file.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/508803?ContentTypeID=1</link><pubDate>Fri, 01 Nov 2024 12:37:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c8695b6-a318-40f2-80df-4f1cbd7d12bd</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I realized today while working on this ticket&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/116006/nrf5340-softreset-question"&gt;nRF5340 softreset question&lt;/a&gt;&amp;nbsp; that the workaround for&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/errata_nRF5340_Rev1/page/ERR/nRF5340/Rev1/latest/anomaly_340_161.html#anomaly_340_161"&gt;Errata 161&lt;/a&gt; was not backported to v2.4.4. I recommend adding the workaround in your board file.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;EDIT:&amp;nbsp;nrf53_errata_161() will return false here&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/hal_nordic/blob/427ee1a519e8a0844d0f78f7cbc8cdfc134ef00d/nrfx/hal/nrf_reset.h#L175C14-L175C30"&gt;https://github.com/zephyrproject-rtos/hal_nordic/blob/427ee1a519e8a0844d0f78f7cbc8cdfc134ef00d/nrfx/hal/nrf_reset.h#L175C14-L175C30&lt;/a&gt;&amp;nbsp;due to a bug in your current MDK version, which means the workaround will not be applied even if you&amp;nbsp;use &lt;a href="https://github.com/nrfconnect/sdk-zephyr/commit/679fa28574812431f79c87308a924db97dc2877e"&gt;nrf_reset_network_force_off&lt;/a&gt;(). To avoid having to patch the SDK, you can create your own nrf_reset_network_force_off() function to be used in your boards *_cpunet_reset.c file.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/507723?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2024 11:24:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c52a506-11fe-4342-9de0-c975020b63ea</guid><dc:creator>hugzy123</dc:creator><description>&lt;p&gt;No worries, thanks for the quick reply!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/507722?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2024 11:22:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c9aa4df-c5b2-43b8-ba0d-6c45a5fabbde</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry, you&amp;#39;re right, it&amp;#39;s 16K. I was mixing it up with the nRF9160, which has 32K alignment requirement.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/507719?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2024 11:15:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98d12aae-bb24-41de-ad94-48cd6ae605f0</guid><dc:creator>hugzy123</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/vibe"&gt;Vidar Berg&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;Just wanted to double check something, does the SPU definitely&amp;nbsp;require 32K alignment?&lt;/p&gt;
&lt;p&gt;The only reason I ask is because, in my ncs v2.4.4 build I can see&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; CONFIG_NRF_SPU_FLASH_REGION_SIZE &lt;/span&gt;&lt;span&gt;0x4000&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;which would be 16K.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I&amp;#39;m assuming&amp;nbsp;CONFIG_NRF_SPU_FLASH_REGION_SIZE would be what is used for&amp;nbsp;&lt;a class="reference external" title="(in Kconfig reference v&amp;amp;nbsp;)" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html#CONFIG_NRF_TRUSTZONE_FLASH_REGION_SIZE" data-bundleid="ncs-latest" data-navpath="kconfig/index.html"&gt;&lt;code class="xref kconfig kconfig-option docutils literal notranslate"&gt;&lt;span class="pre"&gt;CONFIG_NRF_TRUSTZONE_FLASH_REGION_SIZE&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&amp;nbsp;in&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/security/tfm.html#tf-m_partition_alignment_requirements"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/security/tfm.html#tf-m_partition_alignment_requirements&lt;/a&gt;, i&amp;#39;m just not sure if this would be 16k or 32k,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/505472?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2024 08:12:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9add72a-aa60-4db0-911c-3e0e937b4ab3</guid><dc:creator>hugzy123</dc:creator><description>[quote userid="4240" url="~/f/nordic-q-a/114321/firmware-reset-failing-with-mcuboot-and-wdt/505336"]Did you use the same memory layout in both versions? The SPU requires 32K aligment:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/security/tfm.html#tf-m_partition_alignment_requirements"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/security/tfm.html#tf-m_partition_alignment_requirements&lt;/a&gt;.[/quote]
&lt;p&gt;Thank you, I will look into this.&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/114321/firmware-reset-failing-with-mcuboot-and-wdt/505336"]I do not foresee any problems the workaround itself[/quote]
&lt;p&gt;Great, we&amp;#39;ll use this for now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/505336?ContentTypeID=1</link><pubDate>Tue, 08 Oct 2024 12:11:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b6bda01-5a49-44fc-92e2-59adf1a92e52</guid><dc:creator>Vidar Berg</dc:creator><description>[quote user="hugzy123"]Upgrading to a newer SDK does sound like a better fix, however, we&amp;#39;ve been struggling to get the partitions to confirm to the alignment rules in the newer SDK versions for the trusted firmware module.[/quote]
&lt;p&gt;Did you use the same memory layout in both versions? The SPU requires 32K aligment:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/security/tfm.html#tf-m_partition_alignment_requirements"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/security/tfm.html#tf-m_partition_alignment_requirements&lt;/a&gt;.&lt;/p&gt;
[quote user="hugzy123"]Thanks, we&amp;#39;ve verified this workaround in our current firmware. Do you know if there are any downsides to using this patch?&amp;nbsp;[/quote]
&lt;p&gt;I do not foresee any problems the workaround itself.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/505324?ContentTypeID=1</link><pubDate>Tue, 08 Oct 2024 11:36:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c492ca1a-a37f-4a5d-8c0e-d5a4117c75f3</guid><dc:creator>hugzy123</dc:creator><description>&lt;p&gt;Thanks for your reply.&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/114321/firmware-reset-failing-with-mcuboot-and-wdt/504823"]I have not been able to pinpoint the source of the flash access error, nor have I found any other reports of this event&amp;nbsp;happening under similar conditions. However, upgrading to SDK v2.4.4 may resolve this issue as it includes several errata workarounds that were not present in SDK v2.2.0.[/quote]
&lt;p&gt;Upgrading to a newer SDK does sound like a better fix, however, we&amp;#39;ve been struggling to get the partitions to confirm to the alignment rules in the newer SDK versions for the trusted firmware module.&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/114321/firmware-reset-failing-with-mcuboot-and-wdt/504823"]A workaround for now may be to issue a soft reset from the SPU ISR in TF-M to avoid having to wait for the WDT timeout. For example, by adding the following to ncs/v2.2.0/modules/tee/tf-m/trusted-firmware-m:[/quote]
&lt;p&gt;Thanks, we&amp;#39;ve verified this workaround in our current firmware. Do you know if there are any downsides to using this patch?&amp;nbsp;&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/114321/firmware-reset-failing-with-mcuboot-and-wdt/504823"]I think you are right. The specification does not guarantee the pin state in reset, only when going out of reset. I know this approach with using a GPIO to trigger pinreset worked with the nRF52840 but there are some differences in the reset mechanism between the nRF52840 and the nRF5340.&amp;nbsp;[/quote]
&lt;p&gt;We&amp;#39;re looking into adding an IC we can use which would generate a pulse on the pinreset line from an output GPIO of the nRF module.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/504823?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2024 12:10:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fdd7d3d-612b-4818-9533-6aed78b37d99</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry for the delayed response. I&amp;#39;ve been working on debugging the code to identify what is triggering the SPU event. It turned out to be quite challenging because the security violation is not caused by the CPU but by another bus master.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1727954835491v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I have not been able to pinpoint the source of the flash access error, nor have I found any other reports of this event&amp;nbsp;happening under similar conditions. However, upgrading to SDK v2.4.4 may resolve this issue as it includes several errata workarounds that were not present in SDK v2.2.0.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;A workaround for now may be to issue a soft reset from the SPU ISR in TF-M to avoid having to wait for the WDT timeout. For example, by adding the following to ncs/v2.2.0/modules/tee/tf-m/trusted-firmware-m:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="diff"&gt;diff --git a/platform/ext/common/faults.c b/platform/ext/common/faults.c
index eb87c971c..9124030c2 100644
--- a/platform/ext/common/faults.c
+++ b/platform/ext/common/faults.c
@@ -107,3 +107,8 @@ __attribute__((naked)) void UsageFault_Handler(void)
         &amp;quot;b         .                      \n&amp;quot;
     );
 }
+
+void SPU_IRQHandler(void)
+{
+    NVIC_SystemReset();
+}
\ No newline at end of file&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
[quote user="hugzy123"]It seems like because the reset pin never goes low again it doesn&amp;#39;t complete a reset. You can see this using the &amp;quot;Boot Reset&amp;quot; button on the DK; if I hold the button down the device won&amp;#39;t reset, It&amp;#39;s only when I release the button does it reset.[/quote]
&lt;p&gt;&lt;span&gt;I think you are right. The specification does not guarantee the pin state in reset, only when going out of reset. I know this approach with using a GPIO to trigger pinreset worked with the nRF52840 but there are some differences in the reset mechanism between the nRF52840 and the nRF5340.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/504146?ContentTypeID=1</link><pubDate>Fri, 27 Sep 2024 10:15:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78b431ba-406e-4b91-9ab1-959df6c5d031</guid><dc:creator>hugzy123</dc:creator><description>[quote userid="4240" url="~/f/nordic-q-a/114321/firmware-reset-failing-with-mcuboot-and-wdt/504031"]Thank you for this example. I&amp;#39;m able to reproduce the same here now, and it looks like the program hangs in the&amp;nbsp;SPU_IRQHandler when the WD times out.[/quote]
&lt;p&gt;Great to hear you can see it your side too.&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/114321/firmware-reset-failing-with-mcuboot-and-wdt/504031"]This should work, but it is important that the GPIO is never becomes configured as an output low during boot. Is this GPIO&amp;nbsp;configured in the code your prodived?[/quote]
&lt;p&gt;It isn&amp;#39;t in the demo I provided, however, it can be added easily.&lt;/p&gt;
&lt;p&gt;On the DK you just need to add a solder bridge to SB43 so the reset can be controlled via the pin, then add a jumper between a gpio and the RESET pin.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve used GPIO (0,26) below)&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/photo_5F00_2024_2D00_09_2D00_27_5F00_11_2D00_05_2D00_32.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Then you can add the following&amp;nbsp;function to the demo example which triggers&amp;nbsp;a pin reset.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define CONTROL_PIN NRF_GPIO_PIN_MAP(0,26) 
void pin_reset(void)
{
	 LOG_DBG(&amp;quot;Resetting Device&amp;quot;); 

    // Configure the GPIO pin
   // nrfx_gpiote_out_config_t pin_config = NRFX_GPIOTE_CONFIG_OUT_SIMPLE(true);
    nrfx_gpiote_out_config_t pin_config =
    {
        .action = GPIOTE_CONFIG_POLARITY_LoToHi,
        .init_state = GPIOTE_CONFIG_OUTINIT_High,
        .task_pin = false,
    };
    nrfx_err_t err = nrfx_gpiote_out_init(CONTROL_PIN, &amp;amp;pin_config);
    if (err != NRFX_SUCCESS) 
        LOG_DBG(&amp;quot;nrfx error 2 ox%X&amp;quot;,err); 
    k_msleep(300);
    // Set the pin high
        // power up unused ram for mcuboot
    if (IS_ENABLED(CONFIG_RAM_POWER_DOWN_LIBRARY))
    {
        power_up_unused_ram();
    }
    nrfx_gpiote_out_clear(CONTROL_PIN);
	LOG_DBG(&amp;quot;triggered reset pin&amp;quot;); //shouldn&amp;#39;t get to here
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In my testing I call &lt;code&gt;pin_reset() &lt;/code&gt;in main&amp;nbsp;after the 2 second delay&amp;nbsp;and led initialisation.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It seems like because the reset pin never goes low again it doesn&amp;#39;t complete a reset. You can see this using the &amp;quot;Boot Reset&amp;quot; button on the DK; if I hold the button down the device won&amp;#39;t reset, It&amp;#39;s only when I release the button does it reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/504031?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2024 15:45:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e32352b-f71a-48f1-b209-7b38bfa4ebe1</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thank you for this example. I&amp;#39;m able to reproduce the same here now, and it looks like the program hangs in the&amp;nbsp;SPU_IRQHandler when the WD times out.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1727365299753v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I will continue to debug this to try find out what is triggering the SPU IRQ.&amp;nbsp;&lt;/p&gt;
[quote user="hugzy123"]&lt;p&gt;I also tried connecting the RESET pin directly to a GPIO to trigger a pin reset instead of a software reset. However, when I attempted this, our custom board freezes after setting the GPIO low, I think its because the RESET pin&amp;nbsp;remains&amp;nbsp;low.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;This should work, but it is important that the GPIO is never becomes configured as an output low during boot. Is this GPIO&amp;nbsp;configured in the code your prodived?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/503965?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2024 11:49:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:402f4b93-839f-4348-b883-90bddbad897e</guid><dc:creator>hugzy123</dc:creator><description>&lt;p&gt;I also tried connecting the RESET pin directly to a GPIO to trigger a pin reset instead of a software reset. However, when I attempted this, our custom board freezes after setting the GPIO low, I think its because the RESET pin&amp;nbsp;remains&amp;nbsp;low.&lt;/p&gt;
&lt;p&gt;Do you know if it&amp;rsquo;s possible to trigger a pin reset using a GPIO on the same nRF53 controller?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/503961?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2024 11:40:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:796d460c-0743-47c1-b60e-f57bee16eb35</guid><dc:creator>hugzy123</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;Apologies for the delayed response; I&amp;rsquo;ve been tied up with other projects. I&amp;rsquo;ve now returned to this and managed to reproduce the issue on the nRF53 DK. I&amp;rsquo;ve attached a .zip file containing the source code, board files, and overlays.&lt;/p&gt;
&lt;p&gt;The firmware is designed to initialise and activate LED1 on the DK, stay active for 2 seconds, then reboot. This works as expected for the first ~4 reboots*, but after that, the device fails to reboot correctly. It hangs for around 30 seconds (until the WDT window elapses), at which point the watchdog timer kicks in and the device reboots properly. Strangely, this doesn&amp;rsquo;t happen when the RTT viewer is connected. The issue occurs regardless of whether I use &lt;code&gt;sys_reboot&lt;/code&gt; or &lt;code&gt;NVIC_SystemReset&lt;/code&gt; to trigger the reboot. The firmware is built using nRF SDK 2.2.0.&lt;/p&gt;
&lt;p&gt;*The issue tends to occur between the 3rd and 5th reboot.&lt;/p&gt;
&lt;p&gt;To compile and run the firmware:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set nRF toolchain and SDK to NCS v2.2.0&lt;/li&gt;
&lt;li&gt;Select &amp;quot;demo_boards_cpuapp_ns&amp;quot; as the board type&lt;/li&gt;
&lt;li&gt;Include the &lt;code&gt;overlay-rtt.conf&lt;/code&gt; Kconfig fragment&lt;/li&gt;
&lt;li&gt;Add &lt;code&gt;external_flash.overlay&lt;/code&gt; and &lt;code&gt;power_enhance.overlay&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Flash the firmware onto the DK&lt;/li&gt;
&lt;li&gt;Don&amp;#39;t connect to&amp;nbsp;RTT! Instead, connect via serial interface to view logs through UART&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Below is a screenshot of my build configuration from the nRF VS Code extension.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1727350319844v4.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When the issue arises (typically after 3-5 reboots), the logs will freeze on the following output for about&amp;nbsp;30 seconds.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1727350147255v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;After the WDT has elapsed the device will reset and boot.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1727350167412v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/demo_5F00_wdt_5F00_issue.zip"&gt;devzone.nordicsemi.com/.../demo_5F00_wdt_5F00_issue.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Let me know if you need anything more from me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/501534?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2024 12:07:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5df4614b-d5ef-42ac-b3a8-170393c46660</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The boot banner is printed during system initialization in bg_thread_main(), so normally it should appear once during the startup of mcuboot and then a second time when the application boots up.&lt;/p&gt;
&lt;p&gt;Is it possible to attach a debugger to your custom board? If not, do you think it would be possible to reproduce this on a DK so I can try to debug it here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/501493?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2024 08:45:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fd01b90-c917-42db-9a93-8cde7398141b</guid><dc:creator>hugzy123</dc:creator><description>[quote userid="4240" url="~/f/nordic-q-a/114321/firmware-reset-failing-with-mcuboot-and-wdt/500964"]I would have expected the &amp;quot;boot banner&amp;quot; to be printed before the WD reset if the system initialization in bg_thread_main() completed succesfully.&amp;nbsp;[/quote]
&lt;p&gt;There is a boot banner being printed, its actually printed three times; once just after the application reset, a second after the first bootloader sequence has finished and a third after the WDT reset and the second bootloader sequence.&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/114321/firmware-reset-failing-with-mcuboot-and-wdt/500964"]Could you place a breakpoint at the call to z_sys_init_run_level(INIT_LEVEL_POST_KERNEL); and another at the call to z_sys_init_run_level(INIT_LEVEL_APPLICATION); to check if both are reached?[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using UART so I can&amp;#39;t use breakpoints, however, I have added multiple log messages and observed the application reaches just before&amp;nbsp;&lt;span&gt;main&lt;/span&gt;&lt;span&gt;(); in the function&amp;nbsp;&lt;/span&gt;bg_thread_main on the first failed reset attempt (before the WDT reset).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/500964?ContentTypeID=1</link><pubDate>Tue, 03 Sep 2024 11:55:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a77a577-5e5d-4218-aa77-afc011ca77e2</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="hugzy123"]From what I can tell, it seems the application is hanging on the main() function inside bg_thread_main(). All the functions called before&amp;nbsp;main() appear to be exiting without any issues.[/quote]
&lt;p&gt;I would have expected the &amp;quot;boot banner&amp;quot; to be printed before the WD reset if the system initialization in bg_thread_main() completed succesfully.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/c0689b16ff127d1b71a4cc20310d476e1807e26e/kernel/init.c#L297"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/c0689b16ff127d1b71a4cc20310d476e1807e26e/kernel/init.c#L297&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you place a breakpoint at the call to z_sys_init_run_level(INIT_LEVEL_POST_KERNEL); and another at the call to z_sys_init_run_level(INIT_LEVEL_APPLICATION); to check if both are reached?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/500895?ContentTypeID=1</link><pubDate>Tue, 03 Sep 2024 08:17:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd60ed04-da56-4c55-835c-a0b557b3c976</guid><dc:creator>hugzy123</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;Thanks for your reply.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You&amp;#39;re right that the &amp;quot;CONFIG_BOOT_WATCHDOG_FEED&amp;quot; option is included by default in the mcuboot configuration.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;From what I can tell, it seems the application is hanging on the main() function inside bg_thread_main(). All the functions called before&amp;nbsp;main() appear to be exiting without any issues.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware Reset failing with MCUboot and WDT</title><link>https://devzone.nordicsemi.com/thread/500565?ContentTypeID=1</link><pubDate>Fri, 30 Aug 2024 11:21:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b3ac150-857e-4092-b911-412e87c6fb48</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;span&gt;CONFIG_BOOT_WATCHDOG_FEED symbol should be selected by default when the build target is a nRF device. You can confirm this by&amp;nbsp;if the symbol is set in the generated configuration file (build/mcuboot/zephyr/.conf). Either way, I would suggest that you try to make the WD timeout longer (e.g., 30 seconds), if you have not done so already. Then debug the device to see where it hangs when the program isn&amp;#39;t reaching main().&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Vidar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>