<?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>INVALID MEMORY ACCESS when writing to NRF_POWER-&amp;gt;GPREGRET</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/30856/invalid-memory-access-when-writing-to-nrf_power--gpregret</link><description>I am trying to write to NRF_POWER-&amp;gt;GPREGRET to store some variables that should be retained through a software reset. 
 I am running SD 5, SDK 14 and using GCC to compile. 
 When I try to write to the register, i.e: 
 NRF_POWER-&amp;gt;GPREGRET = 0x01 
 The</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 Apr 2019 08:02:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/30856/invalid-memory-access-when-writing-to-nrf_power--gpregret" /><item><title>RE: INVALID MEMORY ACCESS when writing to NRF_POWER-&gt;GPREGRET</title><link>https://devzone.nordicsemi.com/thread/183011?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 08:02:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64922f6f-a9e2-4242-8dea-5fbcd4e35769</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Did you try setting the register to 0xB1? The tutorial say:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;quot;we write to the retention register GPREGRET a flag (BOOTLOADER_DFU_START = 0xB1) and then we do a soft reset.&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: INVALID MEMORY ACCESS when writing to NRF_POWER-&gt;GPREGRET</title><link>https://devzone.nordicsemi.com/thread/182646?ContentTypeID=1</link><pubDate>Wed, 17 Apr 2019 14:27:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a6d747a-9321-45ab-9cb8-2e85ebe30707</guid><dc:creator>Aftab</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m trying to do the same. In one of my custom BLE service, I&amp;#39;m calling this function:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;err_code = sd_power_gpregret_set(0, 0x01);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The project compiles successfully. But after setting this flag, if I power recycle the device, it does not boot into DFU mode, instead the default application (app) loads. Why writing the&amp;nbsp;&lt;span&gt;&lt;strong&gt;NRF_POWER-&amp;gt;GPREGRET = 0x01&lt;/strong&gt; is not working here?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The app was previously loaded through DFU. I&amp;#39;m following this tutorial which successfully works uploading the firmware first time:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/b/blog/posts/getting-started-with-nordics-secure-dfu-bootloader"&gt;https://devzone.nordicsemi.com/b/blog/posts/getting-started-with-nordics-secure-dfu-bootloader&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: INVALID MEMORY ACCESS when writing to NRF_POWER-&gt;GPREGRET</title><link>https://devzone.nordicsemi.com/thread/122199?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2018 20:32:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4b897ab-9aa1-4b44-ac16-8d8da02f12d7</guid><dc:creator>ishgum</dc:creator><description>&lt;p&gt;Thanks! I suspected that this might be the case but couldn&amp;#39;t find anything in the documentation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: INVALID MEMORY ACCESS when writing to NRF_POWER-&gt;GPREGRET</title><link>https://devzone.nordicsemi.com/thread/121940?ContentTypeID=1</link><pubDate>Mon, 26 Feb 2018 09:30:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3409f4b5-2e8a-455f-ac6f-309c6a4d67d8</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Then the softdevice is enabled, access to some peripherals is &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.sds/dita/softdevices/s130/sd_resource_reqs/hw_block_interrupt_vector.html?cp=2_3_1_0_6_0"&gt;blocked or restricted&lt;/a&gt;. The POWER peripheral have restricted access, which means it can be accessed through the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v5.0.0/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=2_3_1_1_0_2_7_2_16#ga62737e6515d380aa3eeba6582d061592"&gt;softdevice API&lt;/a&gt;, as mentioned by @&lt;a href="https://devzone.nordicsemi.com/members/hmolesworth"&gt;hmolesworth&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: INVALID MEMORY ACCESS when writing to NRF_POWER-&gt;GPREGRET</title><link>https://devzone.nordicsemi.com/thread/121903?ContentTypeID=1</link><pubDate>Mon, 26 Feb 2018 01:30:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5961131-99c9-4a0c-bc29-0ed19d2ff17e</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;When using the SoftDevice I would recommend using the formal interface. With no SoftDevice installed your code would work fine. Worth a try :-)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t resultCode = sd_power_gpregret_set(0, 0x01);

// For specification see here:

/**@brief Set bits in the general purpose retention registers (NRF_POWER-&amp;gt;GPREGRET*).
 *
 * @param[in] gpregret_id 0 for GPREGRET, 1 for GPREGRET2.
 * @param[in] gpregret_msk Bits to be set in the GPREGRET register.
 *
 * @retval ::NRF_SUCCESS
 */
SVCALL(SD_POWER_GPREGRET_SET, uint32_t, sd_power_gpregret_set(uint32_t gpregret_id, uint32_t gpregret_msk));
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>