<?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>Avoid nonit region to be overridden by MCUBoot</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/108439/avoid-nonit-region-to-be-overridden-by-mcuboot</link><description>Hi, 
 I&amp;#39;m using the nRF Connect SDK 2.5.1 with the nRF5340 and MCUBoot as bootloader. I want to store some information about the reboot reason (and some other stuff) in the noinit region to save it across a restart. I placed the variables in the noinit</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Mar 2024 14:20:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/108439/avoid-nonit-region-to-be-overridden-by-mcuboot" /><item><title>RE: Avoid nonit region to be overridden by MCUBoot</title><link>https://devzone.nordicsemi.com/thread/474371?ContentTypeID=1</link><pubDate>Mon, 18 Mar 2024 14:20:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:574720a6-6bf7-45a9-88ff-6608d4b9c8a3</guid><dc:creator>colar</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;thanks, that seems to work. When using the device tree as in the retention system the RAM partition is reduced for all images including MCUBoot, so the retention section will then only used by the retention system (it takes the address then from the device tree).&lt;/p&gt;
&lt;p&gt;Besides using the retention API it is also possible to just declare a memory section in the device tree and then place variables in there with &lt;code&gt;__attribute__((__section__(&amp;quot;.anotherretainedsection&amp;quot;)))&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Here is an example device tree overlay for a nRF5340:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ {
    soc {
        sram0: memory@20000000 {
            compatible = &amp;quot;mmio-sram&amp;quot;;
            reg = &amp;lt;0x20000000 0x7e000&amp;gt;;  // reduce SRAM size 
        };

        retentionram: memory@2007f000 {  // new node for the retention RAM
            compatible = &amp;quot;zephyr,memory-region&amp;quot;, &amp;quot;mmio-sram&amp;quot;;
            reg = &amp;lt;0x2007f000 0x1000&amp;gt;;
            zephyr,memory-region = &amp;quot;RetainedMem&amp;quot;;
            status = &amp;quot;okay&amp;quot;;

            retainedmem {
                compatible = &amp;quot;zephyr,retained-ram&amp;quot;;
                status = &amp;quot;okay&amp;quot;;
                #address-cells = &amp;lt;1&amp;gt;;
                #size-cells = &amp;lt;1&amp;gt;;

                /* This creates a 256-byte partition */
                retention0: retention@0 {
                    compatible = &amp;quot;zephyr,retention&amp;quot;;
                    status = &amp;quot;okay&amp;quot;;
                    reg = &amp;lt;0x0 0x100&amp;gt;;  // adjust this and other partitions as necessary
                    prefix = [08 04];
                    checksum = &amp;lt;1&amp;gt;;
                };
            };
        };

        anotherretainedsection: memory@2007e000 {  // new node for the retention RAM
            compatible = &amp;quot;zephyr,memory-region&amp;quot;, &amp;quot;mmio-sram&amp;quot;;
            reg = &amp;lt;0x2007e000 0x1000&amp;gt;;
            zephyr,memory-region = &amp;quot;anotherretainedsection&amp;quot;;
            status = &amp;quot;okay&amp;quot;;
        };
    };

};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Lars&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid nonit region to be overridden by MCUBoot</title><link>https://devzone.nordicsemi.com/thread/470158?ContentTypeID=1</link><pubDate>Thu, 22 Feb 2024 07:51:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1217440-85fb-4ef2-8201-7715724077a2</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Colar,&lt;/p&gt;
&lt;p&gt;I think it is a bit complicated and untested waters to try to edit MCUboot linker scripts to sync it with application specific mem regions.&lt;/p&gt;
&lt;p&gt;But there is this &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.2/zephyr/services/retention/index.html"&gt;retention system &lt;/a&gt;that you try to use. Configuring the DTS seems the biggest part in it but use in the source code seems quite simple.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid nonit region to be overridden by MCUBoot</title><link>https://devzone.nordicsemi.com/thread/470023?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2024 13:00:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7313ba7c-88bb-4740-89e8-b0db0e7c728c</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="colar"]I disabled MCUBoot and tested my noinit region - and it works as expected.[/quote]
&lt;p&gt;OK, I did not get to the point until now that MCUBoot is the actual cause.This topic seems to have been discussed &lt;a href="https://devzone.nordicsemi.com/support-private/support/322364/This%20topic%20seems%20to%20be%20discussed"&gt;here&lt;/a&gt;&amp;nbsp;without any clear specific instructions to edit MCUBoot&amp;nbsp; linker script.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have asked the MCUBoot expert to help me point out to configuration settings to tell the bootloader not to touch the application specific noinit configuration. This might not be that straight forward.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid nonit region to be overridden by MCUBoot</title><link>https://devzone.nordicsemi.com/thread/469957?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2024 08:29:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2ccdc0b-cea0-42d0-b919-88ba276a75f4</guid><dc:creator>colar</dc:creator><description>&lt;p&gt;This is precisely the thread I referenced in my initial question. However, I&amp;#39;m struggling to see how the answer is relevant to my situation, as it pertains to retaining RAM in the &amp;quot;system off&amp;quot; state for the nRF52 series. This state should not be reached during a software reset, such as a hard fault, which I am using for testing. Moreover, if retention were the issue, I would expect to see all zeros in the memory, not 0xFF everywhere. They mention specifying a &lt;code&gt;noinit&lt;/code&gt; region, which I have also done.&lt;br /&gt;&lt;br /&gt;To make sure MCUBoot is the problem, I disabled MCUBoot and tested my noinit region - and it works as expected. So my initial question remains: &lt;strong&gt;How do I make sure the noinit region does not overlap with memory sections from my bootloader? Linker script, partition manager?&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid nonit region to be overridden by MCUBoot</title><link>https://devzone.nordicsemi.com/thread/469941?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2024 06:42:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3dfa914a-63b9-4eb5-85af-0210c3843326</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hmm, it is possible that MCUBoot is messing with your configuration in the app. But before we can look into the MCUBoot side, can you see if the method mentioned in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/98202/noinit-region-of-ram-to-store-data-between-reboots/417836"&gt;this thread&amp;nbsp;&lt;/a&gt;any different results.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid nonit region to be overridden by MCUBoot</title><link>https://devzone.nordicsemi.com/thread/469761?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2024 11:20:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93f69fe5-0b67-4334-9e91-d6cf67d919f0</guid><dc:creator>colar</dc:creator><description>&lt;p&gt;No, the volatile keyword does not change it.&lt;/p&gt;
&lt;p&gt;I think it comes from the placement of the sections noinit in my app and mock_flash the bootloader. When the device restarts, the bootloader overrides the whole noinit section of my app as mock_flash is the RAM section used by the flash simulator used by MCUBoot.&lt;/p&gt;
&lt;p&gt;So I should probably make sure the noinit region is not used by any RAM section of MCUBoot - but how?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Avoid nonit region to be overridden by MCUBoot</title><link>https://devzone.nordicsemi.com/thread/469757?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2024 11:04:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:006f17ba-469f-4070-9d86-cf7dfa15a8a3</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Seems to work for most, I have used different __attribute__ when using Segger but I think it is different with different compiler.&lt;/p&gt;
&lt;p&gt;Do you think the volatile keyword might be causing this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>