<?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>How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/94989/how-to-erase-flash-area-s0-and-s1-when-using-nsib</link><description>Hi, 
 I am using nrf5340, NCS v2.1.2. 
 My software arch is s0 + MCUboot + application, and i want to add an upgradable bootloader named MCUboot, of course an upgradable application(appcore + netcore). 
 I know the mcumgr can do this, but i want application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Nov 2023 16:12:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/94989/how-to-erase-flash-area-s0-and-s1-when-using-nsib" /><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/454746?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2023 16:12:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b69aa591-1028-43e6-91d2-d7ab5766f398</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Yang Hu,&lt;/p&gt;
&lt;p&gt;Please be informed&amp;nbsp;that in NCS v2.5.0, two-stage bootloader setup is now working on nRF5340 with network core update.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/406531?ContentTypeID=1</link><pubDate>Wed, 25 Jan 2023 17:07:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94ec7521-4d08-416b-899c-f2f8e306bb28</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Yang Hu,&lt;/p&gt;
&lt;p&gt;Just giving you and anyone who come by this thread an update.&amp;nbsp;The combination of &lt;em&gt;&amp;quot;NSIB + MCUboot two-stage bootloading, Network Core (so, nRF5340), and DFU over External Flash&amp;quot;&lt;/em&gt;&amp;nbsp;does not work correctly as of NCS 2.2.0.&lt;br /&gt;The problem also happens&amp;nbsp;with the SMP Server provided in NCS and is not exclusive to your custom solution.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;erasure of the secondary slot you asked about in here is a&amp;nbsp;result of the underlying problem.&lt;/p&gt;
&lt;p&gt;Our R&amp;amp;D is working on a fix and hopefully it will be available soon. We cannot give a date here on DevZone, however.&lt;/p&gt;
&lt;p&gt;My apologies for the inconvenience.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/405588?ContentTypeID=1</link><pubDate>Thu, 19 Jan 2023 06:47:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18f382b6-7057-4de6-bb12-a271095462cf</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Hieu is out of office, but he promised you an update by today. We have indeed confirmed this issue internally and are working on resolving it. Unfortunately that&amp;#39;s about as far as we&amp;#39;ve gotten at this point. Thank you for your patience.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/404654?ContentTypeID=1</link><pubDate>Thu, 12 Jan 2023 20:52:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a07fab37-5709-4953-83a8-e11f298419cd</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Yang Hu,&lt;/p&gt;
&lt;p&gt;I see. Yours is a&amp;nbsp;legit&amp;nbsp;concern, and it would be great if you achieve the necessary resource saving with your custom setup.&lt;/p&gt;
&lt;p&gt;I discussed with a few other engineers here today and we found out that there might be a problem with MCUboot that is causing&amp;nbsp;the problem you are seeing.&lt;/p&gt;
&lt;p&gt;We are involving our bootloader specialists to discuss this issue. I will update here as soon as there is any significant progress; or I will come back with a quick status update on Thu Jan 19 if things were slow.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My apology for not being able to confirm this earlier and costed us so much time.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/404214?ContentTypeID=1</link><pubDate>Wed, 11 Jan 2023 03:55:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5517bdf2-591d-4250-9adc-19f9983908c4</guid><dc:creator>yang.hu</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;In my opinion, our purpose is the same, whether it&amp;#39;s a SMP Server or Custom Server.&lt;/p&gt;
&lt;p&gt;We want receive some date via BLE, it doesn&amp;#39;t matter if it&amp;#39;s&amp;nbsp;OTA or sensor date.&lt;/p&gt;
&lt;p&gt;I have something like sensor data to&amp;nbsp;communicate with others device,&amp;nbsp; i has one BLE Server already. So i don&amp;#39;t think i need the extra service(SMP Server)&amp;nbsp; to get&amp;nbsp;OTA data.&lt;/p&gt;
&lt;p&gt;I am using many nRF5x mcu, some of them have little RAM and flash, adding extra service cost too many resources.&lt;/p&gt;
&lt;p&gt;Yang Hu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/404198?ContentTypeID=1</link><pubDate>Tue, 10 Jan 2023 21:03:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84136ed6-0635-4447-8ea6-dbcde2b97b5d</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Yang Hu,&lt;/p&gt;
&lt;p&gt;I still wonder why you have to use a custom implementation like that. Does our current setup with MCUboot&amp;nbsp;and SMP Server on BLE Application not satisfying to you for certain reason? Is there perhaps some confidential feature involved?&lt;/p&gt;
&lt;p&gt;What we are attempting to do is very much recreating what our development teams have&amp;nbsp;designed, implemented, and tested. It is not very recommendable without a strong reason.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/403331?ContentTypeID=1</link><pubDate>Thu, 05 Jan 2023 09:33:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f635a3d2-3f7a-43c3-8984-6958f0b17f6d</guid><dc:creator>yang.hu</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;gt; Once again,&amp;nbsp;I will be out of office for the rest of the week, so if you need an urgent response, please note so.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am not need an urgent response, and i will wait for you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In summary, I would like to have a single firmware which can supports,&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Updating of network core (Using net_core_app_update.bin)&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Updating application core (Using app_update.bin)&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Updating 2nd stage MCUboot bootloader (Using&amp;nbsp;signed_by_mcuboot_and_b0_s1_image_update.bin)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;And all of these .bin files are received via&amp;nbsp;BLE or others wireless way.&amp;nbsp; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&lt;/span&gt;&lt;span&gt;&amp;nbsp;am not using any&amp;nbsp;solution provided in NCS, it is a custom&amp;nbsp;implementation.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The custom&amp;nbsp;implementation is:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1. I switch this .bin file to .c, and add some custom header to it, then i send it to my device via BLE.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. My device&amp;nbsp;receives this data and uses the header infomation to identify which target the data is being upgraded to.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3. After this, my device will write this data to its suitable solt, such as MCUboot secondary solt.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;4. My device will using&amp;nbsp;&amp;#39;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;boot_request_upgrade_multi&lt;/span&gt;&lt;span&gt;(0&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;BOOT_UPGRADE_PERMANENT&lt;/span&gt;&lt;span&gt;);&amp;#39; to&amp;nbsp;tell bootloader it time to swap&amp;nbsp;new image.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;5. After reset, the bootloader will boot the new image.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Currently&amp;nbsp;&lt;/span&gt;It is&amp;nbsp; possible to do the following&amp;nbsp;&lt;span&gt;while&amp;nbsp;&lt;/span&gt;&lt;span&gt;nRF Secure Immutable Bootloader&lt;/span&gt;&lt;span&gt;&amp;nbsp;(NSIB) is disabled:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Updating of network core (Using net_core_app_update.bin)&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;2. Updating application core (Using app_update.bin)&lt;/p&gt;
&lt;p&gt;when i add NSIB to my project, all of this is not updating.&lt;/p&gt;
&lt;p&gt;I add some log to MCUboot, and here is updating application core log:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;I: Swap type: perm
E: area_id: 4.
E: reset_value: 0x3cdf1.
E: min_addr: 0x1008800.
E: reset_value: 0x3cdf1.
E: max_addr: 0x1040000.
E: Reset address of image in secondary slot is not in the primary slot
E: Erasing image from secondary slot
I: swap_type: 1
I: Image upgrade secondary slot -&amp;gt; primary slot
I: Erasing the primary slot
I: Copying the secondary slot to the primary slot: 0x1 bytes
E: Unable to find bootable image&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;We can see MCUboot erase the secondary solt firstly, and then copy the secondary slot to the primary solt.&lt;/p&gt;
&lt;p&gt;Finally, the MCUboot bootloader is also not upgradable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/403265?ContentTypeID=1</link><pubDate>Wed, 04 Jan 2023 22:04:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e27e669f-b4aa-405c-896c-44f47cc22f10</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Yang Hu,&lt;/p&gt;
[quote user="hu-yang"]&lt;p&gt;Firstly, i using the test application write new image to&amp;nbsp;&lt;span&gt;MCUboot secondary, then i flash my true application again.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;After this, MCUboot secondary has the new image when my true application is running.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Is the purpose of the &amp;quot;test application&amp;quot; just to&amp;nbsp;write the new image to MCUboot Secondary, and only for development testing purpose?&lt;/p&gt;
&lt;p&gt;If so, you could instead just directly flash the &lt;em&gt;signed_by_mcuboot_and_b0_s0_image_moved_test_update&lt;/em&gt;&lt;span&gt;&lt;em&gt;.hex&lt;/em&gt;&amp;nbsp;or&amp;nbsp;&lt;em&gt;signed_by_mcuboot_and_b0_s1_image_moved_test_update.hex&lt;/em&gt; files instead, as I previously recommended.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The reason you have issues is most likely because the MCUboot &amp;quot;metadata&amp;quot; for the image was not written correctly. Such data is already included in the hex files above.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you wish to pursue this test application for a particular reason,&amp;nbsp;you could&amp;nbsp;refer to&amp;nbsp;the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.2.0/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/README.html"&gt;SMP Server sample&lt;/a&gt; for how to write the new image to MCUboot Secondary. The flow of that application should include both downloading the image and setting the necessary &amp;quot;metadata&amp;quot; flags.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;On that note, that sample might serve well as your test application. You will need to tweak it so that the flash partition is exactly the same as your real application though.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Having said all of that, my recommendation is still writing the hex file directly. If you have a special purpose that requires the &amp;quot;test application&amp;quot; approach, please share.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Let me know if you need anything else.&amp;nbsp;Once again,&amp;nbsp;I will be out of office for the rest of the week, so if you need an urgent response, please note so.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/403153?ContentTypeID=1</link><pubDate>Wed, 04 Jan 2023 11:11:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b238ec69-6322-4bdf-a045-4ae68bafda0f</guid><dc:creator>yang.hu</dc:creator><description>&lt;p&gt;As far as i can see, mcungr using &amp;#39;stream_flash_buffered_write()&amp;#39; to write new image to slot.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/403066?ContentTypeID=1</link><pubDate>Wed, 04 Jan 2023 01:39:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0c27ad2-b9f1-4888-bb54-0619eb3717da</guid><dc:creator>yang.hu</dc:creator><description>&lt;p&gt;Hi, i am using a custom implementation.&lt;/p&gt;
&lt;p&gt;In fact, i have two applications, one is test application that only write new image to MCUboot secondary, the other is my true application. And the true application include NSIB+MCUboot+application.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Firstly, i using the test application write new image to&amp;nbsp;&lt;span&gt;MCUboot secondary, then i flash my true application again.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;After this, MCUboot secondary has the new image when my true application is running.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The true application will call &amp;#39;&lt;/span&gt;&lt;span&gt;boot_request_upgrade_multi&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;BOOT_UPGRADE_PERMANENT&lt;/span&gt;&lt;span&gt;);&amp;#39;, and i will reset my board later.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;gt;&amp;nbsp;I hope this is not urgent. If it is urgent, please let me know and I will see if I can arrange some alternatives.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I hope you can give me some others suggest, and i can try in&amp;nbsp;the rest of the week.&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;Yang Hu&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/403027?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2023 16:14:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:983436d4-7657-44e2-9cf1-6d74c3e4f97e</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Are you using a custom implementation to write to your ext flash MCUboot_secondary or the solution provided in NCS?&lt;/p&gt;
&lt;p&gt;By the way, I am out of office for the rest of the week. I hope this is not urgent. If it is urgent, please let me know and I will see if I can arrange some alternatives.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/403002?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2023 14:33:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99efa20c-c196-4f61-9738-b420b1e5ce7b</guid><dc:creator>yang.hu</dc:creator><description>&lt;p&gt;In my project, i am using ext flash. First, i switch .bin to .c, then i using flash_write api to write to MCUboot_secondary.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/402986?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2023 14:02:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b5f6f3d-34b0-45c3-a790-a36fa369cde7</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi, how are you writing the bin file to MCUboot secondary? Did you write directly using some flash tool, or did you write by talking to the application via SMP Protocol?&lt;/p&gt;
&lt;p&gt;If you want to emulate the process by writing directly (from PC) to flash, you need to use the &amp;quot;***_moved_test_update.hex&amp;quot; variant of the file. That hex files contain some necessary metadata to trigger DFU.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/402946?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2023 12:26:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2583bb2-8787-4fbd-a4d5-23a8df8c4aaa</guid><dc:creator>yang.hu</dc:creator><description>&lt;p&gt;&amp;gt;&amp;nbsp;&lt;span&gt;At the step 2, MCUboot print the new image is always invalid.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I find the reason of this, i do not write the full image to mcuboot secondry.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I write&amp;nbsp;signed_by_mcuboot_and_b0_s1_image_update.bin to&amp;nbsp;&lt;span&gt;mcuboot secondry, and reset my board.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But old MCUboot print &amp;lsquo;Reset address of image in secondary slot is not in the primary slot&amp;rsquo;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;this is log:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v3.2.99-ncs1 ***
I: Starting bootloader
I: Swap type: perm
W: rr size:c10c
E: Reset address of image in secondary slot is not in the primary slot
E: Erasing image from secondary slot
I: Swap type: none
W: rr size:48100
I: Bootloader chainload address offset: 0x28000
I: Jumping to the first image slot&lt;/pre&gt;&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/402918?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2023 09:42:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d269ac23-6a46-4eff-9082-80b12c14e507</guid><dc:creator>yang.hu</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;At the step 2, MCUboot print the new image is always invalid.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I try to write nRF5340 appcore application to MCUboot_Secondary, MCUboot also print new image is invalid. Before i add NSIB to my project, appcore application is valid.&lt;/p&gt;
&lt;p&gt;This is my b0.conf:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_NCS_MCUBOOT_IN_BUILD=y
CONFIG_SECURE_BOOT_DEBUG_RTT=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And prj.conf:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_SECURE_BOOT=y
CONFIG_SB_SIGNING_KEY_FILE=&amp;quot;D://ncs//priv.pem&amp;quot;
CONFIG_BUILD_S1_VARIANT=y
CONFIG_FW_INFO=y
CONFIG_FW_INFO_FIRMWARE_VERSION=1&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The log is in loader.c, line:790.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Yang Hu&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/401418?ContentTypeID=1</link><pubDate>Tue, 20 Dec 2022 07:56:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22fbfc23-aa14-4cbb-b9bb-89104a17171f</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Yang Hu,&lt;/p&gt;
&lt;p&gt;If you are using the nRF Connect SDK, you do not need to worry about writing the new image to S0 or S1. The active MCUboot itself will take care of this.&lt;/p&gt;
&lt;p&gt;I will describe the flow is below, &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bootloader/README.html#pre-signed-variants"&gt;using the image from the NSIB documentation&lt;/a&gt;:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;img style="max-height:383px;max-width:126px;" alt=" " height="383" src="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/_images/b0_mcuboot_flash_layout.svg" width="126" /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&amp;quot;The MCUboot image for the inactive slot&amp;quot; is downloaded into the shared &amp;quot;buffer&amp;quot; area, MCUboot Secondary&lt;/li&gt;
&lt;li&gt;At the next reboot, the active MCUboot detects the new image availability,&amp;nbsp;and copy it over to the then-still-inactive slot&lt;/li&gt;
&lt;li&gt;From the next reboot (one more reboot after step 2), B0 detects the two MCUboot images, and will choose the one with higher monotonic counter version as the active one.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;There are two resources you can refer to for adding DFU over BLE:&lt;br /&gt;- &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/README.html#smp-svr-sample"&gt;Zephyr SMP Server sample, where you can enable BLE support&lt;/a&gt;.&lt;br /&gt;- &lt;a href="https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/ncs-dfu"&gt;Our colleague Simon&amp;#39;s guide, with instructions to add DFU to a BLE application&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/401395?ContentTypeID=1</link><pubDate>Tue, 20 Dec 2022 01:34:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d71bfca9-4918-420b-a0a7-c1e30ecd76d9</guid><dc:creator>yang.hu</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;Thanks for your reply.&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;nbsp;&lt;span&gt;I understand that you are trying to add two-stage bootloader to your application, is that correct?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Yes.&lt;/p&gt;
&lt;p&gt;The mcumgr is a good way to upgrade firmware, but it looks using wired upgrade, i&amp;nbsp;want to download the upgradeable firmware by BLE not UART.&lt;/p&gt;
&lt;p&gt;I know the Bo using &amp;#39;Ping-pong mode&amp;#39; to boot and/or upgrade MCUboot. W&lt;span&gt;riting new MCUboot to&amp;nbsp; s0 or s1 slot, the B0 will boot it on the next reboot.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My problem is i can not erase the s0 or s1 slot by using&amp;nbsp;&lt;strong&gt;flash_area_erase()&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;img_mgmt_impl_erase_slot().&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;New MCUboot cannot written without erasing.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Yang Hu&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to erase flash area s0 and s1 when using NSIB?</title><link>https://devzone.nordicsemi.com/thread/401386?ContentTypeID=1</link><pubDate>Mon, 19 Dec 2022 22:39:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4dee60a-efd7-436b-a044-42e659509c30</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Yang Hu,&lt;/p&gt;
&lt;p&gt;I understand that you are trying to add two-stage bootloader to your application, is that correct?&lt;/p&gt;
&lt;p&gt;If so, adding an upgradeable bootloader should not require you to modify MCUboot in anyway. I tried this myself just last week.&lt;/p&gt;
&lt;p&gt;If your application has been configured to support mcumgr, simply use mcumgr to flash one of the following two images:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;signed_by_mcuboot_and_b0_s0_image_test_update.bin&lt;br /&gt;&lt;/span&gt;&lt;span&gt;signed_by_mcuboot_and_b0_s1_image_test_update.bin&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Choosing it depends on what the &amp;quot;current&amp;quot; MCUboot is on your device. The &amp;quot;current&amp;quot; MCUboot is the one that is valid and has a higher version number among the two in s0 and s1 slots.&lt;/p&gt;
&lt;p&gt;If the current MCUboot is in S0, use mcumgr to flash the **_s1_image_test_update.bin.&lt;br /&gt;&lt;span&gt;If the current MCUboot is in S1, use mcumgr to flash the **_s0_image_test_update.bin.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;A guide to perform&amp;nbsp;MCUboot upgrade with&amp;nbsp;mcumgr is available in &lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/updatable_bootloader/nsib_mcuboot_smp"&gt;the README of this sample created by our colleague Sigurd&lt;/a&gt;.&amp;nbsp;&lt;br /&gt;For your case, it would be something like this:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="bat"&gt;mcumgr conn add conn_name type=&amp;quot;serial&amp;quot; connstring=&amp;quot;dev=com6,baud=115200,mtu=512&amp;quot;

# Since you already used nrfjprog to write a new MCUboot into S1, making S1 the current slot, the next image would be S0
mcumgr -c conn_name image upload build/zephyr/signed_by_mcuboot_and_b0_s0_image_update.bin&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Hieu&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>