<?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>DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69967/dfu-from-external-flash-using-spi-nor</link><description>Hi, 
 
 I am attempting to get the zephyr usb dfu sample located at ncs/zephyr/samples/usb/dfu to work using external flash. I am using the nrf52833 on a custom board in combination with mx25r32 flash chip on ncs version 2.4.0. 
 Firstly, I have been</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 04 Jun 2022 00:06:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69967/dfu-from-external-flash-using-spi-nor" /><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/370946?ContentTypeID=1</link><pubDate>Sat, 04 Jun 2022 00:06:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28ee8ad0-22d1-409f-94a5-69d4630241db</guid><dc:creator>embeddedER</dc:creator><description>&lt;p&gt;Thanks, Simon!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/370912?ContentTypeID=1</link><pubDate>Fri, 03 Jun 2022 14:09:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dc6b53f-400b-4ff9-b850-81852b410e96</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Take a look at this PR&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-mcuboot/pull/200"&gt;https://github.com/nrfconnect/sdk-mcuboot/pull/200&lt;/a&gt;, which I think is related to you issue.&amp;nbsp;The fix for this issue is merged into NCS v2.0.0.&lt;/p&gt;
&lt;p&gt;You can see how the function&amp;nbsp;boot_write_magic() has changed:&lt;/p&gt;
&lt;p&gt;NCS v1.8.0:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-mcuboot/blob/v1.7.99-ncs4/boot/bootutil/src/bootutil_public.c#L316-L332"&gt;https://github.com/nrfconnect/sdk-mcuboot/blob/v1.7.99-ncs4/boot/bootutil/src/bootutil_public.c#L316-L332&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;NCS v2.0.0:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-mcuboot/blob/v1.9.99-ncs1/boot/bootutil/src/bootutil_public.c#L326-L361"&gt;https://github.com/nrfconnect/sdk-mcuboot/blob/v1.9.99-ncs1/boot/bootutil/src/bootutil_public.c#L326-L361&lt;/a&gt;&amp;nbsp;&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: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/370318?ContentTypeID=1</link><pubDate>Wed, 01 Jun 2022 04:34:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad6e431e-8cd1-4c84-9a71-1ff92b4d5747</guid><dc:creator>embeddedER</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Did you get more insights on this problem? I&amp;#39;ve an exactly the same issue and I see the same error:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;info.it_magic(0x0) != IMAGE_TLV_INFO_MAGIC (0x6907)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I am using Winbond flash and nrf52832 with ncs version 1.8.0.&lt;/p&gt;
&lt;p&gt;So, after downloading the image, it fails to validate the image and then doesn&amp;#39;t switch to the new firmware. Anything that I need to take care of with ncs v1.8.0?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;TIA!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/304194?ContentTypeID=1</link><pubDate>Mon, 12 Apr 2021 08:16:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c30b55f-5059-44c9-be92-845340898658</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;No, I was just wondering if it was present (added as a child image). I&amp;#39;m happy you found a working solution.&amp;nbsp;I think I have to do some testing myself to see exactly when/how the PM partitions/dts applies or not.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/304110?ContentTypeID=1</link><pubDate>Fri, 09 Apr 2021 23:21:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ecf852d-103d-4f15-830a-57eec7670157</guid><dc:creator>dhump3</dc:creator><description>&lt;p&gt;Yes, I see that folder. Anything in here I should be looking for?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/303922?ContentTypeID=1</link><pubDate>Fri, 09 Apr 2021 08:39:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59f0bd1b-4634-4ddd-91ba-4a91f374c0a1</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Hmm.. That&amp;#39;s interesting. I thought that the Partition Manager decided the partitions (and DTS partitions would get ignored)&amp;nbsp;when your application included child-images, like mcuboot. As stated in the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/nrf/scripts/partition_manager/partition_manager.html#partition-manager"&gt;PM documentation&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;The Partition Manager is activated for all multi-image builds, regardless of which build strategy is used for the child image.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Apparently this is not the case for you. Maybe my understanding is wrong, or there have been some updates to NCS how this is handled.&lt;/p&gt;
&lt;p&gt;To make it clear, you do see the folder &amp;lt;sample&amp;gt;/build/zephyr/mcuboot in your application?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/303592?ContentTypeID=1</link><pubDate>Wed, 07 Apr 2021 17:41:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9488ba45-aec6-4b1e-86c8-42f1156d2b06</guid><dc:creator>dhump3</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Its been a while but my teammate has finally gotten both ble dfu and usb dfu working on the smp_svr sample. We were under the impression that we didn&amp;#39;t have to configure the board file at all because the partition manager is supposed to take care of everything. I guess this was a mistake as when we made the following changes to our board file, the DFU just started working.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;flash0 {
	partitions {
		compatible = &amp;quot;fixed-partitions&amp;quot;;
		#address-cells = &amp;lt;1&amp;gt;;
		#size-cells = &amp;lt;1&amp;gt;;

		boot_partition: partition@0 {
			label = &amp;quot;mcuboot&amp;quot;;
			reg = &amp;lt;0x000000000 0xC000&amp;gt;;
		};
		slot0_partition: partition@c000 {
			label = &amp;quot;image-0&amp;quot;;
			reg = &amp;lt;0x0000C000 0x35000&amp;gt;;
		};
	};
};

&amp;amp;mx25r32 {
    partitions {
        compatible = &amp;quot;fixed-partitions&amp;quot;;
        #address-cells = &amp;lt;1&amp;gt;;
        #size-cells = &amp;lt;1&amp;gt;;
        
        slot1_partition: partition@0 {
            label = &amp;quot;image-1&amp;quot;;
            reg = &amp;lt;0x00000000 0x000073000&amp;gt;;
        };
        scratch_partition: partition@73000 {
            label = &amp;quot;image-scratch&amp;quot;;
            reg = &amp;lt;0x000073000 0x000073000&amp;gt;;
        };
    };
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;We didn&amp;#39;t have to make any of the changes discussed&amp;nbsp;earlier in the thread and we&amp;#39;re basically working from a fresh zephyr install. We did update to NCS v1.5.0 where I was previously&amp;nbsp;testing on NCS v.1.4.0.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/291872?ContentTypeID=1</link><pubDate>Thu, 28 Jan 2021 19:41:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2e6c85a-7ad7-4279-8dd0-f1860d03af2e</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1588.peripheral_5F00_uart_5F00_spi_5F00_nor_5F00_dfu.zip"&gt;devzone.nordicsemi.com/.../1588.peripheral_5F00_uart_5F00_spi_5F00_nor_5F00_dfu.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/291871?ContentTypeID=1</link><pubDate>Thu, 28 Jan 2021 19:40:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbf4fd61-0af8-4317-99d1-edff189ca70e</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;There was quite much work required to get your sample to run on the nrf52840dk, so I just modified my simplifed sample to use spi_nor instead of&amp;nbsp;nrf_qspi_nor, and I was actually able to make it work. I successfully performed a dfu using external flash and spi_nor.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll upload the sample here. Try modifying it to work with your external flash and your particular board. I think this is what you need to change:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;mcuboot_conf and prj.conf: &amp;quot;MX25R64&amp;quot; to &amp;quot;MX25R32&amp;quot;&lt;/li&gt;
&lt;li&gt;Change the name of the overlay file (nrf52840dk_nrf52840.overlay) to your board name&lt;/li&gt;
&lt;li&gt;Change mx25r64 with mx25r32 in the overlay file&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There might be more you have to change that I&amp;#39;m not aware of.&lt;/p&gt;
&lt;p&gt;Also remember to change mcuboot.c as described earlier in this ticket.&lt;/p&gt;
&lt;p&gt;Build the application two times, after the first build, flash it to the chip. Then change the text&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;quot;Application&amp;nbsp;version&amp;nbsp;1.0.0&lt;/span&gt;&lt;span&gt;\n&lt;/span&gt;&lt;span&gt;&amp;quot; to v2.0.0&lt;/span&gt;, build it again and transfer the file app_update.bin to the phone.&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Then download nRF Connect Device Manager, and transfer the .bin file&lt;/p&gt;
&lt;p&gt;You need to bond with the device (open Termite to see logging/instructions)&amp;nbsp;in order to perform the update.&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re not able to make this work, I&amp;#39;ll get ahold of an nRF52833 and and external flash and try to make it work with that.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/5807.peripheral_5F00_uart_5F00_spi_5F00_nor_5F00_dfu.zip"&gt;devzone.nordicsemi.com/.../5807.peripheral_5F00_uart_5F00_spi_5F00_nor_5F00_dfu.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/291684?ContentTypeID=1</link><pubDate>Thu, 28 Jan 2021 08:20:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a6f7253-b58c-4bdd-9ad9-5e0f6ca1676f</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I got the project, and will try to reproduce.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/291474?ContentTypeID=1</link><pubDate>Wed, 27 Jan 2021 11:13:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90e70f66-73a6-4eba-8e42-0c4fe1a6e875</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I&amp;#39;ve sent you a privat message here on DevZone, check that out on how to share the project privately.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/291367?ContentTypeID=1</link><pubDate>Tue, 26 Jan 2021 18:47:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a03bf063-e36b-4ee7-81ac-be4cfe154843</guid><dc:creator>dhump3</dc:creator><description>&lt;p&gt;Is there a way I can send the application privately?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/291180?ContentTypeID=1</link><pubDate>Tue, 26 Jan 2021 08:08:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68edb6dd-6dda-45b1-88d6-739f51492300</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Could you send over your application in a zipped file? Then I could modify it to work with the nRF52840 and the&amp;nbsp;&lt;span&gt;mx25r64 and&amp;nbsp;try to reproduce the issue.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/291150?ContentTypeID=1</link><pubDate>Tue, 26 Jan 2021 00:28:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e99f4c3-c611-4513-95da-a6bb29d920d9</guid><dc:creator>dhump3</dc:creator><description>&lt;p&gt;I have added the log statement and made changes to spi_nor_write(). Unfortunately, I have not seen any change in the bootloader output:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:00.253,570] &amp;lt;inf&amp;gt; mcuboot: Starting bootloader
[00:00:00.254,241] &amp;lt;inf&amp;gt; mcuboot: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
[00:00:00.254,241] &amp;lt;inf&amp;gt; mcuboot: Boot source: none
[00:00:00.254,791] &amp;lt;inf&amp;gt; mcuboot: Swap type: test
[00:00:00.254,791] &amp;lt;inf&amp;gt; mcuboot: Header is valid!
[00:00:00.254,791] &amp;lt;inf&amp;gt; mcuboot: Inside bootutil_img_validate()
[00:00:00.880,889] &amp;lt;inf&amp;gt; mcuboot: offset 300292 | image size: 299780 | header size 512
[00:00:00.954,650] &amp;lt;inf&amp;gt; mcuboot: bootutil_img_validate() successful!
[00:00:00.954,650] &amp;lt;inf&amp;gt; mcuboot: Inisde boot_perform_update()
[00:00:21.496,856] &amp;lt;inf&amp;gt; mcuboot: Inisde boot_perform_update() completed with status 0
[00:00:21.497,009] &amp;lt;inf&amp;gt; mcuboot: Header is valid!
[00:00:21.497,009] &amp;lt;inf&amp;gt; mcuboot: Inside bootutil_img_validate()
[00:00:21.736,511] &amp;lt;inf&amp;gt; mcuboot: offset 300292 | image size: 299780 | header size 512
[00:00:21.736,541] &amp;lt;err&amp;gt; mcuboot: tlv magic is wrong! expected 6907 but got 0
[00:00:21.736,541] &amp;lt;err&amp;gt; mcuboot: bootutil_tlv_iter_begin failed with error -1
[00:00:21.736,541] &amp;lt;err&amp;gt; mcuboot: Failed to validate the image!
[00:00:21.736,541] &amp;lt;err&amp;gt; mcuboot: Image in the primary slot is not valid!
[00:00:21.736,541] &amp;lt;err&amp;gt; mcuboot: Unable to find bootable image&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Note that the image size is so large because I am testing with the custom application I am building. The offset seems to be the image size + the header size. Here are the code changes I made to the spi_nor driver. I added this function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static inline int spi_nor_write_sub_word(const struct device *dev, off_t addr,
                                         const void *src, size_t slen)
{
    uint8_t __aligned(4) buf[4];
    int ret;
    ret = spi_nor_cmd_addr_read(dev, SPI_NOR_CMD_READ, addr, buf,
                                sizeof(buf));
    spi_nor_wait_until_ready(dev);
    if (ret &amp;gt;= 0) {
        memcpy(buf, src, slen);
        spi_nor_cmd_write(dev, SPI_NOR_CMD_WREN);
        ret = spi_nor_cmd_addr_write(dev, SPI_NOR_CMD_PP, addr, buf,
                                     sizeof(buf));
    }
    return ret;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And then in spi_nor_write() I edited lines 498 - 499 to be:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if (to_write &amp;lt; 4U) {
    ret = spi_nor_write_sub_word(dev, addr, src, to_write);
} else {
    spi_nor_cmd_write(dev, SPI_NOR_CMD_WREN);
    ret = spi_nor_cmd_addr_write(dev, SPI_NOR_CMD_PP, addr,
                                 src, to_write);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I will continue digging to see whats going on with the tlv magic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/291037?ContentTypeID=1</link><pubDate>Mon, 25 Jan 2021 13:13:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:539d8152-87c4-408f-b9e0-e2988425a3a3</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I&amp;#39;ve talked to a developer internally and got some insight. I think the reason for this issue is that the write alignment in the spi_nor driver is not set to 4 bytes. As you can see in &lt;a href="https://github.com/zephyrproject-rtos/zephyr/issues/26729"&gt;Zephyr issue&amp;nbsp;26729&lt;/a&gt;, it is not possible to write to the&amp;nbsp;&lt;span&gt;mx25r64&amp;nbsp;if the minimum write&amp;nbsp;size is less than 4, I believe it&amp;#39;s the same with your mx25r32. The qpsi_nor driver has been modified to take this into account. The two links below points to the code that will handle writes smaller than 4 bytes:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.4.0-ncs2/drivers/flash/nrf_qspi_nor.c#L717-L718"&gt;qspi_nor_write()&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.4.0-ncs2/drivers/flash/nrf_qspi_nor.c#L620-L639"&gt;write_sub_word()&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;If you look inside write_sub_word(), it will handle cases where less than 4 bytes is written to flash. E.g. if you write 2 bytes, then you need to read out 4 bytes and store it into a buffer, put your 2 bytes into the same buffer, before writing all the 4 bytes into the flash. This is to preserve unchanged data.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Could you try to modify &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/8b6686f731f90a4d672e2160172f672e06c3e1bb/drivers/flash/spi_nor.c#L469"&gt;spi_nor_write()&lt;/a&gt;&amp;nbsp;to do the same?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please ask if anything is unclear.&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;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/290869?ContentTypeID=1</link><pubDate>Sun, 24 Jan 2021 09:56:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d56086e0-ee5b-401d-8f54-f5137be616a7</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I can see that&amp;nbsp;boot_validate_slot() is called several times from different places, but if I&amp;#39;ve concluded correctly the call from &lt;a href="https://github.com/nrfconnect/sdk-mcuboot/blob/v1.6.99-ncs1/boot/bootutil/src/loader.c#L1911"&gt;context_boot_go()&lt;/a&gt; is the one that is leading to this error. This means that the update is already done, and the image previously located in the secondary slot (external flash), now residing in the primary slot is being validated.&lt;/p&gt;
&lt;p&gt;I am not sure why it can&amp;#39;t find&amp;nbsp;IMAGE_TLV_PROT_INFO_MAGIC. I&amp;#39;ll talk to a developer on Monday.&lt;/p&gt;
&lt;p&gt;Maybe you could try to print out the offset, it should be equal to the size of the binary (app_update.bin) if I understand it correctly&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;bootutil_tlv_iter_begin(..){
 ..
 ..
 off_ = BOOT_TLV_OFF(hdr);
 //Add the line below
 printk(&amp;quot;offset %d | image size: %d | header size: %d \n&amp;quot;, off_, hdr-&amp;gt;ih_img_size, hdr-&amp;gt;ih_hdr_size);
    if (flash_area_read(fap, off_, &amp;amp;info, sizeof(info))) {
        return -1;
    }

    if (info.it_magic == IMAGE_TLV_PROT_INFO_MAGIC) {
    ..&lt;/pre&gt;&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: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/290613?ContentTypeID=1</link><pubDate>Thu, 21 Jan 2021 19:51:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e62bd599-7488-491d-bf8f-4047eb4a88d1</guid><dc:creator>dhump3</dc:creator><description>&lt;p&gt;I added more logging and have determined the issue is with the &lt;a href="https://github.com/nrfconnect/sdk-mcuboot/blob/853e11283805ec66f157bc27a5286edb36046725/boot/bootutil/src/tlv.c#L67" rel="noopener noreferrer" target="_blank"&gt;tlv magic&lt;/a&gt;. I added a log statement there to see what the difference is.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:22.004,516] &amp;lt;err&amp;gt; mcuboot: tlv magic is wrong! expected 0x6907 but got 0x0000&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/290610?ContentTypeID=1</link><pubDate>Thu, 21 Jan 2021 19:17:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:752c12ce-d1d2-40ed-a845-344a32c579c6</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Try to add some unique logging before each return statement inside &lt;a href="https://github.com/nrfconnect/sdk-mcuboot/blob/853e11283805ec66f157bc27a5286edb36046725/boot/bootutil/src/tlv.c#L39"&gt;bootutil_tlv_iter_begin()&lt;/a&gt;&amp;nbsp;to figure out exactly where it fails. E.g. printk(&amp;quot;bootutil_tlv_iter_begin() no 1\n&amp;quot;),&amp;nbsp;&lt;span&gt;printk(&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;bootutil_tlv_iter_begin() no 2\n&amp;quot;) and so on.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/290367?ContentTypeID=1</link><pubDate>Wed, 20 Jan 2021 21:05:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f07bff0-374c-47e1-a4ea-f0a46bb9cb77</guid><dc:creator>dhump3</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For some reason I there was no reply button so am just replying to my original question. I have been able to add log statements and read the flash out. I will go through each step I have done.&lt;/p&gt;
&lt;p&gt;I start by flashing an image of version 0.1.0 normally. I then use the command mcumgr image upload -e my_image.bin to upload an image of version 0.2.0. After this I ran a mcumgr image list and get the following output:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Images:
 image=0 slot=0
    version: 0.1.0
    bootable: true
    flags: active confirmed
    hash: f225666061fb89f3b354c0a68024125f754ba19bc04bff8de96d3272fe2e8fe4
 image=0 slot=1
    version: 0.2.0
    bootable: true
    flags: 
    hash: 9b79b38d0ef3d0aef9540ca3544714abcfe5949c7c980fea1d8246fa48ded321&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This seems to be working properly. I then reset the device without testing the image in order to read the image_1 flash area on boot using the following code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;flash_area_open(FLASH_AREA_ID(image_1), &amp;amp;fap);
uint32_t data = 0;
flash_area_read(fap, 0, &amp;amp;data, sizeof(data));
LOG_INF(&amp;quot;IMAGE-1 Magic = 0x%08X&amp;quot;, data);
flash_area_close(fap);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This gives me the following log output&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:01.796,783] &amp;lt;inf&amp;gt; app: IMAGE-1 Magic = 0x96f3b83d&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I believe it is reversed because I stored it in a uint32_t rather than reading into a uint8_t buffer, so the magic seems fine. I then proceed and run the command mcumgr image test&amp;nbsp;9b79b38d0ef3d0aef9540ca3544714abcfe5949c7c980fea1d8246fa48ded321. This gives me the expected output of:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Images:
 image=0 slot=0
    version: 0.1.0
    bootable: true
    flags: active confirmed
    hash: f225666061fb89f3b354c0a68024125f754ba19bc04bff8de96d3272fe2e8fe4
 image=0 slot=1
    version: 0.2.0
    bootable: true
    flags: pending
    hash: 9b79b38d0ef3d0aef9540ca3544714abcfe5949c7c980fea1d8246fa48ded321&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I then reset the device once again and the bootloader does the swap and fails as usual. Here is the output with some extra logging I added:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:00.253,601] &amp;lt;inf&amp;gt; mcuboot: Starting bootloader
[00:00:00.254,333] &amp;lt;inf&amp;gt; mcuboot: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
[00:00:00.254,333] &amp;lt;inf&amp;gt; mcuboot: Boot source: none
[00:00:00.254,974] &amp;lt;inf&amp;gt; mcuboot: Swap type: test
[00:00:00.254,974] &amp;lt;inf&amp;gt; mcuboot: Header is valid!
[00:00:00.254,974] &amp;lt;inf&amp;gt; mcuboot: Inside bootutil_img_validate()
[00:00:01.040,039] &amp;lt;inf&amp;gt; mcuboot: bootutil_img_validate() successful!
[00:00:01.040,069] &amp;lt;inf&amp;gt; mcuboot: Inisde boot_perform_update()
[00:00:21.213,592] &amp;lt;inf&amp;gt; mcuboot: Header is valid!
[00:00:21.213,592] &amp;lt;inf&amp;gt; mcuboot: Inside bootutil_img_validate()
[00:00:21.537,841] &amp;lt;err&amp;gt; mcuboot: bootutil_tlv_iter_begin failed with error -1
[00:00:21.537,841] &amp;lt;err&amp;gt; mcuboot: Failed to validate the image!
[00:00:21.537,872] &amp;lt;err&amp;gt; mcuboot: Image in the primary slot is not valid!
[00:00:21.537,872] &amp;lt;err&amp;gt; mcuboot: Unable to find bootable image&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Each &amp;quot;Header is valid!&amp;quot; is printed after the function &lt;a title="boot_is_header_valid()" href="https://github.com/nrfconnect/sdk-mcuboot/blob/v1.6.99-ncs1-rc1/boot/bootutil/src/loader.c#L475" rel="noopener noreferrer" target="_blank"&gt;boot_is_header_valid()&lt;/a&gt; completes successfully. I determined that the failure is occurring in the function &lt;a title="boot_img_validate()" href="https://github.com/nrfconnect/sdk-mcuboot/blob/v1.6.99-ncs1-rc1/boot/bootutil/src/image_validate.c#L308" rel="noopener noreferrer" target="_blank"&gt;boot_img_validate()&lt;/a&gt; after the swap occurs, which can be seen in the logs. I added logs inside of that function to determine where its failing and it seems to be failing &lt;a title="here" href="https://github.com/nrfconnect/sdk-mcuboot/blob/v1.6.99-ncs1-rc1/boot/bootutil/src/image_validate.c#L345" rel="noopener noreferrer" target="_blank"&gt;here&lt;/a&gt;. The function &lt;a title="bootuil_tlv_iter_begin()" href="https://github.com/nrfconnect/sdk-mcuboot/blob/853e11283805ec66f157bc27a5286edb36046725/boot/bootutil/src/tlv.c#L39" rel="noopener noreferrer" target="_blank"&gt;bootutil_tlv_iter_begin()&lt;/a&gt; returns -1 in numerous different cases, I can add more logging there to try to narrow it down if that helps.&lt;/p&gt;
&lt;p&gt;After this failure to validate the image, I have to flash a new image normally. I flash an image of version 0.3.0 and then run mcumgr image list and get this output:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Images:
 image=0 slot=0
    version: 0.3.0
    bootable: true
    flags: active confirmed
    hash: cc631d7dc18337d07b7c17e72f8d1e08f8a9beceab361fa46bb84075cc77fd34
 image=0 slot=1
    version: 0.2.0
    bootable: true
    flags: 
    hash: 9b79b38d0ef3d0aef9540ca3544714abcfe5949c7c980fea1d8246fa48ded321&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The 0.2.0 image is still there. Also the output for the magic remains unchanged.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/290078?ContentTypeID=1</link><pubDate>Tue, 19 Jan 2021 20:10:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5ee51d1-d7e9-490d-b909-f22d6e044ce4</guid><dc:creator>Simon</dc:creator><description>&lt;ul&gt;
&lt;li&gt;It would be intereresting to see why the validation fails. Try to add some logging inside &lt;a href="https://github.com/nrfconnect/sdk-mcuboot/blob/v1.6.99-ncs1-rc1/boot/bootutil/src/loader.c#L645"&gt;boot_is_header_valid() and boot_image_check()&lt;/a&gt;&amp;nbsp;to figure out where and why it fails.&lt;/li&gt;
&lt;li&gt;Could you also try to add BOOT_LOG_INF(&amp;quot;Inside boot_perform_update()&amp;quot;); in &lt;a href="https://github.com/nrfconnect/sdk-mcuboot/blob/ef3942301adbf3d7da1051f97fac01574c66f5c4/boot/bootutil/src/loader.c#L1402"&gt;boot_perform_update()&lt;/a&gt;? To see if it performs the&amp;nbsp;image swap before or after you get the error &lt;em&gt;&amp;quot;Image in the primary slot is not valid!&amp;quot;&lt;/em&gt;. I guess the swap happens before the error, and the validation of the new image fails.&lt;/li&gt;
&lt;li&gt;Are you able to read the content of the flash after you&amp;#39;ve transferred the image to the external flash, and before resetting the chip (before the swap happens)? This might be hard to achieve if you&amp;#39;re transferring the image over a &lt;a href="https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Connect-Device-Manager"&gt;mobile app&lt;/a&gt;, as it will reset automatically after the transfer is complete. However if you use the mcumgr command line tool with macOS or Linux (&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/README.html#caveats"&gt;not supported on Windows&lt;/a&gt;), it should be fine, since you&amp;#39;re issuing the reset command manually.&amp;nbsp;I&amp;#39;m not familiar with dfu-util but it might work with that tool as well. Try reading out the 4 first bytes, where the magic number should be stored. It should be equal to 0x 3d b8 f3 96. If you don&amp;#39;t know how to read out the flash, please tell me and I can look into how to go about it. You could also try to read it out after the swap has happened.&lt;/li&gt;
&lt;/ul&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: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/289739?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2021 13:11:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e76bdc4-b762-42cd-b14d-69019f8353ee</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/dhump3"&gt;dhump3&lt;/a&gt;,&amp;nbsp;I&amp;#39;ll take over this case. I&amp;#39;ll put off some time tomorrow and see if I can get to the bottom of your issue.&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: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/289301?ContentTypeID=1</link><pubDate>Thu, 14 Jan 2021 19:54:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:adc850ae-02f1-4605-9d9a-c49b2873639a</guid><dc:creator>dhump3</dc:creator><description>&lt;p&gt;Update: I have gone back to mcumgr to try and get more information on the images. I first flash an image of version 0.2.0 and then I get this output when I run &lt;code&gt;mcumgr image list:&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Images:
 image=0 slot=0
    version: 0.2.0
    bootable: true
    flags: active confirmed
    hash: 1a55d38e4c3fff9c68e13274b534664a06e976726b7081812d2698b21fb4105e&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I then upload an image of version 0.3.0 to the secondary slot of the device and get this output:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Images:
 image=0 slot=0
    version: 0.2.0
    bootable: true
    flags: active confirmed
    hash: 1a55d38e4c3fff9c68e13274b534664a06e976726b7081812d2698b21fb4105e
  image=0 slot=1
    version: 0.3.0
    bootable: true
    flags: 
    hash: adf638ddfb17699d45d2b4fe6c340db5ab4f7504655f3a728982d087cd345dd8&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I then test the new image and get the following output from the bootloader:&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 v2.4.0-ncs1  **
[00:00:00.253,601] &amp;lt;inf&amp;gt; mcuboot: Starting bootloader
[00:00:00.254,364] &amp;lt;inf&amp;gt; mcuboot: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
[00:00:00.254,364] &amp;lt;inf&amp;gt; mcuboot: Boot source: none
[00:00:00.255,004] &amp;lt;inf&amp;gt; mcuboot: Swap type: test
[00:00:22.608,764] &amp;lt;err&amp;gt; mcuboot: Image in the primary slot is not valid!
[00:00:22.608,764] &amp;lt;err&amp;gt; mcuboot: Unable to find bootable image&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;At this point the device is pretty much bricked, so I just end up flashing the version 0.3.0 image via nrfjprog to device. I decided to re run the image list command to see what was going on and get this:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;Images:
 image=0 slot=0
    version: 0.3.0
    bootable: true
    flags: active confirmed
    hash: adf638ddfb17699d45d2b4fe6c340db5ab4f7504655f3a728982d087cd345dd8
 image=0 slot=1
    version: 0.2.0
    bootable: true
    flags:
    hash: 2ef9a81cbe11a728a774bedb3ffeb7c66a01b8823693a82b166fa66cf1d26c74&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It seems it actually did try to swap the images as image 0.2.0 is now in slot 1. However the hash is completely different which must mean something went wrong in the swapping of the images. Just to see what happens, I then test the slot 1 image (0.2.0) and get this output from the bootloader:&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 v2.4.0-ncs1  **
[00:00:00.253,631] &amp;lt;inf&amp;gt; mcuboot: Starting bootloader
[00:00:00.254,394] &amp;lt;inf&amp;gt; mcuboot: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
[00:00:00.254,394] &amp;lt;inf&amp;gt; mcuboot: Boot source: none
[00:00:00.255,035] &amp;lt;inf&amp;gt; mcuboot: Swap type: test
[00:00:09.016,571] &amp;lt;err&amp;gt; mcuboot: Image in the secondary slot is not valid!&lt;/pre&gt;Mcuboot recognizes the secondary image is invalid, deletes it and then it boots up the primary slot. Running image list now gives me:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;Images:
 image=0 slot=0
    version: 0.3.0
    bootable: true
    flags: active confirmed
    hash: adf638ddfb17699d45d2b4fe6c340db5ab4f7504655f3a728982d087cd345dd8
Split status: N/A (0)&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m not entirely sure whats going on here but hopefully this extra detail can help narrow down the issue.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/289280?ContentTypeID=1</link><pubDate>Thu, 14 Jan 2021 16:11:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91948ff6-46eb-4e66-ac8b-423a24014c04</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I only tested with BLE using the nRF connect android app, so I will try set up a test with dfu-util as well to see if I run into the same issue. But I can&amp;#39;t promise that I will get time for that tomorrow, it might have to wait til next week.&amp;nbsp; &lt;/p&gt;
[quote user="dhump3"]I did verify that everything was still working when I do not use external flash.[/quote]
&lt;p&gt;&amp;nbsp;This helps narrow it down, thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/289032?ContentTypeID=1</link><pubDate>Wed, 13 Jan 2021 20:54:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73da6313-27df-49be-827d-31e8525b079c</guid><dc:creator>dhump3</dc:creator><description>&lt;p&gt;Hi, I had to work on something else for a bit so I apologize for the delayed response. I have picked this up again and made the changes in your above post to the file &lt;code&gt;zephyr/subsys/dfu/boot/mcuboot.c&lt;/code&gt;. I did not see any change and something is still going wrong in the bootloader. For some reason, I am also not getting log output in the bootloader, so I don&amp;#39;t have much to show here. Going to try to get that working so I can give more information.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I did verify that everything was still working when I do not use external flash. Note, I am following the sample and not using mcumgr to do the dfu but rather &lt;code&gt;dfu-util&lt;/code&gt; using the command&lt;code&gt; dfu-util --alt 0 --download build/zephyr/app_update.bin&lt;/code&gt;. The example says to use &lt;code&gt;--alt 1&lt;/code&gt; but for some reason that does not work for me.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from external flash using SPI NOR</title><link>https://devzone.nordicsemi.com/thread/288268?ContentTypeID=1</link><pubDate>Sat, 09 Jan 2021 19:06:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:723d7686-642f-4009-a418-f27258703d2f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;Update: The app failed to write the 16-byte &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/design.html?highlight=magic#image-trailer"&gt;MAGIC &lt;/a&gt;number because the byte array was kept in FLASH memory, and the SPI &lt;span&gt;&lt;a title="EasyDMA" href="https://infocenter.nordicsemi.com/topic/ps_nrf52833/easydma.html?cp=4_1_0_3_5"&gt;EasyDMA&lt;/a&gt;&lt;/span&gt; can only access data in RAM.&amp;nbsp; I belive this is what caused the update to fail for me.&lt;/p&gt;
&lt;p&gt;The original byte array declaration in mcuboot.c with the &amp;#39;const&amp;#39; qualifier which causes it to only be placed in FLASH:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static const uint32_t boot_img_magic[4] = {
	0xf395c277,
	0x7fefd260,
	0x0f505235,
	0x8079b62c,
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And here is after I removed &amp;#39;const&amp;#39; to get it loaded to RAM:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static uint32_t boot_img_magic[4] = {
	0xf395c277,
	0x7fefd260,
	0x0f505235,
	0x8079b62c,
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Please try to include this fix and see if you get the same result.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>