<?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>Failed to set MCUboot secondary to external flash. E: Failed to open flash area ID 2 (image 0 slot 1): -2, cannot continue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/116419/failed-to-set-mcuboot-secondary-to-external-flash-e-failed-to-open-flash-area-id-2-image-0-slot-1--2-cannot-continue</link><description>I have problem placing MCUboot secondary to external flash. I have been testing using nRF9160DK. Project compiles fine but device doesn&amp;#39;t boot after flashing the firmware. 
 Here is the log from serial output of the board. I get error message E: Failed</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 06 Dec 2024 13:46:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/116419/failed-to-set-mcuboot-secondary-to-external-flash-e-failed-to-open-flash-area-id-2-image-0-slot-1--2-cannot-continue" /><item><title>RE: Failed to set MCUboot secondary to external flash. E: Failed to open flash area ID 2 (image 0 slot 1): -2, cannot continue</title><link>https://devzone.nordicsemi.com/thread/513835?ContentTypeID=1</link><pubDate>Fri, 06 Dec 2024 13:46:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f19d58ed-fc97-4024-90bd-355d522972ea</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Markus&lt;/p&gt;
&lt;p&gt;Abhijith is out of office, so I&amp;#39;ll be looking after this case in his absence. I noticed that you&amp;#39;re missing the&amp;nbsp;&lt;span&gt;&lt;strong&gt;SB_CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK&lt;/strong&gt;=y config set in your &lt;strong&gt;sysbuild.conf&lt;/strong&gt;&amp;nbsp;&lt;strong&gt;&lt;/strong&gt;file. So start by adding that and see if that makes any difference on your end.&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: Failed to set MCUboot secondary to external flash. E: Failed to open flash area ID 2 (image 0 slot 1): -2, cannot continue</title><link>https://devzone.nordicsemi.com/thread/513121?ContentTypeID=1</link><pubDate>Tue, 03 Dec 2024 08:18:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d29322c8-48bd-41e4-a2c9-e19388d1bbd6</guid><dc:creator>mmade</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I tried those samples and I managed to&amp;nbsp;communicate with external flash using the samples. However that didn&amp;#39;t help to solve my original problem.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here is the pm_static.yml file which is generated in build folder (copied partitions.yml from build folder and renamed to pm_static.yml). It shows that partition manager has allocated mcuboot_secondary to external flash.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;EMPTY_0:
  address: 0x14000
  end_address: 0x18000
  placement:
    before:
    - s1_pad
  region: flash_primary
  size: 0x4000
EMPTY_1:
  address: 0x24000
  end_address: 0x28000
  placement:
    before:
    - mcuboot_pad
  region: flash_primary
  size: 0x4000
app:
  address: 0x38000
  end_address: 0x100000
  region: flash_primary
  size: 0xc8000
app_image:
  address: 0x28200
  end_address: 0x100000
  orig_span: &amp;amp;id001
  - tfm
  - app
  region: flash_primary
  size: 0xd7e00
  span: *id001
b0:
  address: 0x0
  end_address: 0x8000
  placement:
    after:
    - start
  region: flash_primary
  size: 0x8000
b0_container:
  address: 0x0
  end_address: 0x8000
  orig_span: &amp;amp;id002
  - b0
  region: flash_primary
  size: 0x8000
  span: *id002
external_flash:
  address: 0xd8000
  end_address: 0x800000
  region: external_flash
  size: 0x728000
mcuboot:
  address: 0x8200
  end_address: 0x14000
  placement:
    align:
      end: 0x1000
    before:
    - mcuboot_primary
  region: flash_primary
  sharers: 0x1
  size: 0xbe00
mcuboot_pad:
  address: 0x28000
  end_address: 0x28200
  placement:
    align:
      start: 0x8000
    before:
    - mcuboot_primary_app
  region: flash_primary
  sharers: 0x2
  size: 0x200
mcuboot_primary:
  address: 0x28000
  end_address: 0x100000
  orig_span: &amp;amp;id003
  - app
  - tfm
  - mcuboot_pad
  region: flash_primary
  size: 0xd8000
  span: *id003
mcuboot_primary_app:
  address: 0x28200
  end_address: 0x100000
  orig_span: &amp;amp;id004
  - app
  - tfm
  region: flash_primary
  size: 0xd7e00
  span: *id004
mcuboot_secondary:
  address: 0x0
  device: DT_CHOSEN(nordic_pm_ext_flash)
  end_address: 0xd8000
  placement:
    align:
      start: 0x4
  region: external_flash
  share_size:
  - mcuboot_primary
  size: 0xd8000
mcuboot_sram:
  address: 0x20000000
  end_address: 0x20008000
  orig_span: &amp;amp;id005
  - tfm_sram
  region: sram_primary
  size: 0x8000
  span: *id005
nrf_modem_lib_ctrl:
  address: 0x20008000
  end_address: 0x200084e8
  inside:
  - sram_nonsecure
  placement:
    after:
    - tfm_sram
    - start
  region: sram_primary
  size: 0x4e8
nrf_modem_lib_rx:
  address: 0x2000a568
  end_address: 0x2000c568
  inside:
  - sram_nonsecure
  placement:
    after:
    - nrf_modem_lib_tx
  region: sram_primary
  size: 0x2000
nrf_modem_lib_sram:
  address: 0x20008000
  end_address: 0x2000c568
  orig_span: &amp;amp;id006
  - nrf_modem_lib_ctrl
  - nrf_modem_lib_tx
  - nrf_modem_lib_rx
  region: sram_primary
  size: 0x4568
  span: *id006
nrf_modem_lib_tx:
  address: 0x200084e8
  end_address: 0x2000a568
  inside:
  - sram_nonsecure
  placement:
    after:
    - nrf_modem_lib_ctrl
  region: sram_primary
  size: 0x2080
otp:
  address: 0xff8388
  end_address: 0xff83fc
  region: otp
  size: 0x74
provision:
  address: 0xff8108
  end_address: 0xff8388
  region: otp
  size: 0x280
s0:
  address: 0x8000
  end_address: 0x14000
  orig_span: &amp;amp;id007
  - mcuboot
  - s0_pad
  region: flash_primary
  size: 0xc000
  span: *id007
s0_image:
  address: 0x8200
  end_address: 0x14000
  orig_span: &amp;amp;id008
  - mcuboot
  region: flash_primary
  size: 0xbe00
  span: *id008
s0_pad:
  address: 0x8000
  end_address: 0x8200
  placement:
    after:
    - b0_container
    align:
      start: 0x8000
  region: flash_primary
  share_size:
  - mcuboot_pad
  size: 0x200
s1:
  address: 0x18000
  end_address: 0x24000
  orig_span: &amp;amp;id009
  - s1_pad
  - s1_image
  region: flash_primary
  size: 0xc000
  span: *id009
s1_image:
  address: 0x18200
  end_address: 0x24000
  placement:
    after:
    - s1_pad
    - s0
  region: flash_primary
  share_size:
  - mcuboot
  size: 0xbe00
s1_pad:
  address: 0x18000
  end_address: 0x18200
  placement:
    after:
    - s0
    align:
      start: 0x8000
  region: flash_primary
  share_size:
  - mcuboot_pad
  size: 0x200
sram_nonsecure:
  address: 0x20008000
  end_address: 0x20040000
  orig_span: &amp;amp;id010
  - sram_primary
  - nrf_modem_lib_ctrl
  - nrf_modem_lib_tx
  - nrf_modem_lib_rx
  region: sram_primary
  size: 0x38000
  span: *id010
sram_primary:
  address: 0x2000c568
  end_address: 0x20040000
  region: sram_primary
  size: 0x33a98
sram_secure:
  address: 0x20000000
  end_address: 0x20008000
  orig_span: &amp;amp;id011
  - tfm_sram
  region: sram_primary
  size: 0x8000
  span: *id011
tfm:
  address: 0x28200
  end_address: 0x38000
  inside:
  - mcuboot_primary_app
  placement:
    before:
    - app
  region: flash_primary
  size: 0xfe00
tfm_nonsecure:
  address: 0x38000
  end_address: 0x100000
  orig_span: &amp;amp;id012
  - app
  region: flash_primary
  size: 0xc8000
  span: *id012
tfm_secure:
  address: 0x28000
  end_address: 0x38000
  orig_span: &amp;amp;id013
  - mcuboot_pad
  - tfm
  region: flash_primary
  size: 0x10000
  span: *id013
tfm_sram:
  address: 0x20000000
  end_address: 0x20008000
  inside:
  - sram_secure
  placement:
    after:
    - start
  region: sram_primary
  size: 0x8000&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to set MCUboot secondary to external flash. E: Failed to open flash area ID 2 (image 0 slot 1): -2, cannot continue</title><link>https://devzone.nordicsemi.com/thread/512831?ContentTypeID=1</link><pubDate>Sat, 30 Nov 2024 02:26:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ba8f5ef-41d3-49cb-b4af-235cb313f8d1</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I checked the ZIP file you shared, but I don&amp;#39;t see a partition manager file defining the secondary slot in the external flash. Before integrating the external flash with MCUboot, please test whether you can write to and read from the external flash using a basic SPI/QSPI test sample provided by Zephyr (&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/drivers/spi_flash"&gt;see the sample&lt;/a&gt;). I recommend referring to the &lt;a href="https://github.com/nrfconnect/sdk-nrf/tree/main/tests/modules/mcuboot/external_flash"&gt;MCUboot external flash test sample &lt;/a&gt;included in the SDK.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to set MCUboot secondary to external flash. E: Failed to open flash area ID 2 (image 0 slot 1): -2, cannot continue</title><link>https://devzone.nordicsemi.com/thread/511807?ContentTypeID=1</link><pubDate>Mon, 25 Nov 2024 06:25:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d74e03f6-7726-4848-819b-9477c3d06d11</guid><dc:creator>mmade</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Samples from the SDK work fine. Changing&amp;nbsp;&lt;span&gt;SB_CONFIG_SECURE_BOOT_APPCORE=y from y to n didn&amp;#39;t solve problem.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I have enabled partition manager on overlay and also enabled partition manager for the external flash with&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;The debug logging for MCUboot didn&amp;#39;t show more than what is in first post. The whole project is in zip file&amp;nbsp;on first post.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to set MCUboot secondary to external flash. E: Failed to open flash area ID 2 (image 0 slot 1): -2, cannot continue</title><link>https://devzone.nordicsemi.com/thread/511804?ContentTypeID=1</link><pubDate>Mon, 25 Nov 2024 04:26:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d585ddc4-ee98-448c-819e-ea3219874784</guid><dc:creator>Menon</dc:creator><description>&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;Hello,&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div dir="auto"&gt;
&lt;div&gt;
&lt;div&gt;
&lt;p&gt;Sorry for getting back to you a bit late. I was out of the office last week due to a family emergency. I apologize if this has caused any inconvenience for you.&lt;/p&gt;
&lt;p&gt;Could you answer the questions I asked in my first response? How have you configured the partition manager for the external flash? Have you properly defined the external flash in the DTS or through an overlay file? If so, could you share it here so that I can review it? Also, try enabling the MCUboot logs, as they will provide more information on the issue.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Abhijith&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to set MCUboot secondary to external flash. E: Failed to open flash area ID 2 (image 0 slot 1): -2, cannot continue</title><link>https://devzone.nordicsemi.com/thread/511213?ContentTypeID=1</link><pubDate>Wed, 20 Nov 2024 05:23:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70670700-9a66-40ce-bb9b-eedec2e837e2</guid><dc:creator>mmade</dc:creator><description>&lt;p&gt;Thank you for the tip. I have tried to add&amp;nbsp;CONFIG_NORDIC_QSPI_NOR to mcuboot.conf and prj.conf but it doesn&amp;#39;t solve the problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to set MCUboot secondary to external flash. E: Failed to open flash area ID 2 (image 0 slot 1): -2, cannot continue</title><link>https://devzone.nordicsemi.com/thread/510969?ContentTypeID=1</link><pubDate>Mon, 18 Nov 2024 21:51:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4911ee10-a19f-45b7-baaf-60c580d1e778</guid><dc:creator>JH7</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/mmade"&gt;mmade&lt;/a&gt;&amp;nbsp;I had the same issue with nrf52840 dk and finally found it to be related to&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_NORDIC_QSPI_NOR. &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;It was not enabled in my project.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Hope this helps.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to set MCUboot secondary to external flash. E: Failed to open flash area ID 2 (image 0 slot 1): -2, cannot continue</title><link>https://devzone.nordicsemi.com/thread/510649?ContentTypeID=1</link><pubDate>Fri, 15 Nov 2024 10:26:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43c1b1f6-1586-4551-82a1-bdc2b9c39056</guid><dc:creator>mmade</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If I remove line&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y&lt;/pre&gt; from the sysbuild.conf the application works. I have tried with 2.7.0 and today updated to 2.8.0 and it didn&amp;#39;t help. Both with using sysbuild.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to set MCUboot secondary to external flash. E: Failed to open flash area ID 2 (image 0 slot 1): -2, cannot continue</title><link>https://devzone.nordicsemi.com/thread/510627?ContentTypeID=1</link><pubDate>Fri, 15 Nov 2024 08:58:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a430e04c-8e19-46c7-9b97-076ac74c2556</guid><dc:creator>Menon</dc:creator><description>&lt;div&gt;
&lt;div dir="auto"&gt;
&lt;div&gt;
&lt;div&gt;
&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Have you tried flashing any sample from the SDK? If so, does it work fine? From the logs, I see that you’re using nRF Connect SDK v2.8.0, so I assume you’re using sysbuild. If not, I recommend trying it.&lt;/p&gt;
&lt;p&gt;Could you also disable &lt;code&gt;SB_CONFIG_SECURE_BOOT_APPCORE=y&lt;/code&gt; in &lt;code&gt;sysbuild.conf&lt;/code&gt; and check if you’re able to flash the application?&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Abhijith&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>