<?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>can Bootloader call API in SoftDevice?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/115367/can-bootloader-call-api-in-softdevice</link><description>my nRF52840 has MBR, SoftDevice, Application and Bootloader. 
 
 Can Bootloader call API in SD? 
 Will it be an issue? If I need to upgrade SD (could be a newer version), Application and Bootloader. 
 Any suggestion on implementing Bootloader?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 09 Oct 2024 13:01:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/115367/can-bootloader-call-api-in-softdevice" /><item><title>RE: can Bootloader call API in SoftDevice?</title><link>https://devzone.nordicsemi.com/thread/505580?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2024 13:01:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41d242f5-2452-4bca-ad2d-1d7a8899f6cb</guid><dc:creator>Davis Zheng</dc:creator><description>&lt;p&gt;Thank you very much!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can Bootloader call API in SoftDevice?</title><link>https://devzone.nordicsemi.com/thread/505574?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2024 12:57:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1ba093c-bc0e-4e14-a33c-e49b8b185ba0</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Yes, that is implemented in the MBR&lt;/p&gt;
&lt;p&gt;I was not specific in my previous reply, but I woudl advice that you use the example BLE bootloader as a basis for your bootloader. In most applications it can be used with little or no change (other than adapting the configuration in sdk_config.h and using your own public key).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can Bootloader call API in SoftDevice?</title><link>https://devzone.nordicsemi.com/thread/505572?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2024 12:54:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7d9f536-8f72-447c-a159-de1173c13c26</guid><dc:creator>Davis Zheng</dc:creator><description>&lt;p&gt;Thanks for your answers and information!!&lt;/p&gt;
&lt;p&gt;&lt;span&gt;SVC 0x18 interrupt handler is implemented in MBR. right ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;48 uint32_t nrf_dfu_mbr_copy_bl(uint32_t * p_src, uint32_t len)&lt;br /&gt; 49 {&lt;br /&gt; \ nrf_dfu_mbr_copy_bl: (+1)&lt;br /&gt; \ 0x0 0xB538 PUSH {R3-R5,LR}&lt;br /&gt; \ 0x2 0xB084 SUB SP,SP,#+16&lt;br /&gt; \ 0x4 0x0004 MOVS R4,R0&lt;br /&gt; \ 0x6 0x000D MOVS R5,R1&lt;br /&gt; 50 uint32_t ret_val;&lt;br /&gt; 51 uint32_t const len_words = len / sizeof(uint32_t);&lt;br /&gt; \ 0x8 0x08AD LSRS R5,R5,#+2&lt;br /&gt; 52 &lt;br /&gt; 53 sd_mbr_command_t command =&lt;br /&gt; 54 {&lt;br /&gt; 55 .command = SD_MBR_COMMAND_COPY_BL,&lt;br /&gt; 56 .params.copy_bl.bl_src = p_src,&lt;br /&gt; 57 .params.copy_bl.bl_len = len_words&lt;br /&gt; 58 };&lt;br /&gt; \ 0xA 0x4668 MOV R0,SP&lt;br /&gt; \ 0xC 0x2110 MOVS R1,#+16&lt;br /&gt; \ 0xE 0x.... 0x.... BL __aeabi_memclr4&lt;br /&gt; \ 0x12 0x9401 STR R4,[SP, #+4]&lt;br /&gt; \ 0x14 0x9502 STR R5,[SP, #+8]&lt;br /&gt; 59 &lt;br /&gt; 60 ret_val = sd_mbr_command(&amp;amp;command);&lt;br /&gt; \ 0x16 0x4668 MOV R0,SP&lt;br /&gt; &lt;span style="color:#000000;"&gt;\ 0x18 0xDF18 &lt;span style="background-color:#ffffff;color:#0000ff;"&gt;SVC 0x18&lt;/span&gt;&lt;/span&gt;&lt;br /&gt; 61 &lt;br /&gt; 62 return ret_val;&lt;br /&gt; \ 0x1A 0xB005 ADD SP,SP,#+20&lt;br /&gt; \ 0x1C 0xBD30 POP {R4,R5,PC}&lt;br /&gt; 63 }&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can Bootloader call API in SoftDevice?</title><link>https://devzone.nordicsemi.com/thread/505569?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2024 12:39:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4bedf08-91c4-4aaa-975d-8dddf8dd2d2f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, a bootloader can call SoftDevice APIs. That is what our &lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/ble_sdk_app_dfu_bootloader.html"&gt;BLE Secure DFU Bootloader&lt;/a&gt;&amp;nbsp;does.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>