<?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>External Flash (SPI) - MCUBoot - OTA</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89241/external-flash-spi---mcuboot---ota</link><description>I have been able to set up external flash for MCUBoot for FOTA. 
 But after rebooting, the image is the same than before the image upgrade. 
 
 
 I used a sniffer so i could see SPI transmission with external flash during the process but all i can see</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 Jun 2022 07:45:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89241/external-flash-spi---mcuboot---ota" /><item><title>RE: External Flash (SPI) - MCUBoot - OTA</title><link>https://devzone.nordicsemi.com/thread/374273?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2022 07:45:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6966a0a-3de2-488a-bb82-989cae0d236e</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You sent parts of the board dts, but not the overall build DT that I requested.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In your build-folder, ie:&lt;/p&gt;
&lt;p&gt;my_project/build-folder/zephyr/zephyr.dts&lt;/p&gt;
&lt;p&gt;&lt;span&gt;my_project/build-folder/mcuboot/zephyr/zephyr.dts&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;These two files will hold the full device tree configured for each project.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you please post all your changes to the lwm2m_firmware file?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It is important that the update is marked as done (if successful), and that the update is scheduled, as shown in these two calls:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.0.0/subsys/net/lib/fota_download/src/fota_download.c#L204-L206"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.0.0/subsys/net/lib/fota_download/src/fota_download.c#L204-L206&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Håkon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External Flash (SPI) - MCUBoot - OTA</title><link>https://devzone.nordicsemi.com/thread/374181?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2022 13:42:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79fd074b-7197-4749-a1f7-821158cba2f7</guid><dc:creator>MehdiChelouah</dc:creator><description>&lt;p&gt;I just sent you the files with private message&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External Flash (SPI) - MCUBoot - OTA</title><link>https://devzone.nordicsemi.com/thread/374177?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2022 13:30:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c8ce8e8-327f-46d7-8c3f-e117a5194b90</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;How does the DT overlay for your mcuboot project look?&lt;/p&gt;
&lt;p&gt;This file can be found in build/mcuboot/zephyr/zephyr.dts.&lt;/p&gt;
&lt;p&gt;This should be fairly equal to the application dts, which is located in build/zephyr/zephyr.dts.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you attach both of these?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External Flash (SPI) - MCUBoot - OTA</title><link>https://devzone.nordicsemi.com/thread/374144?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2022 12:21:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70bfc928-9755-431b-8f99-68c44e4cb243</guid><dc:creator>MehdiChelouah</dc:creator><description>[quote userid="2115" url="~/f/nordic-q-a/89241/external-flash-spi---mcuboot---ota/374136"]Can you share how you handle this after a successful download?[/quote]
&lt;p&gt;It&amp;#39;s more or less from lwm2m_firmware.c from nrf/subsys&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1656073198356v3.png" /&gt;&lt;/p&gt;
&lt;p&gt;Also, i marked as comment the log info of counter value.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s what i get now --&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1656073096038v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also, it still doesn&amp;#39;t work after i added pm_static.yaml file into my project&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External Flash (SPI) - MCUBoot - OTA</title><link>https://devzone.nordicsemi.com/thread/374136?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2022 11:24:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07ad302a-bde0-49ed-8317-71478fe7f60c</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="MehdiChelouah"]Actually, i don&amp;#39;t have any pm_static_yml file since it uses dynamic partitioning.&amp;nbsp;[/quote]
&lt;p&gt;You should use a pm_static.yml file, to ensure that all updated builds have the exact same partition layout.&lt;/p&gt;
&lt;p&gt;This is done by copying my_project/build/partitions.yml to my_project/pm_static.yml.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="MehdiChelouah"]Partition layout on updated and original image are the same because the updated image is exactly the same image than the old one,&amp;nbsp;except that i&amp;nbsp;edited&amp;nbsp;a &amp;quot;Firmware Version&amp;quot; ressource for lwm2m[/quote]
&lt;p&gt;You must have defined the &amp;amp;spiX in the overlay for the mcuboot (can be in the main board file as well) to ensure that it picks up the external flash.&lt;/p&gt;
&lt;p&gt;The print outs indicates that your logic is done in the application space. Can you share how you handle this after a successful download?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External Flash (SPI) - MCUBoot - OTA</title><link>https://devzone.nordicsemi.com/thread/374067?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2022 08:11:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fad69670-10ea-4599-907a-469fbafb8a3a</guid><dc:creator>MehdiChelouah</dc:creator><description>&lt;p&gt;Thanks for your reply,&lt;/p&gt;
&lt;p&gt;Actually, i don&amp;#39;t have any pm_static_yml file since it uses dynamic partitioning.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Partition layout on updated and original image are the same because the updated image is exactly the same image than the old one,&amp;nbsp;except that i&amp;nbsp;edited&amp;nbsp;a &amp;quot;Firmware Version&amp;quot; ressource for lwm2m&lt;/p&gt;
&lt;p&gt;I just added the mcuboot overlay but it&amp;#39;s not working yet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: External Flash (SPI) - MCUBoot - OTA</title><link>https://devzone.nordicsemi.com/thread/373892?ContentTypeID=1</link><pubDate>Thu, 23 Jun 2022 10:42:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c1a26d0-45fa-4b84-96e9-22632d89333d</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is your partition layout equal on original image vs. the updated .bin file?&lt;/p&gt;
&lt;p&gt;You can ensure that this happens if you take the original_project/build/partitions.yml and copy this to the updated_project/pm_static.yml, and then build the &amp;quot;updated_project&amp;quot;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]And here is my mcuboot.conf in child_image folder[/quote]
&lt;p&gt;Have you setup the mcuboot overlay for your external flash?&lt;/p&gt;
&lt;p&gt;That should be located in child_image/mcuboot/boards/($MY_BOARD).overlay.&lt;/p&gt;
&lt;p&gt;Note that it must be the secure board, for instance nrf9160dk_nrf9160.overlay, and not the&amp;nbsp;&lt;strong&gt;_ns&lt;/strong&gt; prefixed board.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>