<?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>General Purpose Registers</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24766/general-purpose-registers</link><description>Hi, 
 I am new to arm and ble development. I am used to work with AVR mcus and I am trying to migrate a project from AVR to nrf52. 
 AVR usually has some &amp;quot;General Purpose I/O Registers&amp;quot; free to use. They are called GPIORn and in spite of the name they</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 06 Dec 2025 22:12:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24766/general-purpose-registers" /><item><title>RE: General Purpose Registers</title><link>https://devzone.nordicsemi.com/thread/556397?ContentTypeID=1</link><pubDate>Sat, 06 Dec 2025 22:12:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffc3fbeb-2913-4c7a-9ded-39cd8b1e7ee1</guid><dc:creator>Gmrck</dc:creator><description>&lt;p&gt;Hi, Bjorn,&lt;br /&gt;&lt;br /&gt;Working with nrf52840DK latest revision here, nrfConnect SDK 3.0. When I try to use&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;nrf_power_gpregret_ext_get or&amp;nbsp;&lt;/span&gt;&lt;/span&gt;nrf_power_gpregret2_get functions I am getting the build&amp;nbsp;waring&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;warning: implicit declaration of function &amp;#39;nrf_power_gpregret_ext_get&amp;#39;; did you mean &amp;#39;nrf_power_gpregret_get&amp;#39;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;which ends up with the build failure.&lt;br /&gt;&lt;br /&gt;Then, looking at the documentation here&amp;nbsp;&lt;a id="" href="https://docs.nordicsemi.com/bundle/ncs-2.4.1/page/nrfx/drivers/power/hal.html"&gt;https://docs.nordicsemi.com/bundle/ncs-2.4.1/page/nrfx/drivers/power/hal.html&lt;/a&gt;&lt;br /&gt;I am confused with the NOTE next to the&amp;nbsp;&lt;span&gt;nrf_power_gpregret2_get function description:&lt;br /&gt;This register is not available in all MCUs.&lt;br /&gt;while a similar NOTE for&amp;nbsp;nrf_power_gpregret2_set says:&lt;br /&gt;This register is not available in the nRF51 MCU family.&lt;br /&gt;&lt;br /&gt;Is there a legal way to write into the gpregret2 register on nrf52840DK preferably&amp;nbsp; with using these functions?&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: General Purpose Registers</title><link>https://devzone.nordicsemi.com/thread/97534?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 13:20:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fa4cd5d-356f-489b-b4f0-dd18f19878a9</guid><dc:creator>Alemons</dc:creator><description>&lt;p&gt;Ok Bjørn, thank you for the answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: General Purpose Registers</title><link>https://devzone.nordicsemi.com/thread/97533?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 08:48:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bc87725-0540-49ea-a0b3-2555c129351d</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Alemons,&lt;/p&gt;
&lt;p&gt;Yes, the General Purpose Retained Registers(&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=2_1_0_17_8_6#register.GPREGRET"&gt;GPREGRET&lt;/a&gt; and &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=2_1_0_17_8_7#register.GPREGRET2"&gt;GPREGRET2&lt;/a&gt; ) can be freely used by the application to store flags etc.&lt;/p&gt;
&lt;p&gt;However, if you plan on adding DFU support to your product, then you should be aware that  GPREGRET register is used by to signal the device to enter bootloader mode. (The application writes a specific value to the GPREGRET register and performs a soft-reset. Upon a reset the device will pass execution to the bootloader first, which then checks the value of the GPREGRET register to determine if the device should stay in bootloader mode or pass execution to the application.&lt;/p&gt;
&lt;p&gt;In short, any flags stored in GPREGRET will be overwritten during a DFU.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>