<?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>Suggested way of running 2 different functionalities in single HEX file?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/78674/suggested-way-of-running-2-different-functionalities-in-single-hex-file</link><description>Hello All, 
 I have a specific requirement to run 2 different functionalities from the same HEX file. Can someone suggest is there any means of special logic in the nRF52 boot code for this? 
 
 One thought of using external GPIO or something to trigger</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 Aug 2021 08:59:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/78674/suggested-way-of-running-2-different-functionalities-in-single-hex-file" /><item><title>RE: Suggested way of running 2 different functionalities in single HEX file?</title><link>https://devzone.nordicsemi.com/thread/325429?ContentTypeID=1</link><pubDate>Wed, 18 Aug 2021 08:59:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a85c93c-b6d2-4221-b737-ad112f829964</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is a &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html#register.RESETREAS"&gt;NRF_POWER-&amp;gt;RESETREAS&lt;/a&gt; register you can use to check the reset reason.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To execute a soft reset you can run NVIC_SystemReset() from the application at any time, which will set the soft reset bit in RESETREAS on startup. If you write to &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=4_2_0_17_8_6#register.GPREGRET"&gt;NRF_POWER-&amp;gt;GPREGRET&lt;/a&gt; and &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=4_2_0_17_8_7#register.GPREGRET2"&gt;NRF_POWER-&amp;gt;GPREGRET2&lt;/a&gt;&amp;nbsp;(each can contain 8bits)&amp;nbsp;before execute soft reset, then you can check on startup the GPREGRET registers to find for instance which code you want to run on startup.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>