<?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>Installing ESB when using bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10460/installing-esb-when-using-bootloader</link><description>I am doing a bootloader to support updates via ESB. I am using MicroLib. I am not using SoftDevice. 
 My project mapping: 
 Bootloader 0x0000-0xBFF
Application Vector Table 0xC00
Application 0x1000-0x7FFF 
 My bootloader pulls the reset vector out</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 27 Nov 2015 19:19:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10460/installing-esb-when-using-bootloader" /><item><title>RE: Installing ESB when using bootloader</title><link>https://devzone.nordicsemi.com/thread/38878?ContentTypeID=1</link><pubDate>Fri, 27 Nov 2015 19:19:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19b559dd-d488-4173-98a9-3c65ac6cd9f4</guid><dc:creator>Scott</dc:creator><description>&lt;p&gt;Here is the interrupt handler in my bootloader. It shows how the interrupts are forwarded to the application. I have verified it.&lt;/p&gt;
&lt;p&gt;NMI_Handler
..
..
SWI0_IRQHandler&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;EXPORT NMI_Handler
    ..
    ..
EXPORT SWI0_IRQHandler
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;APPLICATION_VECTOR_TABLE        EQU   0x0C00&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;MRS  R0, PSR
; Mask to get the interrupt number
ANDS R0, R0, #0x3F
EXTERN bootloader_active
LDR  R1, =bootloader_active
LDR  R2, [R1]
CMP  R2, #1
BEQ  bootload
LDR  R2, =APPLICATION_VECTOR_TABLE
; 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

; Bootloader IRQ handlers - currently none used
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;bootload
CMP R0, #27
BEQ RTC0&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;; RETURN code needed?
; RTC0 put here for sample. Copy as needed.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;RTC0
EXTERN RTC0_IRQHandler_Bootloader[WEAK]
LDR	R0,=RTC0_IRQHandler_Bootloader
B execute&lt;/p&gt;
&lt;p&gt;execute
BX R0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Installing ESB when using bootloader</title><link>https://devzone.nordicsemi.com/thread/38877?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2015 18:39:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bf12044-6cc3-4447-81d2-9fc4dfbf643e</guid><dc:creator>Scott</dc:creator><description>&lt;p&gt;You are correct - table starts at 0xC00. Can you provide the link to the SDK example? I can&amp;#39;t seem to locate it. Is there a way to locate the application vector table at an address other than 0x00000000? I don&amp;#39;t have a reason for my method. I assume this has already been solved somewhere, but I can&amp;#39;t locate the appropriate example.&lt;/p&gt;
&lt;p&gt;I have verified that the interrupts are forwarded correctly in my routine. See my modified question above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Installing ESB when using bootloader</title><link>https://devzone.nordicsemi.com/thread/38876?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2015 13:41:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:074320bb-b469-49ca-857d-c4b290e7e59f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi, you need to forward execution to the reset handler of the application in order for the application to be properly initialized (load static variables, vector table, etc.) __main. Assume 0xC000 is a typo, should be 0xC00(?),but  is there a particular reason for not linking the application vector table together with the application like in the SDK examples?&lt;/p&gt;
&lt;p&gt;That being said, it does sound like the interrupts are not being forwarded correctly from the bootloader to the app. I would suggest to try a simple example that uses interrupts (e.g,\nRF51_SDK_10.0.0\examples\peripheral\led_softblink) and see whether or not the interrupts are being forwarded correctly from the bootloader.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>