<?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>NRF51 simple vector deflection function?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21545/nrf51-simple-vector-deflection-function</link><description>I use STM32F4+nRF51822 through the SPI interface. I want to achieve nRF51822 DFU with SPI operation, now upgrade the simple LED to work properly. But can not work when using Gazlle.
I know it is because the interrupt vector table is not offset, but I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 02 May 2017 13:34:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21545/nrf51-simple-vector-deflection-function" /><item><title>RE: NRF51 simple vector deflection function?</title><link>https://devzone.nordicsemi.com/thread/84594?ContentTypeID=1</link><pubDate>Tue, 02 May 2017 13:34:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f38e73ea-e47d-4195-8a53-69e151d49acc</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Xiao,&lt;/p&gt;
&lt;p&gt;You meant you couldn&amp;#39;t enter SPI interrupt when in the bootloader or when in the application ?
You set Bootloader_active = 1 when you are in bootloader and set it to 0 when you exit the bootloader before you jump to your application.&lt;/p&gt;
&lt;p&gt;You can simply add a break point inside  BranchIntHandler() and check what happens there when you receive a SPI interrupt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51 simple vector deflection function?</title><link>https://devzone.nordicsemi.com/thread/84593?ContentTypeID=1</link><pubDate>Tue, 02 May 2017 09:56:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2579b0ea-2f59-44fa-82b2-38705ccfdc0b</guid><dc:creator>xiao</dc:creator><description>&lt;p&gt;hi ,
The last time that the example does not work, do you have a simple way to achieve?
My entire circuit framework is as follows.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0116.nRF51822.png" alt="image description" /&gt;&lt;/p&gt;
&lt;p&gt;2、I use the SPI interface, but has been unable to enter the SPI interrupt. My application starts with 0x0000C000. Bootloader_active = 1 at the beginning of the program; can you help me to see why?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;__asm void BranchIntHandler(void) {
            MRS    R0, PSR ;
            /* Mask the interrupt number only */
            MOVS   R1, #0x3F  ; 
            ANDS   R0, R1     ; /*R0 keeps the interrupt number*/
            extern bootloader_active;
            LDR R1 , =bootloader_active;
            LDR R2, [R1];
            CMP R2,#1;
            BEQ bootload;
            LDR     R2, =0x0000C000;
            /* Irq address position = IRQ No * 4 */
            LSLS   R0, R0, #2 ;
            /* Fetch the user vector offset */
            LDR    R0, [R0, R2];
            /* Jump to user interrupt vector */
            BX     R0  ;
            
bootload 
            CMP R0, #0x24;
            BEQ swi0
            CMP R0, #0x21;
            BEQ rtc1
            CMP R0, #0x16;
            BEQ gpiote
            CMP R0, #0x12;
            BEQ uart0
						CMP R0, #0x14;
            BEQ spi1
            //RETURN code needed
swi0            
            EXTERN SWI0_IRQHandler_Bootloader[WEAK]
            LDR    R0,=SWI0_IRQHandler_Bootloader
            B execute ;    
            
rtc1            
            EXTERN  RTC1_IRQHandler_Bootloader[WEAK] 
            LDR    R0,=RTC1_IRQHandler_Bootloader
            B execute ;
						
spi1            
            EXTERN  SPI1_TWI1_IRQHandler_Bootloader[WEAK] 
            LDR    R0,=SPI1_TWI1_IRQHandler_Bootloader
            B execute ;
            
uart0
            EXTERN  UART0_IRQHandler_Bootloader[WEAK]     
            LDR    R0,=UART0_IRQHandler_Bootloader
            B execute ;            
gpiote            
            EXTERN  GPIOTE_IRQHandler_Bootloader[WEAK]     
            LDR    R0,=GPIOTE_IRQHandler_Bootloader
                                 
execute            
            BX     R0  ;
            
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51 simple vector deflection function?</title><link>https://devzone.nordicsemi.com/thread/84592?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2017 14:18:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9595ddb-6669-47b5-8af9-9b238904c940</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Xiao: We have an example and some explanation &lt;a href="https://devzone.nordicsemi.com/question/52909/nrf51-bootloader-without-softdevice-sdk-810/"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>