<?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 reboots back to old image</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89029/mcuboot-reboots-back-to-old-image</link><description>Hi, 
 I work on a project that required a sector in flash to store some information hence I changed the partition in the pm_static.yml file and the dts file (although I guess this has no effect when using MCUboot). 
 The problems I have encountered is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 16 Jun 2022 19:38:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89029/mcuboot-reboots-back-to-old-image" /><item><title>RE: Mcuboot reboots back to old image</title><link>https://devzone.nordicsemi.com/thread/372880?ContentTypeID=1</link><pubDate>Thu, 16 Jun 2022 19:38:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb825fe3-ee08-491e-8bfe-84eb813ac80a</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;It is not recommended to change the partitions between updates, since mcuboot will still use the old partitions sizes and positions. I can see that the allocated size for the application image is larger for the new build (A) compared to the old build (B) (you can see that mcuboot_primary/secondary has the size 0x76000 in A, and the size 0x77000 in B). Maybe that would cause some issues? I can also see&amp;nbsp;that some other partitions has changed start position.&lt;/p&gt;
&lt;p&gt;However, it is hard to say what&amp;#39;s causing it.&lt;/p&gt;
[quote user=""]Flashing a firmware (A) that uses the new partition, it is not possible to downgrade to a firmware (B) using the old partition. The downgrade is succesful but the system reboots after a few seconds and reverts the image back to (A).&amp;nbsp;[/quote]
&lt;p&gt;My understanding of the above statement is that MCUboot is able to validate image B and swap it with A, but when booting into B it reboots and swaps back.&lt;/p&gt;
&lt;p&gt;Maybe a fault is happening during the init phase, before image B is able to run&amp;nbsp;&lt;span&gt;&lt;code&gt;boot_write_img_confirmed()&lt;/code&gt; (does not confirm itself), and due to &lt;code&gt;CONFIG_RESET_ON_FATAL_ERROR=y&lt;/code&gt;, the program resets, swaps back and boots into image A (since B is not confirmed). Could enable UART or RTT logging&amp;nbsp;and&amp;nbsp;set &lt;code&gt;CONFIG_LOG=y&lt;/code&gt; in image B and see if you get any info about why it resets?&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: Mcuboot reboots back to old image</title><link>https://devzone.nordicsemi.com/thread/372818?ContentTypeID=1</link><pubDate>Thu, 16 Jun 2022 12:49:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b525b437-6e37-4a4c-baef-439bf748bee2</guid><dc:creator>Christoffer Brask</dc:creator><description>&lt;p&gt;(A)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;EMPTY_0:
  address: 0xf8000
  end_address: 0xf9000
  placement:
    after:
    - mcuboot_secondary
  region: flash_primary
  size: 0x1000
app:
  address: 0xc200
  end_address: 0x82000
  region: flash_primary
  size: 0x75e00
mcuboot:
  address: 0x0
  end_address: 0xc000
  placement:
    before:
    - mcuboot_primary
  region: flash_primary
  size: 0xc000
mcuboot_pad:
  address: 0xc000
  end_address: 0xc200
  placement:
    align:
      start: 0x1000
    before:
    - mcuboot_primary_app
  region: flash_primary
  size: 0x200
mcuboot_primary:
  address: 0xc000
  end_address: 0x82000
  orig_span: &amp;amp;id001
  - app
  - mcuboot_pad
  region: flash_primary
  sharers: 0x1
  size: 0x76000
  span: *id001
mcuboot_primary_app:
  address: 0xc200
  end_address: 0x82000
  orig_span: &amp;amp;id002
  - app
  region: flash_primary
  size: 0x75e00
  span: *id002
mcuboot_secondary:
  address: 0x82000
  end_address: 0xf8000
  placement:
    after:
    - mcuboot_primary
    align:
      start: 0x1000
    align_next: 0x1000
  region: flash_primary
  share_size:
  - mcuboot_primary
  size: 0x76000
settings_storage:
  address: 0xf9000
  end_address: 0xfc000
  placement:
    before:
    - uptime_storage
  region: flash_primary
  size: 0x3000
sram_primary:
  address: 0x20000000
  end_address: 0x20040000
  region: sram_primary
  size: 0x40000
uptime_storage:
  address: 0xfc000
  end_address: 0xfd000
  placement:
    before:
    - user_storage
  region: flash_primary
  size: 0x1000
user_storage:
  address: 0xfd000
  end_address: 0x100000
  placement:
    before:
    - end
  region: flash_primary
  size: 0x3000&lt;/pre&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;(B)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;app:
  address: 0xc200
  end_address: 0x83000
  region: flash_primary
  size: 0x76e00
mcuboot:
  address: 0x0
  end_address: 0xc000
  placement:
    before:
    - mcuboot_primary
  region: flash_primary
  size: 0xc000
mcuboot_pad:
  address: 0xc000
  end_address: 0xc200
  placement:
    align:
      start: 0x1000
    before:
    - mcuboot_primary_app
  region: flash_primary
  size: 0x200
mcuboot_primary:
  address: 0xc000
  end_address: 0x83000
  orig_span: &amp;amp;id001
  - mcuboot_pad
  - app
  region: flash_primary
  sharers: 0x1
  size: 0x77000
  span: *id001
mcuboot_primary_app:
  address: 0xc200
  end_address: 0x83000
  orig_span: &amp;amp;id002
  - app
  region: flash_primary
  size: 0x76e00
  span: *id002
mcuboot_secondary:
  address: 0x83000
  end_address: 0xfa000
  placement:
    after:
    - mcuboot_primary
    align:
      start: 0x1000
    align_next: 0x1000
  region: flash_primary
  share_size:
  - mcuboot_primary
  size: 0x77000
settings_storage:
  address: 0xfa000
  end_address: 0xfd000
  placement:
    before:
    - user_storage
  region: flash_primary
  size: 0x3000
sram_primary:
  address: 0x20000000
  end_address: 0x20040000
  region: sram_primary
  size: 0x40000
user_storage:
  address: 0xfd000
  end_address: 0x100000
  placement:
    before:
    - end
  region: flash_primary
  size: 0x3000
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mcuboot reboots back to old image</title><link>https://devzone.nordicsemi.com/thread/372807?ContentTypeID=1</link><pubDate>Thu, 16 Jun 2022 12:21:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd8b4480-a737-47ee-8ee1-82650126c84b</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Could you upload the complete generated pm output&amp;nbsp;you get after buliding the old (B), and the new (A) image? You can find the output in&amp;nbsp;&lt;em&gt;&amp;lt;application&amp;gt;\build\partitions.yml&lt;/em&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mcuboot reboots back to old image</title><link>https://devzone.nordicsemi.com/thread/372705?ContentTypeID=1</link><pubDate>Thu, 16 Jun 2022 06:46:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:125a0ccd-5af1-4d61-8ed9-b6bbe99359b8</guid><dc:creator>Christoffer Brask</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;settings_storage:
  address: 0xf9000
  size: 0x3000
  end_address: 0xfc000
  placement:
    before:
    - uptime_storage
  region: flash_primary
uptime_storage:
  address: 0xfc000
  size: 0x1000
  end_address: 0xfd000
  placement:
    before:
    - user_storage
  region: flash_primary
user_storage:
  address: 0xfd000
  size: 0x3000
  end_address: 0x100000
  placement:
    before:
    - end
  region: flash_primary&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;New static file&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Mcuboot reboots back to old image</title><link>https://devzone.nordicsemi.com/thread/372703?ContentTypeID=1</link><pubDate>Thu, 16 Jun 2022 06:45:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef136025-e49b-415e-8047-7cd640f039b7</guid><dc:creator>Christoffer Brask</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;settings_storage:
  address: 0xfa000
  size: 0x3000
  end_address: 0xfd000
  placement:
    before:
    - user_storage
  region: flash_primary
user_storage:
  address: 0xfd000
  size: 0x3000
  end_address: 0x100000
  placement:
    before:
    - end
  region: flash_primary&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Old static file&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>