<?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>Issues with MCUmgr over serial with nRF52 devkit/J-Link</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84174/issues-with-mcumgr-over-serial-with-nrf52-devkit-j-link</link><description>I am currently experiencing an issue using MCUmgr CLI over a serial connection provided by the on-board J-Link debuggers on nRF52 devkits. 
 When using MCUmgr CLI to send smaller simpler commands like echo and image list to the devkit, the first one succeeds</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 Jul 2022 07:55:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84174/issues-with-mcumgr-over-serial-with-nrf52-devkit-j-link" /><item><title>RE: Issues with MCUmgr over serial with nRF52 devkit/J-Link</title><link>https://devzone.nordicsemi.com/thread/376722?ContentTypeID=1</link><pubDate>Wed, 13 Jul 2022 07:55:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee9cadab-d5c4-4d75-82ad-75ac3a295f52</guid><dc:creator>FARLY7</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi, late reply. But my speed related issue was actually related to this bug in Mcumgr: &lt;/span&gt;&lt;a class="anchor-1MIwyf anchorUnderlineOnHover-2qPutX" title="https://github.com/apache/mynewt-newtmgr/issues/185" href="https://github.com/apache/mynewt-newtmgr/issues/185" rel="noopener noreferrer" target="_blank"&gt;https://github.com/apache/mynewt-newtmgr/issues/185&lt;/a&gt;&lt;span&gt;.&lt;br /&gt;&lt;br /&gt;Applying the provided patch, I was able to reduce the upload times down from 3.5mins to a more respectable 44s @ 115,200 baud:&lt;br /&gt;&lt;br /&gt;Original at 115,200 baud:&lt;br /&gt;&lt;/span&gt;&lt;code class="inline"&gt;247.23 KiB / 247.23 KiB [===============================] 100.00% 1.14 KiB/s 3m37s&lt;/code&gt;&lt;code class="inline"&gt;&lt;br /&gt;&lt;/code&gt;&lt;span&gt;with patch:&lt;br /&gt;&lt;/span&gt;&lt;code class="inline"&gt;247.23 KiB / 247.23 KiB [===============================] 100.00% 5.56 KiB/s 44s&lt;/code&gt;&lt;code class="inline"&gt;&lt;br /&gt;&lt;/code&gt;&lt;code class="inline"&gt;&lt;br /&gt;&lt;/code&gt;&lt;span&gt;For me, this issue was only occurring while using Serial Recovery mode of MCUBoot, it was not occurring when updating the image using application-level SMP server. I guess this has something to do with the flash alignment of the primary slot vs secondary slot. In Serial Recovery mode, Mcumgr was writing directly to primary slot, where as application-level updates the update is written to the secondary slot. &lt;br /&gt;&lt;br /&gt;Another interesting point for those running macOS. The &lt;/span&gt;&lt;code class="inline"&gt;serial_posix.go&lt;/code&gt;&lt;span&gt; file in the &lt;/span&gt;&lt;code class="inline"&gt;Tarm&lt;/code&gt;&lt;span&gt; serial library used by Mcumgr CLI tool limits the baud rate to 115,200, which is a standard POSIX limit. We also created a patch that removed the use of constants to define the baud rate and instead use the absolute baud rate value. This allowed us to run baud rates beyond 115,200. The highest we tested was 921,600 baud, bringing the upload times further down to &lt;/span&gt;&lt;strong&gt;11s&lt;/strong&gt;&lt;span&gt;! A massive improvement from 3.5mins.&lt;br /&gt;&lt;br /&gt;With patch at 921,600 baud:&lt;br /&gt;&lt;/span&gt;&lt;code class="inline"&gt;247.03 KiB / 247.03 KiB [===============================] 100.00% 21.89 KiB/s 11s&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with MCUmgr over serial with nRF52 devkit/J-Link</title><link>https://devzone.nordicsemi.com/thread/356971?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 17:28:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a356dd22-14dd-4613-98ba-c6d94f9dd70a</guid><dc:creator>rerickson</dc:creator><description>[quote userid="99317" url="~/f/nordic-q-a/84174/issues-with-mcumgr-over-serial-with-nrf52-devkit-j-link/356964#356964"] Do you know how to increase the upload speed?[/quote]
&lt;p&gt;In the past upping the MTU will increase the update speed:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MCUMGR&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MCUMGR_SMP_SHELL&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MCUMGR_SMP_SHELL_MTU&lt;/span&gt;&lt;span&gt;=2048&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MCUMGR_BUF_SIZE&lt;/span&gt;&lt;span&gt;=2050&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MGMT_CBORATTR_MAX_SIZE&lt;/span&gt;&lt;span&gt;=2048&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_FS_MGMT_UL_CHUNK_SIZE&lt;/span&gt;&lt;span&gt;=2048&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with MCUmgr over serial with nRF52 devkit/J-Link</title><link>https://devzone.nordicsemi.com/thread/356964?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 16:03:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:752f6397-1a02-4ef9-ae3f-995918e9b6bf</guid><dc:creator>FARLY7</dc:creator><description>&lt;p&gt;No problem Hakon, I will check this tomorrow and get back to you.&lt;/p&gt;
&lt;p&gt;One other question perhaps you can help with: Do you know how to increase the upload speed? It&amp;rsquo;s taking me 3.5mins to upload one ~256KB image. I am using serial recovery mode in MCUBoot if that makes any difference.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;What kind of upload speed/times do you see?&lt;/p&gt;
&lt;p&gt;I think I read somewhere else that there is a hard coded delay of 20ms between each packet in mcumgr tool, but I&amp;rsquo;ve not investigated this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with MCUmgr over serial with nRF52 devkit/J-Link</title><link>https://devzone.nordicsemi.com/thread/356852?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 11:30:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0584220-293d-4263-a683-bf56db6782df</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="FARLY7"]I just tried the suggestion from your answer in the other issue thread, and this worked.[/quote]
&lt;p&gt;This is interesting!&lt;/p&gt;
&lt;p&gt;Was the&amp;nbsp;CONFIG_HEAP_MEM_POOL_SIZE set to non-zero value prior to adjusting it?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with MCUmgr over serial with nRF52 devkit/J-Link</title><link>https://devzone.nordicsemi.com/thread/356822?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 10:10:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88162ff4-c299-4ebc-9b6d-56932346b98b</guid><dc:creator>FARLY7</dc:creator><description>&lt;p&gt;Hi Hakon,&lt;/p&gt;
&lt;p&gt;I just tried the suggestion from your answer in the other issue thread, and this worked.&lt;/p&gt;
&lt;p&gt;I will also test the smp_svr example again like you did. A little bit more investigation is required on my side to clarify where the issue is and how it is fixed.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Sean&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with MCUmgr over serial with nRF52 devkit/J-Link</title><link>https://devzone.nordicsemi.com/thread/356807?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 09:52:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:242d7ca0-1ba5-4457-8972-64780d117135</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="FARLY7"]I saw your post on&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/82975/serial-dfu-on-nrf9160-dk-fail-to-upload-image-using-mcumgr"&gt;this&lt;/a&gt;&amp;nbsp;similar issue, I will try your suggestion here and see if it works.[/quote]
&lt;p&gt;That is specifically for the nrf9160dk_nrf9160_ns target.&lt;/p&gt;
&lt;p&gt;I have seen similar issues in the past myself and disabling the MSD has usually been the fix.&lt;/p&gt;
&lt;p&gt;I just tested ncs v1.8.0 and ncs v1.9.0, with board nrf52dk_nrf52832, stock smp_svr (w/overlay-serial.conf):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;$ mcumgr --conntype serial --connstring /dev/ttyACM0 image upload zephyr/app_update.bin
 48.14 KiB / 48.14 KiB [====================================================================================] 100.00% 3.46 KiB/s 13s
Done
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;image list shows:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Images:
 image=0 slot=0
    version: 0.0.0
    bootable: true
    flags: active confirmed
    hash: ed10f5869785d67af2fa7d416016a6836c78c6254cd330b4446ba21b316ac2e4
 image=0 slot=1
    version: 0.0.0
    bootable: true
    flags: 
    hash: 1ffb1291735140f39b1ba1f920b14e07e26136abde2d92109ddacbd047d509a7
Split status: N/A (0)
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you see the same behavior on other PCs as well?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with MCUmgr over serial with nRF52 devkit/J-Link</title><link>https://devzone.nordicsemi.com/thread/356783?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 08:46:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec39f903-3ad6-4a97-a62e-f8941103c831</guid><dc:creator>FARLY7</dc:creator><description>&lt;p&gt;Yes, I have done this already. This is one of the first things I do with a new devkit.&lt;/p&gt;
&lt;p&gt;I have also tried different MTU sizes in the mcumgr connection parameters, but no luck.&lt;/p&gt;
&lt;p&gt;I saw your post on&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/82975/serial-dfu-on-nrf9160-dk-fail-to-upload-image-using-mcumgr"&gt;this&lt;/a&gt;&amp;nbsp;similar issue, I will try your suggestion here and see if it works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with MCUmgr over serial with nRF52 devkit/J-Link</title><link>https://devzone.nordicsemi.com/thread/356773?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 08:29:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60366309-8d5f-43b5-a3dd-c668cf9a7532</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you have issues with the usb-serial bridge in the debugger, it might be beneficial to disable the mass storage device in the debugger itself.&lt;/p&gt;
&lt;p&gt;This is done by opening J-Link Commander (JLinkExe on mac/linux) and writing:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;msddisable&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Remember to power cycle the board afterwards before testing again.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Håkon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with MCUmgr over serial with nRF52 devkit/J-Link</title><link>https://devzone.nordicsemi.com/thread/356618?ContentTypeID=1</link><pubDate>Mon, 07 Mar 2022 13:25:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b101ab63-0c39-4870-8ef5-f3e289be3ff0</guid><dc:creator>FARLY7</dc:creator><description>&lt;p&gt;Hi Hakon,&lt;/p&gt;
&lt;p&gt;Sorry for the delay in response.&lt;/p&gt;
&lt;p&gt;Yes this is using the smp_svr example. I think you should be able to easily recreate it just by flashing the smp_svr example to the nRF52 devkit and attempting to upload an image over the USB serial port.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Sean&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with MCUmgr over serial with nRF52 devkit/J-Link</title><link>https://devzone.nordicsemi.com/thread/350244?ContentTypeID=1</link><pubDate>Fri, 28 Jan 2022 14:45:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b3405b6-50f3-452b-8fd3-268623fd86a4</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you seeing this issue when using the smp_svr example? Could you share the configuration that you&amp;#39;re using so I can try to recreate the issue on my side?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>