<?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>Custom bootloader: Can&amp;#39;t reach interrupt handler</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43835/custom-bootloader-can-t-reach-interrupt-handler</link><description>Hello, 
 We&amp;#39;re trying to create a custom bootloader from scratch and we&amp;#39;re struggling with a weird behavior. This is for the nRF52840 and the bootloader doesn&amp;#39;t use the softdevice. 
 The bootloader is located at address 0xF8000 which is written in UICR</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 09 Apr 2019 06:56:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43835/custom-bootloader-can-t-reach-interrupt-handler" /><item><title>RE: Custom bootloader: Can't reach interrupt handler</title><link>https://devzone.nordicsemi.com/thread/180909?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2019 06:56:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7147672-f060-4f0e-9eb5-c71fa4fae109</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Bj&amp;oslash;rn,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks, then this is what I thought. .I suspect we have another issue then, I will continue searching for it, but it&amp;#39;s probably not linked to ISRs in general because it seems the SPI handler is called correctly. I can&amp;#39;t share the code, but your answer is enough for me.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards and thanks for your time,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Tim&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom bootloader: Can't reach interrupt handler</title><link>https://devzone.nordicsemi.com/thread/178454?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2019 15:15:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9407550-23c9-402d-94fc-37ba13be39ce</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;HI&amp;nbsp;&lt;span&gt;Timothée,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;the MBR should already have set the IRQ forwarding address to the bootloader&amp;#39;s vectortable address prior to passing execution to the bootloader. If you look at our Secure Bootloader we only call&amp;nbsp;nrf_dfu_mbr_irq_forward_address_set( which in turn calls&amp;nbsp;sd_mbr_command with&amp;nbsp;SD_MBR_COMMAND_IRQ_FORWARD_ADDRESS_SET as a parameter) when we jump to the application.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Would it be possible for you to share the project so that I could try running this on a NRF52840 DK ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;br /&gt;Bjørn&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom bootloader: Can't reach interrupt handler</title><link>https://devzone.nordicsemi.com/thread/178367?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2019 13:10:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2984e14a-1301-491e-b15c-08c48e2ffa7b</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Hi &lt;span&gt;Bj&amp;oslash;rn&lt;/span&gt;, no problem, this is not a blocking point for us.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We actually found a way to fix this, but I&amp;#39;m really curious to know if this is just a workaround or if this is the correct way to do it. What we do now is that at the beginning of our bootloader&amp;#39;s main, we perform a MBR command (SD_MBR_COMMAND_IRQ_FORWARD_ADDRESS_SET) to forward IRQ to the bootloader. After we do this, we correctly enter the GPIOTE handler when toggling our GPIO.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What makes me think it could not be the correct way is that the &lt;a href="https://www.nordicsemi.com/DocLib/Content/SoftDevice_Spec/s140/latest/SDS/s1xx/mbr_bootloader/mbr_sd_reset_behavior"&gt;s140 SDS&lt;/a&gt; states this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Else if a bootloader is present:
Forward interrupts to the bootloader.
Run Bootloader Reset Handler (defined in bootloader Vector Table at BOOTLOADERADDR).&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So I was thinking we wouldn&amp;#39;t need to tell the MBR to forward interrupts to the bootloader since it&amp;#39;s already part of the procedure. Also, the MBR already knows the address of the bootloader ISR vector since it&amp;#39;s where it jumps to at the beginning.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Timoth&amp;eacute;e&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom bootloader: Can't reach interrupt handler</title><link>https://devzone.nordicsemi.com/thread/178290?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2019 10:22:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c23b48e5-0900-4712-a388-3d8f8299fb81</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Timothée,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I sincerly apologize for the late reply. I have been travelling since I meet you at Embedded World and I am not back in the office after 4 weeks on the road.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you&amp;#39;re using the PORT event and not the IN event, then you are completly correct, IN0 does not need to be set, only the&amp;nbsp;GPIOTE.INTENSET.PORT should be set.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Bjørn&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom bootloader: Can't reach interrupt handler</title><link>https://devzone.nordicsemi.com/thread/172816?ContentTypeID=1</link><pubDate>Mon, 25 Feb 2019 14:48:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:322b2939-cc2b-4c78-af72-8a0e9b2cf349</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Hi Bj&amp;oslash;rn, thanks for your reply !&lt;br /&gt;skip_gpio_setup is used in the SDK 15.1 in nrfx_gpiote.c line 529. As for INTENSET.IN0 I will check ASAP, but are you sure it is needed ? Here I only want to use PORT events.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Timoth&amp;eacute;e&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom bootloader: Can't reach interrupt handler</title><link>https://devzone.nordicsemi.com/thread/172165?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 15:53:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3723687c-2593-4b6b-a1f2-75e70ff092e2</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;HI Timothee,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I assume that hte&amp;nbsp;.skip_gpio_setup = true option is a customization you have added as this option is not present in my clean release of SDK v15.1.0. May I ask what it does?&lt;/p&gt;
&lt;p&gt;Also can you verify that the INTENSET.IN0 is set to 1 ?&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>