<?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>noinit section at a specific address</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/103103/noinit-section-at-a-specific-address</link><description>We&amp;#39;re using a noinit section of ram to store a &amp;quot;reboot reason&amp;quot; if/when we need to do a SW reset (i.e. in a watchdog handler). 
 This works as expected, we set the reboot reason before calling sys_reboot(), and then read it out after the reboot. 
 However</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 Jul 2024 13:01:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/103103/noinit-section-at-a-specific-address" /><item><title>RE: noinit section at a specific address</title><link>https://devzone.nordicsemi.com/thread/495219?ContentTypeID=1</link><pubDate>Tue, 23 Jul 2024 13:01:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1db8412e-dcad-4399-a55c-8acb38cd84c1</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I will continue to help with this ticket&lt;/p&gt;
&lt;p&gt;Maybe the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/security/bootloader/fw_info.html#binary-compatibility"&gt;fw_info library&lt;/a&gt; could be useful for you?&lt;br /&gt;Not directly, but for two reasons:&lt;/p&gt;
&lt;p&gt;The fw_info library finds an unknown place in flash by searching through it all for a magic number.&lt;br /&gt;Maybe you could use a similar solution to find whawt you are looking for in RAM? Then, it would not matter that it moves.&lt;/p&gt;
&lt;p&gt;Also, the fw_info docs say &lt;br /&gt;&amp;quot;&lt;br /&gt;The structure also contains the location of a RAM buffer into which a pointer to a matching EXT_API can be placed before booting. The RAM buffer must not be initialized or otherwise touched when booting the image, to ensure that the value written there before booting is preserved. The &lt;a title="EXT_API_REQ" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/security/bootloader/fw_info.html#c.EXT_API_REQ"&gt;&lt;code&gt;&lt;span&gt;EXT_API_REQ&lt;/span&gt;&lt;/code&gt;&lt;/a&gt; helper macro uses the &lt;code&gt;&lt;span&gt;__noinit&lt;/span&gt;&lt;/code&gt; decorator provided by Zephyr to achieve this.&lt;br /&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;Which maybe sound similar to what you have here?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: noinit section at a specific address</title><link>https://devzone.nordicsemi.com/thread/494565?ContentTypeID=1</link><pubDate>Thu, 18 Jul 2024 12:11:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f46ca96-d5e4-4b03-8310-e14d589d11ea</guid><dc:creator>Alfie321</dc:creator><description>&lt;p&gt;No, this is still unsolved, the noinit-section is not static, and might be moved between builds.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: noinit section at a specific address</title><link>https://devzone.nordicsemi.com/thread/494498?ContentTypeID=1</link><pubDate>Thu, 18 Jul 2024 08:20:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8ef6e23-04b6-4627-aa62-8571d0a7c92c</guid><dc:creator>td-pradecki</dc:creator><description>&lt;p&gt;Hello Alf, have you eventually maanged to find a solution? I am facing the same problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: noinit section at a specific address</title><link>https://devzone.nordicsemi.com/thread/443508?ContentTypeID=1</link><pubDate>Tue, 29 Aug 2023 09:06:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a16eef9b-9c7f-4fc3-ac6a-4e6e4a9596db</guid><dc:creator>Alfie321</dc:creator><description>&lt;p&gt;Hi &amp;Oslash;yvind, and thanks for detailing!&lt;/p&gt;
&lt;p&gt;We&amp;#39;re running SDK v2.0.2 currently.&lt;/p&gt;
&lt;p&gt;The code for declaring&amp;nbsp;the &lt;em&gt;reboot_reason&lt;/em&gt; variable is this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**
 * @brief Reboot reason stored in noinit RAM between reboots
 */
static uint32_t reboot_reason_stored __attribute__((section(&amp;quot;.noinit&amp;quot;)));
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And this works, the &lt;em&gt;reboot_reason&lt;/em&gt; variable is not cleared between reboots.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve read through you recommended doc, and have now put this section into the &lt;em&gt;pm_static.yml&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# RAM
noinit_sram:
    address: 0x20000000
    size: 32
    region: sram_primary

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This seems to work as expected, it is now created a separate region (0x20000000 - 0x20000020), but how to &amp;quot;connect&amp;quot; the .noinit section (in the code) to the noinit_sram region?&lt;/p&gt;
&lt;p&gt;I cannot seem to find any good examples (in the doc) for this,&amp;nbsp;are you able to point me in the right direction?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;TIA&lt;/p&gt;
&lt;p&gt;-Alf&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: noinit section at a specific address</title><link>https://devzone.nordicsemi.com/thread/443217?ContentTypeID=1</link><pubDate>Fri, 25 Aug 2023 20:39:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79b68347-7c93-4207-a871-10561f154ed3</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Sorry for the late reply, Alt. What version of the nRF Connect SDK are you working on?&lt;/p&gt;
&lt;p&gt;From your description it sounds like you need to configure a &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.0/nrf/scripts/partition_manager/partition_manager.html#static-configuration"&gt;static configuration in the Partition Manager&lt;/a&gt;.You can use pm.yml from the original project and copy this to the new FOTA image. Rename this file to pm_static.yml.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you provide more details if this is not the case?&lt;br /&gt;&lt;br /&gt;Thanks!&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: noinit section at a specific address</title><link>https://devzone.nordicsemi.com/thread/442845?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2023 20:36:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:162768eb-c704-4811-a810-4efa22bb044b</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello Alf,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I will have a look at your case and get back to you within Thursday.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>