<?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 make the Nrf51822 flash jump successful without Softdevice?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/6323/how-to-make-the-nrf51822-flash-jump-successful-without-softdevice</link><description>Hi everyone,
I trying to make a flash jump on Nrf51822 in my project. there are 2 programs(program A and program B) below. i am working on to make program A jump to program B correctly. 
 my problem is in my applications, program A can jump to program</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 23 Oct 2017 11:06:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/6323/how-to-make-the-nrf51822-flash-jump-successful-without-softdevice" /><item><title>RE: How to make the Nrf51822 flash jump successful without Softdevice?</title><link>https://devzone.nordicsemi.com/thread/22060?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2017 11:06:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb84c83a-2b55-4f48-8bf3-4deee3847310</guid><dc:creator>anna</dc:creator><description>&lt;p&gt;Tank you very much.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make the Nrf51822 flash jump successful without Softdevice?</title><link>https://devzone.nordicsemi.com/thread/22059?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2017 11:03:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43ca0530-2ab0-4645-9dee-db6a839629c3</guid><dc:creator>anna</dc:creator><description>&lt;p&gt;@Hung Bui ，can you do me a favor ,I just did as what you said ,but could not succeed .The irq_handler still not work .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make the Nrf51822 flash jump successful without Softdevice?</title><link>https://devzone.nordicsemi.com/thread/22052?ContentTypeID=1</link><pubDate>Wed, 04 Nov 2015 11:27:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59e4e3b7-a692-4c5e-ac05-95fd275afd0c</guid><dc:creator>Alexis Duque</dc:creator><description>&lt;p&gt;Hi Hung Bui,
Do you have the GCC vesion for this exemple ? Specifically the interrupt_handler.c file ?
Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make the Nrf51822 flash jump successful without Softdevice?</title><link>https://devzone.nordicsemi.com/thread/22058?ContentTypeID=1</link><pubDate>Wed, 13 May 2015 15:22:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:426ae2ba-2e62-4d7c-b20c-beca603545a2</guid><dc:creator>bvrm</dc:creator><description>&lt;p&gt;Ok here we go
&lt;a href="https://devzone.nordicsemi.com/question/37844/interrupt-in-bootloader-not-working/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make the Nrf51822 flash jump successful without Softdevice?</title><link>https://devzone.nordicsemi.com/thread/22057?ContentTypeID=1</link><pubDate>Wed, 13 May 2015 14:25:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:188fe37b-19b7-45e4-af9b-ba7cb48cb48c</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@bvrm: please create a new question to discuss on the case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make the Nrf51822 flash jump successful without Softdevice?</title><link>https://devzone.nordicsemi.com/thread/22056?ContentTypeID=1</link><pubDate>Wed, 13 May 2015 13:40:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f49f0fc-8404-4dc5-ad37-ca5956ec1432</guid><dc:creator>bvrm</dc:creator><description>&lt;p&gt;I did some investigations:
R0 is loaded with 0x0000 0000 is above example.
When removing [WEAK] everything works as expected.
Leaving [WEAK] linker (Keil 5.14) is removing UART0_IRQHandler_Bootloader section.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Removing Unused input sections from the image.

    Removing main.o(.rev16_text), (4 bytes).
    Removing main.o(.revsh_text), (4 bytes).
    Removing main.o(i.init), (60 bytes).
    Removing uartreader.o(.rev16_text), (4 bytes).
    Removing uartreader.o(.revsh_text), (4 bytes).
    Removing uartreader.o(i.UART0_IRQHandler_Bootloader), (140 bytes).
    Removing uartreader.o(.bss), (50 bytes).
    Removing arm_startup_nrf51.o(HEAP), (1024 bytes).
    Removing system_nrf51.o(.rev16_text), (4 bytes).
    Removing system_nrf51.o(.revsh_text), (4 bytes).
    Removing system_nrf51.o(i.SystemCoreClockUpdate), (16 bytes).

11 unused section(s) (total 1314 bytes) removed from the image.
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make the Nrf51822 flash jump successful without Softdevice?</title><link>https://devzone.nordicsemi.com/thread/22055?ContentTypeID=1</link><pubDate>Wed, 13 May 2015 12:56:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3637d827-6a8b-468f-a83f-6b34b9cea927</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Thats probably because you do not have UART0_IRQHandler_Bootloader defined.
Make sure that your bootloader UART0 interrupt handler is named with the same name as you are refering here which is &lt;code&gt;void UART0_IRQHandler_Bootloader(void)&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make the Nrf51822 flash jump successful without Softdevice?</title><link>https://devzone.nordicsemi.com/thread/22054?ContentTypeID=1</link><pubDate>Wed, 13 May 2015 12:40:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:042b8788-48cb-423b-ae96-3c639570490b</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@bvrm: Please create  a new question, instead of posting a question as an answer.
In your new question please add information on:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Would you have problem when testing with my bootloader example in the .zip file ?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;What do you have in R0 when you LDR R0,=UART0_IRQHandler_Bootloader ?&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make the Nrf51822 flash jump successful without Softdevice?</title><link>https://devzone.nordicsemi.com/thread/22053?ContentTypeID=1</link><pubDate>Wed, 13 May 2015 09:47:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b076d4d-7c27-415d-bd25-2b983f4f7a41</guid><dc:creator>bvrm</dc:creator><description>&lt;p&gt;Hi Hung Bui&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using interrupt_handler.c for a bootloader without a softdevice. Interrupt handling in the main app seems to work fine. But interrupts in the bootloader leading to a reset.&lt;/p&gt;
&lt;p&gt;For example my uart interrupt.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;on an uart interrupt section bootloop is called&lt;/li&gt;
&lt;li&gt;jumps to uart0&lt;/li&gt;
&lt;li&gt;jumps to execute&lt;/li&gt;
&lt;li&gt;execute jumps to 0x0000 0000&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Why?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[uart.c]
void UART0_IRQHandler_Bootloader(void)
{
    // some code
}


[interrupt_handler.c]
bootload 
        CMP R0, #0x24;
        BEQ swi0
        CMP R0, #0x21;
        BEQ rtc1
        CMP R0, #0x16;
        BEQ gpiote
        CMP R0, #0x12;
        BEQ uart0
        //RETURN code needed
uart0
        EXTERN  UART0_IRQHandler_Bootloader[WEAK]     
        LDR    R0,=UART0_IRQHandler_Bootloader
        B execute ;            
execute            
        BX     R0  ;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make the Nrf51822 flash jump successful without Softdevice?</title><link>https://devzone.nordicsemi.com/thread/22051?ContentTypeID=1</link><pubDate>Wed, 01 Apr 2015 11:49:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:deb67358-45bc-4952-9ba0-7fec2301d0f1</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi lanxiang,&lt;/p&gt;
&lt;p&gt;You would need to forward the interrupts (vector table) from Program A to program B when you switch to program B.&lt;/p&gt;
&lt;p&gt;One solution is to use a flag to switch between 2 programs when calling the interrupt handler.&lt;/p&gt;
&lt;p&gt;You can have a look at the attached bootloader without softdevice, where we check for bootloader_active flag to decide if we should call the interrupt handler in bootloader or in application. Please have a look at the interrupt_handler.c file.&lt;/p&gt;
&lt;p&gt;The example&amp;#39;s pretty old though.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nrf51822_5F00_v4.4-_2D00_-Bootloader_5F00_Without_5F00_SD.zip"&gt;nrf51822_v4.4 - Bootloader_Without_SD.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>