<?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 jump to Application 2 from Application 1</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60035/how-to-jump-to-application-2-from-application-1</link><description>Hello ervery one, 
 I am doing development on NRF52840. I have a problem as follows looking forward to your guidance. 
 I need to jump to Application 2 (address: 0x32000) from Application 1 (address: 0x26000). I did not use Bootloader / DFU because it</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 May 2021 08:27:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60035/how-to-jump-to-application-2-from-application-1" /><item><title>RE: How to jump to Application 2 from Application 1</title><link>https://devzone.nordicsemi.com/thread/310043?ContentTypeID=1</link><pubDate>Tue, 18 May 2021 08:27:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:818c13c4-5731-4db9-8829-6b13bdb78d14</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="yunzhi"]But when start to perform ble_stack_init(), the program will hang in SVC_Handler.[/quote]
&lt;p&gt;&amp;nbsp;Does it get stuck in the SVC_Handler in your application? In that case, I would expect the same to happen when you call &lt;span&gt;sd_softdevice_vector_table_base_set&lt;/span&gt;() as well?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to jump to Application 2 from Application 1</title><link>https://devzone.nordicsemi.com/thread/309527?ContentTypeID=1</link><pubDate>Wed, 12 May 2021 13:43:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ed9c16b-bf19-4e60-86fe-f961f5f6fba5</guid><dc:creator>yunzhi</dc:creator><description>&lt;p&gt;Hi Vidar Berg.&lt;/p&gt;
&lt;p&gt;I have the same problem.&lt;/p&gt;
&lt;p&gt;Application 1 can jump to appliction 2&amp;nbsp; successfully without&amp;nbsp;any ble process.&lt;/p&gt;
&lt;p&gt;But when start to perform ble_stack_init(), the program will hang in SVC_Handler.&lt;/p&gt;
&lt;p&gt;I tried to add&amp;nbsp;&lt;span&gt;sd_softdevice_vector_table_base_set(APP2_ADDRESS) before&amp;nbsp;ble_stack_init(). It&amp;nbsp; hanged after this line.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to jump to Application 2 from Application 1</title><link>https://devzone.nordicsemi.com/thread/244666?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2020 10:13:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:792735e2-d09d-486e-840a-0a552134b564</guid><dc:creator>Vidar Berg</dc:creator><description>[quote user="TinhEBD18"]Log &amp;quot;Done&amp;quot; not reached on the terminal, the device is hang when I call&amp;nbsp;fn_jump_app()&amp;nbsp;[/quote]
&lt;p&gt;&amp;nbsp;That&amp;#39;s because it is branching to the reset handler of application &amp;quot;2&amp;quot;. Please post a screenshot of the CPU registers (shown on the left side when you debug in Keil) when the device hangs and post it here.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to jump to Application 2 from Application 1</title><link>https://devzone.nordicsemi.com/thread/244179?ContentTypeID=1</link><pubDate>Thu, 09 Apr 2020 14:42:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9c2e17b-d02e-4dd7-8825-175ecce7c520</guid><dc:creator>TinhEBD18</dc:creator><description>&lt;p&gt;Log &amp;quot;Done&amp;quot; not reached on the terminal, the device is hang when I call&amp;nbsp;fn_jump_app()&amp;nbsp; &amp;nbsp;or&amp;nbsp;&amp;nbsp;sd_softdevice_vector_table_base_set(0x32000).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to jump to Application 2 from Application 1</title><link>https://devzone.nordicsemi.com/thread/244174?ContentTypeID=1</link><pubDate>Thu, 09 Apr 2020 12:56:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e407d3a7-c9f0-4c63-96cc-0774414d9049</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Trying to jump to another application in plain C is asking for trouble, but it might work if the compiler optimized the code properly.&lt;/p&gt;
&lt;p&gt;I recommend checking the disassembly of jump_to_application() in a debugger.&lt;/p&gt;
&lt;p&gt;The problem is that local variables on the stack are no longer accessible once the new MSP value is set.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Edit: The &amp;quot;Done&amp;quot; debug message should be changed to &amp;quot;Failed&amp;quot;, since this code cannot be reached.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to jump to Application 2 from Application 1</title><link>https://devzone.nordicsemi.com/thread/244160?ContentTypeID=1</link><pubDate>Thu, 09 Apr 2020 09:04:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07229ad1-bd89-46c0-b1fb-dae4145a0cb7</guid><dc:creator>TinhEBD18</dc:creator><description>&lt;p&gt;Hi Turbo, Tks you for your support.&lt;/p&gt;
&lt;p&gt;1, I use KeilC,&amp;nbsp;I don&amp;#39;t know if my settings are correct! (This is Application 2, Image bellow)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2, Call funtion&amp;nbsp;sd_softdevice_vector_table_base_set(0x32000) in application 1? Right&lt;/p&gt;
&lt;p&gt;3, This is my code for jump to application 2:&lt;/p&gt;
&lt;p&gt;Tks you so much!&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void jump_to_application(void)
{
	uartSendDBG((uint8_t *)&amp;quot;Function jump bl\r\n&amp;quot;, strlen(&amp;quot;Function jump bl\r\n&amp;quot;));
	void (*fn_jump_app)(void);
	uint32_t msp_value = *(volatile uint32_t *)FLASH_ADDRESS_APPLICATION_PRIMARY;
	__set_MSP(msp_value);
	uint32_t resetHandler = *(volatile uint32_t *)(FLASH_ADDRESS_APPLICATION_PRIMARY+4U);
	fn_jump_app = (void *)resetHandler;
	fn_jump_app();
	uartSendDBG((uint8_t *)&amp;quot;Done\r\n&amp;quot;, strlen(&amp;quot;Done\r\n&amp;quot;));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/618x465/__key/communityserver-discussions-components-files/4/5140.1.PNG" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/618x465/__key/communityserver-discussions-components-files/4/3718.2.PNG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to jump to Application 2 from Application 1</title><link>https://devzone.nordicsemi.com/thread/244159?ContentTypeID=1</link><pubDate>Thu, 09 Apr 2020 08:47:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e270f4a5-ee88-4f67-a5d3-3eae7e2e2aec</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Fist things first: App2 must be linked to address 0x32000 - check the linker settings / linker script.&lt;/p&gt;
&lt;p&gt;Secondly use the folowing function to set the vector table base in softdevice:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;sd_softdevice_vector_table_base_set(0x32000);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Third: Load the SP and PC from the fist two words at 0x32000 - this starts the actual execution. May need some inline assembly in order to work across all compiler optimization settings.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>