<?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>Initial Start-up &amp;quot;load once&amp;quot; data / absolute flash allocation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80794/initial-start-up-load-once-data-absolute-flash-allocation</link><description>I have a structure that holds my configuration data for my device. When manufactured, the programming station will flash a hex file to device that has the application and device specific data to a certain location in flash--the device specific data will</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Oct 2021 12:03:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80794/initial-start-up-load-once-data-absolute-flash-allocation" /><item><title>RE: Initial Start-up "load once" data / absolute flash allocation</title><link>https://devzone.nordicsemi.com/thread/334854?ContentTypeID=1</link><pubDate>Tue, 19 Oct 2021 12:03:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64d8f54f-059f-45c4-99ad-21a6ddc882ae</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There bootloader examples in the nRF5 SDK demonstrate how you can place data at a specific location in flash. Specifically this is used to place the 4 byte addresses of the bootloader and the MBR params page in the UICR. However, the exact same approach can be used to place any type of data of any size at any location. I suggest you refer to how it is done for the bootloader start address in UICR and do the same in your case. You do not write which toolchain you use so I will explain for Segger Embedded Studio (SES), but if you refer to a bootloader example you can see how this is done in a similar way for other toolchains.&lt;/p&gt;
&lt;p&gt;In flash_placement.xml you have this part where the start address and size of the segment is specified. Do the same, just with a different name, address (not in UCIR but in normal flash in yoru case), and size:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="xml"&gt;  &amp;lt;MemorySegment name=&amp;quot;uicr_bootloader_start_address&amp;quot; start=&amp;quot;0x10001014&amp;quot; size=&amp;quot;0x4&amp;quot;&amp;gt;
    &amp;lt;ProgramSection alignment=&amp;quot;4&amp;quot; keep=&amp;quot;Yes&amp;quot; load=&amp;quot;Yes&amp;quot; name=&amp;quot;.uicr_bootloader_start_address&amp;quot; address_symbol=&amp;quot;__start_uicr_bootloader_start_address&amp;quot; end_symbol=&amp;quot;__stop_uicr_bootloader_start_address&amp;quot; start = &amp;quot;0x10001014&amp;quot; size=&amp;quot;0x4&amp;quot; /&amp;gt;
  &amp;lt;/MemorySegment&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;then you can see in&amp;nbsp;components\libraries\bootloader\nrf_bootloader_info.c how a variable is declared and placed at this location. You can do the same, but using your struct instead of a uint32_t:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define UICR_BOOTLOADER_ADDR 0x10001014
...
    volatile uint32_t m_uicr_bootloader_start_address  __attribute__ ((section(&amp;quot;.uicr_bootloader_start_address&amp;quot;)))
                                            = BOOTLOADER_START_ADDR;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In the SES project you also need to add this to the&amp;nbsp;linker_section_placements_segments list, most easily by editing the .emProject in a text editor and make sur it is part of the list like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="xml"&gt;      linker_section_placements_segments=&amp;quot;FLASH1 RX 0x0 0x80000;RAM1 RWX 0x20000000 0x10000;mbr_params_page RX 0x0007E000 0x1000;bootloader_settings_page RX 0x0007F000 0x1000;uicr_bootloader_start_address RX 0x10001014 0x4;uicr_mbr_params_page RX 0x10001018 0x4&amp;quot;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;With this you can access the array at that specific location in your code and copy it to FDS as you write, in the same way as you would write any other FDS record.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>