<?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>MCUBoot’s secondary image on external flash on nrf9160</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83590/mcuboot-s-secondary-image-on-external-flash-on-nrf9160</link><description>I am using nrf9160 custom board with an external flash memory mx25l6433f. I first tested the external flash with the example &amp;#39;sdk-zephyr/samples/drivers/spi_flash_at45&amp;#39; and for it to work was added an &amp;#39;.overlay&amp;#39; 
 
 and on my &amp;#39;proj.conf&amp;#39; added 
 
 Compiled</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Mar 2022 07:19:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83590/mcuboot-s-secondary-image-on-external-flash-on-nrf9160" /><item><title>RE: MCUBoot’s secondary image on external flash on nrf9160</title><link>https://devzone.nordicsemi.com/thread/360439?ContentTypeID=1</link><pubDate>Tue, 29 Mar 2022 07:19:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14b4df7e-f7c3-4d43-8daf-c3fa5615c851</guid><dc:creator>ICM_UC</dc:creator><description>&lt;p&gt;Hi Rokk Research,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Just take into account the link Simon gave is for a repo that is modified. If you go to your SDK the sample is a bit different, mainly the &amp;#39;proj.conf&amp;#39;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot’s secondary image on external flash on nrf9160</title><link>https://devzone.nordicsemi.com/thread/360387?ContentTypeID=1</link><pubDate>Mon, 28 Mar 2022 19:20:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4f09803-229d-4705-a173-b4fd0da70c5d</guid><dc:creator>Rokk Research</dc:creator><description>&lt;p&gt;Hi ICM_UC, that &amp;#39;s very interesting!!&amp;nbsp; Thanks for the info, I will try to figure out what the&amp;nbsp;difference is.&amp;nbsp; I simply cloned the repo and tried to build the same (targeting the nRF9160 DK) without any modifications, but I will double check the configs.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot’s secondary image on external flash on nrf9160</title><link>https://devzone.nordicsemi.com/thread/360175?ContentTypeID=1</link><pubDate>Mon, 28 Mar 2022 07:46:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61f63c69-8fd9-4473-9ae2-3d78f2b6c80f</guid><dc:creator>ICM_UC</dc:creator><description>&lt;p&gt;Hi Rokk research,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;That is strange, because i follow the example that Simon gave and it&amp;#39;s working&lt;/p&gt;
[quote userid="72692" url="~/f/nordic-q-a/83590/mcuboot-s-secondary-image-on-external-flash-on-nrf9160/347597#347597"]&lt;p&gt;In&amp;nbsp;&lt;a href="https://github.com/simon-iversen/sdk-nrf/tree/d1a11f2c39e3b8fb0af7652e7e720626f0e1298e/samples/nrf9160/http_update/application_update"&gt;nRF9160: HTTP application update using the nRF9160DK&amp;#39;s external flash&lt;/a&gt;,&amp;nbsp;I have modified the http_update/application_update sample to support MCUboot updates using the 91DK&amp;#39;s onboard external flash as secondary slot. I tested this sample with NCS v1.7.0, but I guess it will work fine with NCS v1.8.0 as well.&lt;/p&gt;
&lt;p&gt;Test it yourself by following the steps&amp;nbsp;under &lt;a href="https://github.com/simon-iversen/sdk-nrf/tree/d1a11f2c39e3b8fb0af7652e7e720626f0e1298e/samples/nrf9160/http_update/application_update#testing"&gt;Testing&lt;/a&gt;&lt;/p&gt;[/quote]
&lt;p&gt;See here my partition file.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;...
b0_container:
  address: 0x0
  end_address: 0x8000
  orig_span: &amp;amp;id001
  - b0
  region: flash_primary
  size: 0x8000
  span: *id001
external_flash:
  address: 0x100000
  end_address: 0x800000
  region: external_flash
  size: 0x700000
mcuboot:
  address: 0x8200
  end_address: 0x10000
  placement:
    before:
    - mcuboot_primary
  region: flash_primary
  sharers: 0x1
  size: 0x7e00
mcuboot_pad:
  address: 0x18000
  end_address: 0x18200
  placement:
    align:
      start: 0x8000
    before:
    - mcuboot_primary_app
  region: flash_primary
  sharers: 0x2
  size: 0x200
mcuboot_primary:
  address: 0x18000
  end_address: 0xf8000
  orig_span: &amp;amp;id002
  - spm
  - app
  - mcuboot_pad
  region: flash_primary
  size: 0xe0000
  span: *id002
mcuboot_primary_app:
  address: 0x18200
  end_address: 0xf8000
  orig_span: &amp;amp;id003
  - app
  - spm
  region: flash_primary
  size: 0xdfe00
  span: *id003
mcuboot_secondary:
  address: 0x0
  device: MX25L64
  end_address: 0x100000
  placement:
    align:
      start: 0x4
  region: external_flash
  size: 0x100000
  ...&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Note that &amp;#39;External flash&amp;#39; has decreased the size because of &amp;#39;mcuboot_secondary&amp;#39; and the size of &amp;#39;&lt;span&gt;mcuboot_primary_app&lt;/span&gt;&amp;#39;&amp;nbsp;is 0xdfe00 (916 992B).&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve made several FOTA updates on the client with no errors and didn&amp;#39;t use any patch.&lt;/p&gt;
&lt;p&gt;There must be something else missing on your configurations&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Ext Flash
CONFIG_SPI=y
#CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_SPI_NOR=y

# This value must match the size of the MCUboot primary partition
CONFIG_PM_PARTITION_SIZE_MCUBOOT_SECONDARY=0x100000

CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_SPI_NRFX_RAM_BUFFER_SIZE=32&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is what i add to my &amp;#39;prj.conf&amp;#39;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot’s secondary image on external flash on nrf9160</title><link>https://devzone.nordicsemi.com/thread/359673?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 21:26:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8a747b0-bcf8-4605-aed9-448394047e21</guid><dc:creator>Rokk Research</dc:creator><description>&lt;p&gt;Hi Simon and ICM_UC,&lt;/p&gt;
&lt;p&gt;Just a heads up - it doesn&amp;#39;t look like this example is properly putting the secondary partition into external flash.&amp;nbsp; I built it and&amp;nbsp;took a look at build/partitions.yml - check out mcuboot_secondary:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;mcuboot_secondary:
  address: 0x88000
  end_address: 0x100000
  placement:
    after:
    - mcuboot_primary
    align:
      start: 0x8000
  region: flash_primary
  share_size:
  - mcuboot_primary
  size: 0x78000
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also, when you build the sample, you can see that only about half of the Nordic flash is available for the application (~425K), instead of almost the entire flash (~900K):&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;[218/223] Linking C executable zephyr/zephyr.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:      100572 B     425472 B     23.64%
            SRAM:       30112 B     178968 B     16.83%
        IDT_LIST:          0 GB         2 KB      0.00%
        &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The reason I was looking at this is because I recently got FOTA working on nRF91 using an external SPI flash for the secondary image, and it actually took a patch to MCUBoot to get it working:&lt;br /&gt;&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-mcuboot/pull/200"&gt;https://github.com/nrfconnect/sdk-mcuboot/pull/200&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I suspect if you fix the config for this sample to actually use the external SPI flash for mcuboot_secondary, you&amp;#39;ll also need this patch as well for NCS v1.7.0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot’s secondary image on external flash on nrf9160</title><link>https://devzone.nordicsemi.com/thread/348115?ContentTypeID=1</link><pubDate>Mon, 17 Jan 2022 16:15:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2661552c-5b87-4b73-a970-1ab3ed8fd520</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;That makes sense. I&amp;#39;m happy you found the solution. You could also add the external flash to the custom board dts files.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot’s secondary image on external flash on nrf9160</title><link>https://devzone.nordicsemi.com/thread/347983?ContentTypeID=1</link><pubDate>Mon, 17 Jan 2022 10:46:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab66bf58-4c0e-44c4-8815-204b81e53d46</guid><dc:creator>ICM_UC</dc:creator><description>&lt;p&gt;I found the error.&lt;/p&gt;
&lt;p&gt;In my case as i&amp;#39;m using an custom board, the definition of SPI3 was on &amp;#39;*.overlay&amp;#39; and mcuboot doesn&amp;#39;t have access to it. To solve it add this line to &amp;#39;CMakeLists.txt&amp;#39; right after cmake_minimum_required(...)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;cmake_minimum_required(VERSION ......)

set(mcuboot_DTC_OVERLAY_FILE &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/${BOARD}.overlay&amp;quot;)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This way mcuboot knows jedec-id and size and compiles without a problem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot’s secondary image on external flash on nrf9160</title><link>https://devzone.nordicsemi.com/thread/347821?ContentTypeID=1</link><pubDate>Fri, 14 Jan 2022 16:02:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8bbb9d2-b62a-4c5d-acfb-f12982e849d4</guid><dc:creator>ICM_UC</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Thks for your help.&lt;/p&gt;
&lt;p&gt;I went through the file from your sample and tried to replicate the configurations to mine, but with no success. So before coming here i downloaded your example and created a project on segger, then when i try to build the solution it gives an error&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1642175182688v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;In order to create the project i had to add to &amp;#39;nrf9160dk_nrf9160_ns.overlay&amp;#39; &amp;amp;SPI3&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;spi3 {
	status = &amp;quot;okay&amp;quot;;
	sck-pin = &amp;lt;8&amp;gt;;
	mosi-pin = &amp;lt;11&amp;gt;;
	miso-pin = &amp;lt;10&amp;gt;;
	cs-gpios = &amp;lt;&amp;amp;gpio0 9 GPIO_ACTIVE_LOW&amp;gt;;
	mx25r64: mx25r6435f@0 {
		compatible = &amp;quot;jedec,spi-nor&amp;quot;;
		reg = &amp;lt;0&amp;gt;;
		spi-max-frequency = &amp;lt;8000000&amp;gt;;
		label = &amp;quot;MX25R64&amp;quot;;
		jedec-id = [c2 28 17];
		sfdp-bfp = [
			e5 20 f1 ff  ff ff ff 03  44 eb 08 6b  08 3b 04 bb
			ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
			10 d8 00 ff  23 72 f5 00  82 ed 04 cc  44 83 68 44
			30 b0 30 b0  f7 c4 d5 5c  00 be 29 ff  f0 d0 ff ff
		];
		size = &amp;lt;67108864&amp;gt;;
		has-dpd;
		t-enter-dpd = &amp;lt;10000&amp;gt;;
		t-exit-dpd = &amp;lt;35000&amp;gt;;
	};
};

/ {
	chosen {
		nordic,pm-ext-flash = &amp;amp;mx25r64;
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Can you help to diagnose the issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot’s secondary image on external flash on nrf9160</title><link>https://devzone.nordicsemi.com/thread/347597?ContentTypeID=1</link><pubDate>Thu, 13 Jan 2022 13:15:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10b88e37-05ed-46ff-bc0f-bd8e635e6ce2</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;In&amp;nbsp;&lt;a href="https://github.com/simon-iversen/sdk-nrf/tree/d1a11f2c39e3b8fb0af7652e7e720626f0e1298e/samples/nrf9160/http_update/application_update"&gt;nRF9160: HTTP application update using the nRF9160DK&amp;#39;s external flash&lt;/a&gt;,&amp;nbsp;I have modified the http_update/application_update sample to support MCUboot updates using the 91DK&amp;#39;s onboard external flash as secondary slot. I tested this sample with NCS v1.7.0, but I guess it will work fine with NCS v1.8.0 as well.&lt;/p&gt;
&lt;p&gt;Test it yourself by following the steps&amp;nbsp;under &lt;a href="https://github.com/simon-iversen/sdk-nrf/tree/d1a11f2c39e3b8fb0af7652e7e720626f0e1298e/samples/nrf9160/http_update/application_update#testing"&gt;Testing&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In this sample I have set the &lt;a href="https://github.com/simon-iversen/sdk-nrf/blob/d1a11f2c39e3b8fb0af7652e7e720626f0e1298e/samples/nrf9160/http_update/application_update/prj.conf#L62"&gt;secondary partitions through the prj.conf file&lt;/a&gt;, but it&amp;#39;s probably better practice to use a&lt;em&gt; pm_static.yml&lt;/em&gt; file, e.g. like done in this sample:&amp;nbsp;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/ncs-dfu#serial_dfu_ext_flash"&gt;Serial DFU using external flash&lt;/a&gt;.&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></channel></rss>