<?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>Modifying mcuboot-based bootloader source code</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95677/modifying-mcuboot-based-bootloader-source-code</link><description>Hello, I want to modify ncs\v2.2.0\bootloader\mcuboot\boot\zephyr main.c code of BLE OTA bootloader, but I need to move its code inside my application firmware repository folder except mcuboot, ncs and third party stuff. Then I want to link this bootloader</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Jan 2023 12:33:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95677/modifying-mcuboot-based-bootloader-source-code" /><item><title>RE: Modifying mcuboot-based bootloader source code</title><link>https://devzone.nordicsemi.com/thread/405026?ContentTypeID=1</link><pubDate>Mon, 16 Jan 2023 12:33:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e495231d-de9b-40c5-b919-5b6635e1dde6</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="timuritxs"]I want to run SMP in bootloader to gain stability (I am not planning to update the bootloader itself)[/quote]
&lt;p&gt;The nRF Connect SDK does not have support for Bluetooth Low Energy in the bootloader.&lt;/p&gt;
&lt;p&gt;If you do not think it is stable enough to run an SMP Server in your application, you will have to do some work yourself.&lt;/p&gt;
&lt;p&gt;I have discussed this challenge with another customer in &amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/93374/ble-recovery-image"&gt;BLE Recovery Image&lt;/a&gt;&amp;nbsp;.&lt;br /&gt;Maybe read through that one, and maybe you can get some ideas about how to do this.&lt;br /&gt;PS: I was first very against an BLE Recovery image in my first comment, but the customer convinsed me a bit, so remember to also have a look at my second comment.&lt;/p&gt;
&lt;p&gt;In this, I also give some reasons to why you do not want to add Bluetooth Low Energy to MCUboot.&lt;/p&gt;
&lt;p&gt;Was this helpful?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modifying mcuboot-based bootloader source code</title><link>https://devzone.nordicsemi.com/thread/405015?ContentTypeID=1</link><pubDate>Mon, 16 Jan 2023 12:11:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae5df043-45e0-463c-a152-88e693aa3b6b</guid><dc:creator>timuritxs</dc:creator><description>&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;I want to run SMP in bootloader to gain stability (I am not planning to update the bootloader itself)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modifying mcuboot-based bootloader source code</title><link>https://devzone.nordicsemi.com/thread/405001?ContentTypeID=1</link><pubDate>Mon, 16 Jan 2023 11:19:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1176646-2f9d-4b62-b4c5-0ac35da531eb</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;First, I will specify some things for my following explanation:&lt;/p&gt;
&lt;p&gt;An SMP Server is a server running on the device to receive an DFU update.&lt;/p&gt;
&lt;p&gt;The SMP Server can either run in the Application or in MCUboot:&lt;br /&gt;&lt;img style="cursor:zoom-in;max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/4812.pastedimage1673863539243v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Image from my &lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/serial_recovery"&gt;unofficial bootloader guide&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In the nRF Connect SDK we do not have support for Bluetooth Low Energy in the bootloader.&lt;br /&gt;Therefore, if you want to do DFU over Bluetooth Low Energy, I recommend that you run the SMP Server in your Application.&lt;/p&gt;
&lt;p&gt;Then to your use-case:&lt;/p&gt;
[quote user=""] I want to modify&amp;nbsp;ncs\v2.2.0\bootloader\mcuboot\boot\zephyr main.c code of BLE OTA bootloader, but I need to move&amp;nbsp;its code&amp;nbsp;inside my application firmware repository folder except mcuboot, ncs and third party stuff. Then I want to link this bootloader to my application through prj.conf of the application. How to do it in proper way? Thanks.[/quote]
&lt;p&gt;I suspect this is not the way to achieve what you need.&lt;br /&gt;We already have Serial Recovery which you can trigger with a button press. &lt;/p&gt;
&lt;p&gt;But as stated above, MCUboot does not support DFU over Bluetooth Low Energy. &lt;br /&gt;I would not recommend making large changes to MCUboot, such as adding Bluetooth Low Energy capabilities to it.&lt;/p&gt;
&lt;p&gt;I suggest that you first have a look at your DFU design first. So I will ask the following:&lt;/p&gt;
[quote user=""]If I press the button upon turn on, the bootloader should not run the main firmware but should wait in &amp;quot;boot mode&amp;quot; for BLE connections.[/quote]
&lt;p&gt;Was your intention to run the SMP Server in the bootloader or in the application?&lt;br /&gt;Or something else?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>