<?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>Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107266/update-from-nrf5-sdk-to-nrf-connect-sdk</link><description>Hello, 
 For a month I have been trying to find a solution to update my devices which are at my customers (these devices have a bootloader, softdevice and app coming from the nrf5 SDK) to the mcuboot and app coming from the NCS SDK. 
 To do this, I relied</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Mar 2025 16:42:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107266/update-from-nrf5-sdk-to-nrf-connect-sdk" /><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/528452?ContentTypeID=1</link><pubDate>Fri, 21 Mar 2025 16:42:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a36eb4a-5c75-4d7f-a15c-d30aae245142</guid><dc:creator>Bruno Randolf</dc:creator><description>&lt;p&gt;I am using the method mentioned in that post to wipe out the flash completely and flash the new firmware based on NCS. Works like a charm!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/466068?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2024 15:18:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d82b8e27-001d-4681-aac6-77d378624a27</guid><dc:creator>QuentinD</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: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/466015?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2024 13:23:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ad6dfb4-e6d0-4d98-9904-dd829fdd2102</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I don&amp;#39;t think you will have enough flash memory to add an immutable bootloader and use MCUBoot as a second-stage bootloader. Since MCUBoot does not include its own BLE DFU transport, there normally should not be a reason to update.&lt;/p&gt;
&lt;p&gt;That said, it&amp;nbsp;might&amp;nbsp;be possible to make a mechanism to update the bootloader from the app since you have the MBR with the bootloader copy function present on the device (unless MCUBoot overlaps with the MBR params page).&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/466011?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2024 13:14:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0bbc3af-4d77-4a32-8111-af1d48fa2662</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;Yes exactly.&lt;/p&gt;
&lt;p&gt;Yes I know that the MCUboot is not upgradeable: what I would like to know is in these conditions (update a device whitch is from nrf5 sdk), would it be possible to add the &amp;quot;immutable bootlaoder&amp;quot; (s0) in addition to the MCUboot in the update file to allow updating the bootloader later?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/466008?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2024 13:07:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03e335a1-fcda-4046-8283-0931572bfb24</guid><dc:creator>Vidar Berg</dc:creator><description>[quote userid="89270" url="~/f/nordic-q-a/107266/update-from-nrf5-sdk-to-nrf-connect-sdk/466003"]Yes, it was by rereading the flash that I realized what I said above.&lt;br /&gt;I just had to extend the timeout of my other microcontroller (the timeout triggers the reset pin of the nrf52840) for the copy to be done without problem.[/quote]
&lt;p&gt;Thank you for confirming. This&amp;nbsp;means&amp;nbsp;there is a critical window in the copy routine where a sudden reset could cause the SD activation to fail. The fix would likely be to remove the check. The Softdevice was already validated in the postvalidation step.&lt;/p&gt;
[quote userid="89270" url="~/f/nordic-q-a/107266/update-from-nrf5-sdk-to-nrf-connect-sdk/466003"]I&amp;#39;m sorry but it seems you don&amp;#39;t understand my question.&lt;br /&gt;Now I can do like you in your project (I can only have these 3 element on my device: MBR+app+MCUboot). It works and I can use MCUboot to update&lt;br /&gt; with my future applications.&lt;br /&gt;But if one day I want to be able to update the MCUboot to a new version, what should I do now to be able to update the MCUboot in my device?[/quote]
&lt;p&gt;I understand your question now, but MCUBoot is not upgradeable.&amp;nbsp;&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/107266/update-from-nrf5-sdk-to-nrf-connect-sdk/465842"]The original bootloader will be replaced by the MCUBoot bootloader if the update was completed, and this bootloader is not upgradable.[/quote]&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/466003?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2024 13:01:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0ace7a6-a6ce-4e62-b439-7176012c9924</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;Yes, it was by rereading the flash that I realized what I said above.&lt;br /&gt;I just had to extend the timeout of my other microcontroller (the timeout triggers the reset pin of the nrf52840) for the copy to be done without problem.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry but it seems you don&amp;#39;t understand my question.&lt;br /&gt;Now I can do like you in your project (I can only have these 3 element on my device: MBR+app+MCUboot). It works and I can use MCUboot to update&lt;br /&gt; with my future applications.&lt;br /&gt;But if one day I want to be able to update the MCUboot to a new version, what should I do now to be able to update the MCUboot in my device?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/465997?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2024 12:50:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:def5ff7a-2461-45d2-b321-469a26a18a4a</guid><dc:creator>Vidar Berg</dc:creator><description>[quote userid="89270" url="~/f/nordic-q-a/107266/update-from-nrf5-sdk-to-nrf-connect-sdk/465987"]We do not see it in the logs because the last logs before the restart were not indicated in the log file (it did not display logs during the copy phase). If you look at the log file, you will see that the last log before the reboot was truncated.[/quote]
&lt;p&gt;It takes quite a while for the destination address to reach the SD info struct in the copy routine, so it is odd that the info structure would have been erased when there are no logs indicating that the copy routine even started. Have you done anything to confirm that this is indeed the case? E.g., by reading the flash content at&amp;nbsp;&lt;span&gt;0x29004 with nrfjprog.&lt;/span&gt;&lt;/p&gt;
[quote userid="89270" url="~/f/nordic-q-a/107266/update-from-nrf5-sdk-to-nrf-connect-sdk/465987"]I think you misunderstood my question. Now that I have successfully replaced the softdevice+app+bootloader with the app+MCUboot, what should I put in place to successfully update the bootloader later? (update MCUboot)[/quote]
&lt;p&gt;As illustrated by the picture I refered to earlier, the Softdevice (zephyr app in this case) and bootloader (mcuboot) are updated after the copy routine is finished.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/465987?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2024 12:24:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa1cddb5-707f-43e1-b7d1-1c8d15835315</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;We do not see it in the logs because the last logs before the restart were not indicated in the log file (it did not display logs during the copy phase). If you look at the log file, you will see that the last log before the reboot was truncated.&lt;/p&gt;
&lt;p&gt;I think you misunderstood my question. Now that I have successfully replaced the softdevice+app+bootloader with the app+MCUboot, what should I put in place to successfully update the bootloader later? (update MCUboot)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/465980?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2024 12:13:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26ce94ff-3620-4731-b3eb-3048631e417d</guid><dc:creator>Vidar Berg</dc:creator><description>[quote userid="89270" url="~/f/nordic-q-a/107266/update-from-nrf5-sdk-to-nrf-connect-sdk/465978"]The problem was that since my update file had a size of 0xA9D70 bytes, the copy process overwrote the value of the magic number which was at address 0x29004 since the reboot happened more or less when he had written to the address 0x7E81b.[/quote]
&lt;p&gt;The log shows that the copy routine did not start, so I don&amp;#39;t see how the SD info struct could have been overwritten.&lt;/p&gt;
[quote userid="89270" url="~/f/nordic-q-a/107266/update-from-nrf5-sdk-to-nrf-connect-sdk/465978"]You didn&amp;#39;t answer me: to continue to be able to update the bootlaoder, what more should I do?[/quote]
&lt;p&gt;The bootloader and SoftDevice should be activated simultaneously, but the activation is aborted due to the issue discussed above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/465978?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2024 12:06:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:104c8c73-7473-41f4-8240-9d1e6d306875</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;As I remember it, this is how it worked:&lt;br /&gt;1. The update file was written&amp;nbsp;to address 0x27000&lt;br /&gt;2. The first part of the update file was copied to address 0x1000. During the copy, the nrf52840 was restarted.&lt;br /&gt;The problem was that since my update file had a size of 0xA9D70 bytes, the copy process overwrote the value of the magic number which was at address 0x29004 since the reboot happened more or less when he had written to the address 0x7E81b.&lt;br /&gt;So, on reboot, there was no longer a magic number at address 0x29004 since it had been overwritten.&lt;/p&gt;
&lt;p&gt;You didn&amp;#39;t answer me: to continue to be able to update the bootlaoder, what more should I do?&lt;br /&gt;&lt;br /&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/465960?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2024 11:23:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e878c1d1-5f89-4e1d-b153-342562d2c692</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;It appears that the problem arises in the nrf_bootloader_fw_activate() function, where SD_MAGIC_NUMBER_GET() is checked:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: Enter nrf_bootloader_fw_activate
00&amp;gt; &amp;lt;debug&amp;gt; app: Valid SD + BL
00&amp;gt; &amp;lt;debug&amp;gt; app: Enter nrf_dfu_sd_bl_continue
00&amp;gt; &amp;lt;debug&amp;gt; app: Enter nrf_bootloader_dfu_sd_continue
00&amp;gt; &amp;lt;error&amp;gt; app: Source address does not contain a valid SoftDevice.
00&amp;gt; &amp;lt;error&amp;gt; app: SD+BL: SD copy failed&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is after the sd+bl image has been postvalidated. What doesn&amp;#39;t make sense is why the bootloader fails to read the magic number in&amp;nbsp;nrf_bootloader_dfu_sd_continue(). To debug this further, it would help if you could print the &amp;#39;src_addr&amp;#39; before the&amp;nbsp;SD_MAGIC_NUMBER_GET() check.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/465847?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2024 15:00:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea437c15-f30a-4ef0-92f3-eade13e3ccae</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;After the file was written to nrf52840 at address 0x27000, I had a reboot during the phase of copying the fisrt part of the file to the app partition (0x1000).&lt;br /&gt;In fact, if there was a restart during the copy,&amp;nbsp;afther the restart it goes into the postvalidate_sd_bl() function and since softdevice_info_ok(...) returns false (SD_MAGIC_NUMBER_GET(sd_start_addr) != SD_MAGIC_NUMBER) because the address does not is no longer the right one.&lt;/p&gt;
&lt;p&gt;To continue to be able to update the bootlaoder, what more should I do?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/465842?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2024 14:43:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a20f85b0-96ab-49f8-9fdc-10c96a77d3f2</guid><dc:creator>Vidar Berg</dc:creator><description>[quote userid="89270" url="~/f/nordic-q-a/107266/update-from-nrf5-sdk-to-nrf-connect-sdk/465841"]Apparently, if the reboot is done during the copy phase, it no longer continues the update.[/quote]
&lt;p&gt;What phase is this, is it after the zephyr app + mcuboot bootloader has been uploaded and when the images are being copied from bank 0 to their destinations?&lt;/p&gt;
[quote userid="89270" url="~/f/nordic-q-a/107266/update-from-nrf5-sdk-to-nrf-connect-sdk/465841"]With this solution, is it still possible to update the bootloader once the memory has been overwritten by the MCUboot+app?[/quote]
&lt;p&gt;The original bootloader will be replaced by the MCUBoot bootloader if the update was completed, and this bootloader is not upgradable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/465841?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2024 14:39:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:950da2df-a785-4c80-8d2c-1a4d0a7e1fcd</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;Apparently, if the reboot is done during the copy phase, it no longer continues the update.&lt;/p&gt;
&lt;p&gt;With this solution, is it still possible to update the bootloader once the memory has been overwritten by the MCUboot+app?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/465526?ContentTypeID=1</link><pubDate>Tue, 23 Jan 2024 10:52:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc57dc7e-a075-4679-864c-5dad1e36b766</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;&lt;span&gt;I&amp;#39;m glad to hear you were able to identify the problem. Thank you for the update. However, if the target was unexpectedly reset, I would still have expected the activation process to continue on the next reboot assuming the DFU process was completed.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/465524?ContentTypeID=1</link><pubDate>Tue, 23 Jan 2024 10:47:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:342ee94a-bbd7-4a31-b4e3-56db894ffce7</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;The problem I had was due to the restart of the nrf52840 (restarted by the other microcontroller) while copying the file.&lt;/p&gt;
&lt;p&gt;Now everything works: thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/465412?ContentTypeID=1</link><pubDate>Mon, 22 Jan 2024 16:09:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5bdc5f0a-c723-47af-a554-1b1c11f479bf</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;From the logs it looks like there is a reboot during the &amp;quot;Writing settings...&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/465371?ContentTypeID=1</link><pubDate>Mon, 22 Jan 2024 14:36:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b01d0dff-6d94-4b12-aab1-4a803b0ae204</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;Yes you are right: the bootloader tries to read the softdevice ID at address 0x27000+0x2004 while the softdevice ID is at address 0x1000+0x2004.&lt;/p&gt;
&lt;p&gt;If I read the flash during the update, I see that the bootloader writes my file starting at address 0x27000 in flash.&lt;br /&gt;On the other hand, when it passes into the &amp;quot;sd_activate()&amp;quot; function, the bootloader has already copied the data from address 0x27000 to address 0x1000: this is why it does not read the correct value .&lt;/p&gt;
&lt;p&gt;In the logs, we see this line:&lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; nrf_dfu_validation: SoftDevice update is a major version update. Current: 7. New: 10.&lt;br /&gt;So we see that the Softdevice ID is recognized in the update file.&lt;/p&gt;
&lt;p&gt;Is it normal that my file is at address 0x1000 instead of address 0x27000 when it comes to the &amp;quot;sd_activate()&amp;quot; function?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/465262?ContentTypeID=1</link><pubDate>Mon, 22 Jan 2024 10:38:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f3c0758-fb26-407e-a874-c214963a8020</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m glad to hear that it resolved the issue with MCUBoot not booting.&lt;/p&gt;
[quote user="QuentinD"]On the other hand, when I send the file by DFU and then I read the flash again, I notice that it does not write the end of the file. It does erase the block in the flash but it does not write the data. During my last test, it correctly wrote the data up to address 0x7E81b in flash but after that it no longer wrote anything (it should go up to address 0x9CED3) but nevertheless in the bootloader logs all the writes are &amp;quot;success&amp;quot;: do you have any idea what could be causing this problem?[/quote]
&lt;p&gt;The merged Zephyr app + bootloader binary is first loaded to 0x27000. After this, the bootloader is supposed to activate the images by copying them to their respective slots. However, the activation step is&amp;nbsp;skipped because the bootloader does not see the Zephyr app as a valid Softdevice:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; &amp;lt;error&amp;gt; app: Source address does not contain a valid SoftDevice.&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/465241?ContentTypeID=1</link><pubDate>Mon, 22 Jan 2024 09:25:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80cac13b-84e7-477a-8047-88c5c6735dd7</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Putting &amp;quot;CONFIG_FPROTECT=n&amp;quot; was enough: now if I flash the files directly, it works! THANKS !&lt;/p&gt;
&lt;p&gt;On the other hand, when I send the file by DFU and then I read the flash again, I notice that it does not write the end of the file. It does erase the block in the flash but it does not write the data. During my last test, it correctly wrote the data up to address 0x7E81b in flash but after that it no longer wrote anything (it should go up to address 0x9CED3) but nevertheless in the bootloader logs all the writes are &amp;quot;success&amp;quot;: do you have any idea what could be causing this problem?&lt;br /&gt;&lt;br /&gt;Can you look at my bootloader log from my previous post to see if you see a problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/465102?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 15:25:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbb98816-33f4-4972-917a-66d8feef36e3</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;For this error:&lt;/p&gt;
[quote user="QuentinD"]00&amp;gt; [00:00:10.572,052] &amp;lt;err&amp;gt; mcuboot: Protect mcuboot flash failed, cancel startup.[/quote]
&lt;p&gt;Try to build mcuboot with&amp;nbsp;CONFIG_FPROTECT=n. I recall there were some issues with the flash protection mechanism after relocating the bootloader to the end of flash (in nRF Connect SDK the bootloader starts at the beginning of flash).&amp;nbsp;&lt;/p&gt;
[quote user="QuentinD"]00&amp;gt; [00:00:00.000,701] &amp;lt;wrn&amp;gt; mcuboot: Cannot upgrade: not a compatible amount of sectors[/quote]
&lt;p&gt;This suggests that the MCUBoot secondary slot is not allocated in flash. Please run the &amp;quot;memory report&amp;quot; action in VS code and post the flash partition layout here.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/465091?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 14:59:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9406d5e1-b09e-4890-abe6-c1eba47d09c8</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;If I flash the app_signed.hex and zephyr.hex file to my nrf52840, I have these logs:&lt;/p&gt;
&lt;p&gt;00&amp;gt; *** Booting nRF Connect SDK v2.5.0 ***&lt;br /&gt;00&amp;gt; [00:00:00.000,213] &amp;lt;inf&amp;gt; mcuboot: Starting bootloader&lt;br /&gt;00&amp;gt; [00:00:00.000,701] &amp;lt;wrn&amp;gt; mcuboot: Cannot upgrade: not a compatible amount of sectors&lt;br /&gt;00&amp;gt; [00:00:10.572,021] &amp;lt;inf&amp;gt; mcuboot: Bootloader chainload address offset: 0x1000&lt;br /&gt;00&amp;gt; [00:00:10.572,021] &amp;lt;inf&amp;gt; mcuboot: Jumping to the first image slot&lt;br /&gt;00&amp;gt; [00:00:10.572,052] &amp;lt;err&amp;gt; mcuboot: Protect mcuboot flash failed, cancel startup.&lt;/p&gt;
&lt;p&gt;Do you know what can cause this kind of problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/464998?ContentTypeID=1</link><pubDate>Fri, 19 Jan 2024 10:20:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:360c24f9-d49e-4cb5-bc49-53f907369d1e</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;Thank you very much for your help: I have made a lot of progress :)&lt;/p&gt;
&lt;p&gt;But here I still have a problem: the file that I am trying to write is not completely written in memory (the end of the file is missing) although according to the logs everything was written correctly.&lt;br /&gt;Just to check that there is no problem in the bootloader code for writing large files, I tested what it would do if I had only updated the application by filling almost all the &amp;quot;app&amp;quot; partition. For this, I wrote from address 0x27000 to address 0xC2C3B (size=0x9BC3B) and everything was written correctly.&lt;/p&gt;
&lt;p&gt;If I now send my file containing the NCS App + MCUboot to overwrite the softdevice (file of 0xA9E80 bytes), it writes in flash from the address 0x1000 to an address around the address 0x7EB00 (I say &amp;quot;around&amp;quot; since if I change the delay between sending 2 frames to the bootloader, the last written address changes (but not much)) whereas it should go up to address 0xAAE80.&lt;/p&gt;
&lt;p&gt;Here is the memory map of my nrf52840 before the update:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;mbr: 0x0 -&amp;gt; 0x1000&lt;/li&gt;
&lt;li&gt;softdevice: 0x1000 -&amp;gt; 0x26000&lt;/li&gt;
&lt;li&gt;app: 0x27000 -&amp;gt; 0xD0000 (0xA9000) -&amp;gt; in reality my app goes from 0x27000 to 0x98CEB&lt;/li&gt;
&lt;li&gt;storage: 0xD0000 -&amp;gt; 0xD1000&lt;/li&gt;
&lt;li&gt;unused page: 0xd1000 -&amp;gt; 0xe0000&lt;/li&gt;
&lt;li&gt;ot_flash_data: 0xe0000 -&amp;gt; 0xe4000&lt;/li&gt;
&lt;li&gt;bootloader: 0xE4000 -&amp;gt; 0xF0000&lt;/li&gt;
&lt;li&gt;unused_page2: 0xF0000 -&amp;gt; 0xFE000&lt;/li&gt;
&lt;li&gt;mbr_params_page: 0xFE000 -&amp;gt; 0xFF000&lt;/li&gt;
&lt;li&gt;bootloader_settings_page: 0xFF000 -&amp;gt; 0x100000&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here are the bootloader logs during the update:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Test_5F00_BT840_5F00_V0.1.0.12.log"&gt;devzone.nordicsemi.com/.../Test_5F00_BT840_5F00_V0.1.0.12.log&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m trying to send these&amp;nbsp;files:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/sd_5F00_bl.bin"&gt;devzone.nordicsemi.com/.../sd_5F00_bl.bin&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/sd_5F00_bl.dat"&gt;devzone.nordicsemi.com/.../sd_5F00_bl.dat&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This file was built from these 2 files:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/app_5F00_signed.hex"&gt;devzone.nordicsemi.com/.../app_5F00_signed.hex&lt;/a&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1411.zephyr.hex"&gt;devzone.nordicsemi.com/.../1411.zephyr.hex&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Remarks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We see that physically, the update overwrites in flash the softdevice and part of the NRF5 application with part of the NCS SDK application. On the other hand, we see this in the logs:&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_write(addr=0x00027000, src=0x200046A0, len=64 bytes), queue usage: 1&lt;br /&gt;...&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_write(addr=0x000D0E40, src=0x2000461C, len=64 bytes), queue usage: 1&lt;br /&gt;Why is it indicated &amp;quot;0x27000&amp;quot; as the starting address and not 0x1000 because physically that is where it is written? Isn&amp;#39;t the problem I&amp;#39;m having related to this?&lt;/li&gt;
&lt;li&gt;I can write the entire &amp;quot;app&amp;quot; partition if I don&amp;#39;t start writing by starting at the address of the softdevice so we already know that there is no problem writing in flash for large files and no problem writing to addresses where I have a problem.&lt;/li&gt;
&lt;li&gt;In the logs, all the writes are marked as &amp;quot;success&amp;quot; but in reality, rereading the flash, I see that the end is not saved, do you have any idea?&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/464555?ContentTypeID=1</link><pubDate>Wed, 17 Jan 2024 10:07:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5eee933-e755-4d78-992e-b7e86d38d1c4</guid><dc:creator>Vidar Berg</dc:creator><description>[quote userid="89270" url="~/f/nordic-q-a/107266/update-from-nrf5-sdk-to-nrf-connect-sdk/464549"]Ah I thought when I saw the image that we had to send an update of the app with a file which contains the NCS App and MCUboot. So you should instead do a combined update of the softdevice+bootloader (in which the softdevice update file will contain the NCS app and the bootloader update file will contain the MCUboot)?[/quote]
&lt;p&gt;Correct.&lt;/p&gt;
[quote userid="89270" url="~/f/nordic-q-a/107266/update-from-nrf5-sdk-to-nrf-connect-sdk/464549"]Can we send the softdevice&amp;nbsp;and after the next reboot to send the bootloader or must both be written at the same time?[/quote]
&lt;p&gt;They must be written at the same time.&lt;/p&gt;
[quote userid="89270" url="~/f/nordic-q-a/107266/update-from-nrf5-sdk-to-nrf-connect-sdk/464549"]Does this solution require you to first go through a patched bootlaoder?[/quote]
&lt;p&gt;You can include the Softdevice info structure in the zephyr app to trick the bootloader into thinking it is a valid Softdevice. See the example attached&amp;nbsp;to my other devzone post for how you can include this structure.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update from nRF5 SDK to nRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/464549?ContentTypeID=1</link><pubDate>Wed, 17 Jan 2024 09:38:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f847791f-fc6a-4a0b-b188-313ea5f97dc3</guid><dc:creator>QuentinD</dc:creator><description>&lt;p&gt;Thank you for your explanation.&lt;/p&gt;
&lt;p&gt;Ah I thought when I saw the image that we had to send an update of the app with a file which contains the NCS App and MCUboot. So you should instead do a combined update of the softdevice+bootloader (in which the softdevice update file will contain the NCS app and the bootloader update file will contain the MCUboot)?&lt;/p&gt;
&lt;p&gt;Can we send the softdevice&amp;nbsp;and after the next reboot to send the bootloader or must both be written at the same time?&lt;/p&gt;
&lt;p&gt;Does this solution require you to first go through a patched bootlaoder?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>