<?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>How to include UICR in hex</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71411/how-to-include-uicr-in-hex</link><description>Please tell me how to include UICR in hex in the following environment. CPU: nRF51822 Integrated environment: keil</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 17 Feb 2021 09:59:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71411/how-to-include-uicr-in-hex" /><item><title>RE: How to include UICR in hex</title><link>https://devzone.nordicsemi.com/thread/294783?ContentTypeID=1</link><pubDate>Wed, 17 Feb 2021 09:59:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b43aa738-1d3d-47b4-8bb1-cd635d38bd28</guid><dc:creator>yama123</dc:creator><description>&lt;p&gt;I added the following and built it, but I could not place the data at any fixed address.&lt;br /&gt;Please let me know if there are any mistakes.&lt;br /&gt;------&lt;br /&gt;main.c&lt;br /&gt;------&lt;br /&gt;volatile uint32_t m_uicr_clenr0 __attribute__ ((section(&amp;quot;.uicr_clenr0&amp;quot;))) = 0x00018000;&lt;br /&gt;volatile uint32_t m_uicr_rbpconf __attribute__ ((section(&amp;quot;.uicr_rbpconf&amp;quot;))) = 0xFFFFFFFF;&lt;br /&gt;------&lt;/p&gt;
&lt;p&gt;There is no &amp;quot;Memory Segments&amp;quot; in SEGGER version V4.12.&lt;br /&gt;I edited flash_placement.xml with an editor.&lt;br /&gt;-------------------&lt;br /&gt;flash_placement.xml&lt;br /&gt;-------------------&lt;br /&gt; &amp;lt;MemorySegment name=&amp;quot;uicr_clenr0&amp;quot; start=&amp;quot;0x10001000&amp;quot; size=&amp;quot;0x4&amp;quot;&amp;gt;&lt;br /&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_clenr0&amp;quot; address_symbol=&amp;quot;__start_uicr_clenr0&amp;quot; end_symbol=&amp;quot;__stop_uicr_clenr0&amp;quot; start = &amp;quot;0x10001000&amp;quot; size=&amp;quot;0x4&amp;quot; /&amp;gt;&lt;br /&gt; &amp;lt;/MemorySegment&amp;gt;&lt;br /&gt; &amp;lt;MemorySegment name=&amp;quot;uicr_rbpconf&amp;quot; start=&amp;quot;0x10001004&amp;quot; size=&amp;quot;0x4&amp;quot;&amp;gt;&lt;br /&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_rbpconf&amp;quot; address_symbol=&amp;quot;__start_uicr_rbpconf&amp;quot; end_symbol=&amp;quot;__stop_uicr_rbpconf&amp;quot; start = &amp;quot;0x10001004&amp;quot; size=&amp;quot;0x4&amp;quot; /&amp;gt;&lt;br /&gt; &amp;lt;/MemorySegment&amp;gt;&lt;br /&gt;-------------------&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to include UICR in hex</title><link>https://devzone.nordicsemi.com/thread/294762?ContentTypeID=1</link><pubDate>Wed, 17 Feb 2021 08:12:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bce3d879-5e88-45ff-a9ed-31ef207e9127</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, it is the same principle with other toolchains as well, though the actual implementation differs. You can refer to for instance how it is done with&amp;nbsp;m_uicr_bootloader_start_address for SES in SDK 17.0.2 (or older, though none of the SDK versions with nRF51 support include SES projects).&lt;/p&gt;
&lt;p&gt;Specifically, you have this part in nrf_bootlaoder_info.c:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    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;and in flash_placement.xml that segment is defined:&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;And under&amp;nbsp;linker_section_placements_segments in the emProject file you also list&amp;nbsp;uicr_bootloader_start_address. This can be done by editing the emProject file in an editor or from the GUI:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/gui.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;Yere you could modify the name and address of this section so that you can place any data at any fixed address in the hex file.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to include UICR in hex</title><link>https://devzone.nordicsemi.com/thread/294737?ContentTypeID=1</link><pubDate>Wed, 17 Feb 2021 01:10:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec08428e-00ca-49c2-aaaf-2bf10f28f848</guid><dc:creator>yama123</dc:creator><description>&lt;p&gt;thank you for your answer.&lt;br /&gt;Is it possible to include UICR in HEX in this way even in the integrated environment SEGGER?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to include UICR in hex</title><link>https://devzone.nordicsemi.com/thread/293251?ContentTypeID=1</link><pubDate>Mon, 08 Feb 2021 08:28:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1cd5be2-22e9-4c04-8e67-90a641de9628</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is an example of this in the SDK, where the bootloader start address is written to the UICR. You can use the same approach to place a constant at any other part of the UICR (of flash in general). Specifically this is the relevant line from SDK 12.3:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t m_uicr_bootloader_start_address __attribute__((at(NRF_UICR_BOOT_START_ADDRESS))) = BOOTLOADER_REGION_START;      /**&amp;lt; This variable ensures that the linker script will write the bootloader start address to the UICR register. This value will be written in the HEX file and thus written to UICR when the bootloader is flashed into the chip. */&lt;/pre&gt;The address is in the UICR as you see here:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define NRF_UICR_BOOT_START_ADDRESS     (NRF_UICR_BASE + 0x14)                                  /**&amp;lt; Register where the bootloader start address is stored in the UICR register. */&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;(just change the offset to use another part of the UICR)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>