<?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>Image swap with MCUmgr does not work, after reset device end up in endless loop</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/109057/image-swap-with-mcumgr-does-not-work-after-reset-device-end-up-in-endless-loop</link><description>Hello i have an issue that i created boot and booted the thingy53 nrf5340 with smp svr example with west. So far everything went smoothly. Then i tried to create similar build and upload signed.bin via mcumgr image upload mcumgr --conntype serial --connstring</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 08 Mar 2024 12:06:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/109057/image-swap-with-mcumgr-does-not-work-after-reset-device-end-up-in-endless-loop" /><item><title>RE: Image swap with MCUmgr does not work, after reset device end up in endless loop</title><link>https://devzone.nordicsemi.com/thread/472930?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2024 12:06:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31a5cbfa-0fe5-4384-ae03-2cc57d0b0e73</guid><dc:creator>Daver</dc:creator><description>&lt;p&gt;I resolved the issue i dug down into the problem. It was in signing the image as i used:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# I used &amp;quot;--header-size 32 --pad-header&amp;quot; becase --&amp;gt; &amp;quot;error header size was not specified&amp;quot;
# The error suggested using specified 32 size header

west sign -t imgtool -- --key C:\ncs\v2.5.2\bootloader\mcuboot\root-rsa-2048.pem  --header-size 32 --pad-header&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The problem was that image generated before sign had 512 header so after adjusting command as shown&lt;pre class="ui-code" data-mode="text"&gt;west sign -t imgtool -- --key C:\ncs\v2.5.2\bootloader\mcuboot\root-rsa-2048.pem  --header-size 512 --pad-header&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;i was able to update firmware via MCUmgr and serial communication&lt;br /&gt;also minor changes i used these config files:&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;-DEXTRA_CONF_FILE=&amp;#39;overlay-serial.conf;overlay-fs.conf;overlay-shell-mgmt.conf&amp;#39;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Image swap with MCUmgr does not work, after reset device end up in endless loop</title><link>https://devzone.nordicsemi.com/thread/472869?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2024 09:10:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e38a877-3f59-40b9-91c5-c9e2398dcdad</guid><dc:creator>frax84</dc:creator><description>&lt;p&gt;I don&amp;#39;t see anything evidently wrong in these settings. Moreover, imho, this part has not super clear docs to work with, but i would start from these to debug your issue&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Image swap with MCUmgr does not work, after reset device end up in endless loop</title><link>https://devzone.nordicsemi.com/thread/472865?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2024 08:57:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7db8c768-22ae-4b14-961e-b264d1c2a815</guid><dc:creator>Daver</dc:creator><description>&lt;p&gt;prj.conf&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Enable MCUmgr and dependencies.
CONFIG_NET_BUF=y
CONFIG_ZCBOR=y
CONFIG_CRC=y
CONFIG_MCUMGR=y
CONFIG_STREAM_FLASH=y
CONFIG_FLASH_MAP=y

# Some command handlers require a large stack.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2304
CONFIG_MAIN_STACK_SIZE=2048

# Ensure an MCUboot-compatible binary is generated.
CONFIG_BOOTLOADER_MCUBOOT=y

# Enable flash operations.
CONFIG_FLASH=y

# Required by the `taskstat` command.
CONFIG_THREAD_MONITOR=y

# Support for taskstat command
CONFIG_MCUMGR_GRP_OS_TASKSTAT=y

# Enable statistics and statistic names.
CONFIG_STATS=y
CONFIG_STATS_NAMES=y

# Enable most core commands.
CONFIG_FLASH=y
CONFIG_IMG_MANAGER=y
CONFIG_MCUMGR_GRP_IMG=y
CONFIG_MCUMGR_GRP_OS=y
CONFIG_MCUMGR_GRP_STAT=y

# Enable logging
CONFIG_LOG=y
CONFIG_MCUBOOT_UTIL_LOG_LEVEL_WRN=y

# Disable debug logging
CONFIG_LOG_MAX_LEVEL=3
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;overlay-shell.conf&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Enable the shell MCUmgr transport.
CONFIG_BASE64=y
CONFIG_SHELL=y
CONFIG_SHELL_BACKEND_SERIAL=y
CONFIG_MCUMGR_TRANSPORT_SHELL=y

# mcumgr-cli application doesn&amp;#39;t accepts log in the channel it uses
CONFIG_SHELL_LOG_BACKEND=n
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;custom-edit.conf&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_USE_SEGGER_RTT=y
#CONFIG_LOG_BACKEND_RTT=y
CONFIG_BOOTLOADER_MCUBOOT=y


CONFIG_LOG_MODE_DEFERRED=y
CONFIG_LOG_RUNTIME_FILTERING=y
CONFIG_LOG_BUFFER_SIZE=2048
CONFIG_LOG_PRINTK=y
CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD=0
CONFIG_LOG_TAG_MAX_LEN=8
CONFIG_MCUBOOT_UTIL_LOG_LEVEL_DBG=y
# Disable debug logging
#CONFIG_LOG_MAX_LEVEL=3
#UART LOGGING
CONFIG_LOG_BACKEND_UART=y

CONFIG_LOG_MAX_LEVEL=4
CONFIG_LOG_DEFAULT_LEVEL=3&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Image swap with MCUmgr does not work, after reset device end up in endless loop</title><link>https://devzone.nordicsemi.com/thread/472864?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2024 08:50:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75284d92-7947-4e98-9b51-74c8248b8cbb</guid><dc:creator>frax84</dc:creator><description>&lt;p&gt;Can you share your proj.conf and mcuboot.conf configuration settings?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Image swap with MCUmgr does not work, after reset device end up in endless loop</title><link>https://devzone.nordicsemi.com/thread/472863?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2024 08:47:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddda8107-bebd-4109-a509-ca0bc70213f0</guid><dc:creator>Daver</dc:creator><description>&lt;p&gt;Yes i did exactly that but the problem is i lost communication after reset and could not confirm the image. My serial communication runs on com 7 but after reset it does not show any device on com 7&lt;br /&gt;In debuger i end up in:&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;FUNC_NORETURN&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;__weak&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;void&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;arch_system_halt&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;unsigned&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;int&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;reason&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;ARG_UNUSED&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;reason&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; /* TODO: What&amp;#39;s the best way to totally halt the system if SMP&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* is enabled?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; (&lt;/span&gt;&lt;span&gt;void&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;arch_irq_lock&lt;/span&gt;&lt;span&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;for&lt;/span&gt;&lt;span&gt; (;;) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* Spin endlessly */&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; }&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: Image swap with MCUmgr does not work, after reset device end up in endless loop</title><link>https://devzone.nordicsemi.com/thread/472862?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2024 08:41:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:653989b7-e84e-4f13-86b5-fd4313f806e1</guid><dc:creator>frax84</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;did you confirm the image? You said that you tested the image and then reset, so i suppose you did something like this:&lt;/p&gt;
&lt;p&gt;mcumgr -c acm0 image test &amp;lt;HASH&amp;gt;&lt;/p&gt;
&lt;p&gt;mcumgr -c acm0 reset&lt;/p&gt;
&lt;p&gt;NOTE: acm0 is the connection profile you&amp;#39;re using, created coherently with the procedure indicated&amp;nbsp;&lt;a href="https://docs.zephyrproject.org/latest/services/device_mgmt/mcumgr.html"&gt;HERE&lt;/a&gt;&amp;nbsp;in the docs.&lt;/p&gt;
&lt;p&gt;After this commands you should confirm the image:&lt;/p&gt;
&lt;p&gt;mcumgr -c acm0 image confirm &amp;lt;HASH&amp;gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>