<?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>UART DFU of a nRF9160 in recovery mode via nRF5340.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/115893/uart-dfu-of-a-nrf9160-in-recovery-mode-via-nrf5340</link><description>Hello everyone, 
 I guess my question is more conceptual rather than a specific issue with the code. 
 I am working on a device featuring an nRF5340 chip and an nRF9160 chip which are linked by a UART interfface and 4 gpios. When it comes to DFU, i am</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 22 Dec 2024 15:16:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/115893/uart-dfu-of-a-nrf9160-in-recovery-mode-via-nrf5340" /><item><title>RE: UART DFU of a nRF9160 in recovery mode via nRF5340.</title><link>https://devzone.nordicsemi.com/thread/516044?ContentTypeID=1</link><pubDate>Sun, 22 Dec 2024 15:16:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86494b50-c2a5-408b-a2e2-2fc763118dcf</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Colin,&lt;/p&gt;
[quote user="ColinC"]&lt;p&gt;I tweaked the code I sent you and managed to get some image transfer over UART going with the Interrupt driven transport layer.&lt;/p&gt;
&lt;p&gt;The tweak consists in removing the CONFIG_UART_2_NRF_ASYNC, CONFIG_UART_2_NRF_ASYNC_TIMER and CONFIG_NRFX_TIMER2 statements and&amp;nbsp;&lt;/p&gt;[/quote]
&lt;p&gt;To use interrupt driven mode, you should&amp;nbsp;only need to disable &lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.9.0/page/kconfig/index.html#CONFIG_UART_ASYNC_API"&gt;CONFIG_UART_ASYNC_API&lt;/a&gt; and enable&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.9.0/page/kconfig/index.html#CONFIG_UART_INTERRUPT_DRIVEN"&gt;CONFIG_UART_INTERRUPT_DRIVEN&lt;/a&gt;. Were there some issues doing just this?&lt;/p&gt;
[quote user="ColinC"]Unfortunately, the SMP server which should consume the image always sends answers with the &amp;quot;off&amp;quot; field set to -1. I believe it indicates that no byte of the image was written to flash, is that correct?&amp;nbsp;[/quote]
&lt;p&gt;I am not sure what kind of response you are talking about here. What is your response frame?&lt;/p&gt;
&lt;p&gt;The response is defined here:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.9.0/page/zephyr/services/device_mgmt/smp_protocol.html#minimal_response"&gt;https://docs.nordicsemi.com/bundle/ncs-2.9.0/page/zephyr/services/device_mgmt/smp_protocol.html#minimal_response&lt;/a&gt;&lt;/p&gt;
[quote user="ColinC"]Switching to the ASYNC transport layer, the transport layer of the SMP client times out although an answer is coming from the SMP server. I recorded the UART traffic with Saleae&amp;#39;s logic analyser: here are the traces:&amp;nbsp;[/quote]
&lt;p&gt;This goes back to the setup of the UART API types. To use async, you should only need to enable CONFIG_UART_ASYNC_API and disable CONFIG_UART_INTERRUPT_DRIVEN. Could you please try this and see if the communication works properly?&lt;/p&gt;
&lt;p&gt;Also,&amp;nbsp;am I right to understand that we are only talking about the nRF5340/SMP Client UART configurations, and the nRF9160&amp;#39;s UART configuration is left as default?&lt;/p&gt;
&lt;p&gt;And can I take it you&amp;nbsp;are not using LPUART? It&amp;#39;s the default interface between the nRF52840 and nRF9160 in the nRF9160 DK Cellular + BLE setup.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please be informed that I will be out of office&amp;nbsp;&lt;/span&gt;&lt;span&gt;for a few weeks. If you have any follow-up questions, please just reply and one of our engineers will continue to support you.&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;Hieu&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART DFU of a nRF9160 in recovery mode via nRF5340.</title><link>https://devzone.nordicsemi.com/thread/515671?ContentTypeID=1</link><pubDate>Thu, 19 Dec 2024 09:39:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb83dc78-201f-4864-857a-8aedf458e57e</guid><dc:creator>ColinC</dc:creator><description>&lt;p&gt;Hi Hieu,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Tanks for the support! Yeah I made progress, I tweaked the code I sent you and managed to get some image transfer over UART going with the Interrupt driven transport layer.&lt;/p&gt;
&lt;p&gt;The tweak consists in removing the CONFIG_UART_2_NRF_ASYNC, CONFIG_UART_2_NRF_ASYNC_TIMER and CONFIG_NRFX_TIMER2 statements and&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Unfortunately, the SMP server which should consume the image always sends answers with the &amp;quot;off&amp;quot; field set to -1. I believe it indicates that no byte of the image was written to flash, is that correct?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Switching to the ASYNC transport layer, the transport layer of the SMP client times out although an answer is coming from the SMP server. I recorded the UART traffic with Saleae&amp;#39;s logic analyser: here are the traces:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Interrupt_5F00_driven_5F00_no_5F00_data_5F00_consumed.sal"&gt;devzone.nordicsemi.com/.../Interrupt_5F00_driven_5F00_no_5F00_data_5F00_consumed.sal&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Async_5F00_timeouts.sal"&gt;devzone.nordicsemi.com/.../Async_5F00_timeouts.sal&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The files can be opened with Saleae&amp;#39;s &amp;quot;Logic&amp;quot; tool. Maybe you can look into it and understand better than me, why timeouts happen, when I use the async SMP transport layer and why no bytes are consumed with the interrupt driven SMP transport layer.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for the support!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Colin&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART DFU of a nRF9160 in recovery mode via nRF5340.</title><link>https://devzone.nordicsemi.com/thread/515557?ContentTypeID=1</link><pubDate>Wed, 18 Dec 2024 16:06:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a00ef8bc-b853-43ac-94f4-4ae828c7601d</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Colin,&lt;/p&gt;
&lt;p&gt;As you might have been notified by email, since a few days ago, I have been assigned to continue&amp;nbsp;supporting you with this issue while Charlie is unavailable.&lt;/p&gt;
&lt;p&gt;To give you an update, I am&amp;nbsp;a little familiar with DFU solutions, but entirely new to using SMP Client, and am still trying to figure things out myself.&lt;/p&gt;
&lt;p&gt;I will continue looking into it and get you a reply&amp;nbsp;probably this Friday or Saturday.&lt;/p&gt;
&lt;p&gt;By the way, have you made any progress since?&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART DFU of a nRF9160 in recovery mode via nRF5340.</title><link>https://devzone.nordicsemi.com/thread/513445?ContentTypeID=1</link><pubDate>Wed, 04 Dec 2024 13:48:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db7d0c3b-12b0-49cf-a874-29bc428bed00</guid><dc:creator>ColinC</dc:creator><description>&lt;p&gt;Hi Charlie,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Tanks for looking in the code, I would indeed be glad if someone could take over while you are away&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I also started studying the lwm2m sample, got the FW running on the nRF9160 and the nrf52840. But I had to go back to SDK version 2.5.0 since the sample description didn&amp;#39;t match the folder structure in v2.7.0 due to the build tool being sysbuild and the lack of child_image folder.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The sample FW seems to work but executing the fota.py script runs into a 403 error when trying to register the new resource for the app_update52.bin image. Is it possible that the behaviour of the coiote server has changed and does no longer match the fota.py script or is the problem on my side?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regarding the lwm2m_client sample: I am interested in the case &amp;quot;LwM2M Firmware Update for external MCU&amp;quot; could you tell me how the SMP transfer is triggerd and how the data flow is? I tried to find the API calls to mcu_mgr but to no avail.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot for the support!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Cheers&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Colin&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART DFU of a nRF9160 in recovery mode via nRF5340.</title><link>https://devzone.nordicsemi.com/thread/513300?ContentTypeID=1</link><pubDate>Tue, 03 Dec 2024 19:41:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db1b6663-31b3-407b-aa98-1d85ad115e83</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Colin,&lt;/p&gt;
&lt;p&gt;I spent some time reviewing your codes today but, unfortunately, wasn’t able to make any progress.&lt;/p&gt;
&lt;p&gt;I’ll be on leave until next Tuesday, but I’ll continue looking into it once I’m back. In the meantime, if there’s capacity within our team, someone else may be able to take a look.&lt;/p&gt;
&lt;p&gt;Thank you for your patience, and feel free to reach out if there are any updates or additional information to share.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART DFU of a nRF9160 in recovery mode via nRF5340.</title><link>https://devzone.nordicsemi.com/thread/512970?ContentTypeID=1</link><pubDate>Mon, 02 Dec 2024 12:15:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bdf2655-8506-4506-90ed-a9f649eb8d08</guid><dc:creator>ColinC</dc:creator><description>&lt;p&gt;Hi Charlie,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the reply, I&amp;#39;ll give it a go.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In the meantime I have worked on some code I can share with you. It shows exactly how I intend to Pass the new nRF9160 image around, furtther details are explained in the README file. Please look if you manage to get it going on your DKs (I am available for further information). Maybe you can also give me feedback on the concept I present in the readme regarding the upating of the nRF9160.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8371.Firmware.zip"&gt;devzone.nordicsemi.com/.../8371.Firmware.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Kind Regards&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Colin&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART DFU of a nRF9160 in recovery mode via nRF5340.</title><link>https://devzone.nordicsemi.com/thread/512957?ContentTypeID=1</link><pubDate>Mon, 02 Dec 2024 11:56:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b6f8e9a-fd61-4d2f-adb4-599de014c1b9</guid><dc:creator>Charlie</dc:creator><description>&lt;div&gt;Hi Colin,&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;It seems that your nRF5340 SMP client configuration does not fully reference the &lt;code&gt;nrf\samples\cellular\lwm2m_client\overlay-mcumgr_client.conf&lt;/code&gt; file. To ensure the setup is correct, I recommend trying to use the original &lt;code&gt;nrf\samples\cellular\lwm2m_client&lt;/code&gt; as an SMP client on the nRF9160 to perform&amp;nbsp;DFU for&amp;nbsp;another nRF9160 configured as an SMP server.&lt;/p&gt;
&lt;p&gt;This should serve as a solid preliminary study before attempting to implement and run an SMP client on the nRF5340.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;
&lt;/div&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: UART DFU of a nRF9160 in recovery mode via nRF5340.</title><link>https://devzone.nordicsemi.com/thread/512843?ContentTypeID=1</link><pubDate>Sat, 30 Nov 2024 14:12:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:495bcad9-29ad-4fc1-84fa-c7936d419516</guid><dc:creator>ColinC</dc:creator><description>&lt;p&gt;Hi Charlie,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Tanks for the reply, I am working on a small example with a nRF5340 DK and a nRF9160 DK, based on the serial recovery DFU sample for the 9160 and the BLE FOTA sample for the 5340 (in the Academy Lesson 8 exercises 1 and 3) I will share them as soon as I have something.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In the FW I managed to get rid of the&amp;nbsp;&lt;span&gt;Attribution unit violation. The issue was that no transport layer was assigned and thus the smp_client_object_init() could not be called properly.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now I am able to call&amp;nbsp;img_mgmt_client_upload(). This indeed results in traffic on the TX uart line as the first few transport frames get sent out. The nRF9160 responds with a 35 byte SMP packet after 90 ms. Which looks as follows:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/image_5F00_2024_2D00_11_2D00_30_5F00_145410171.png_2D00_640x480.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;First 64 bytes of the image sent as SMP frames (nRF5340 -&amp;gt; nRF9160):&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;06 09 41 47 67 43 41 41 42 65 41 41 45 41 41 62 
39 6C 61 57 31 68 5A 32 55 41 5A 47 52 68 64 47 
46 59 51 44 32 34 38 35 59 41 41 41 41 41 41 41 
49 41 41 44 6A 56 41 67 41 41 41 41 41 41 41 51 
41 41 41 41 41 41 41 41 41 41 41 41 41 41 2F 2F 
2F 2F 2F 2F 2F 2F 2F 2F 2F 2F 2F 2F 2F 2F 2F 2F 
2F 2F 2F 2F 2F 2F 2F 2F 2F 2F 2F 2F 2F 2F 2F 2F 
2F 2F 2F 2F 2F 2F 2F 2F 39 6A 62 32 5A 6D 0A 04 
14 41 47 4E 73 5A 57 34 61 41 41 4C 58 7A 2F 39 
4C 58 67 3D 3D 0A &lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Response fom (nRF9160-&amp;gt; nRF5340):&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;06 09 41 42 59 44 41 41 41 4D 41 41 45 41 41 62 
39 69 63 6D 4D 41 59 32 39 6D 5A 68 6A 51 2F 37 
47 53 0A &lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Unfortunately I am unable to parse it to verify for error codes. This could confirm whether or not the nRF9160 accepts the incoming traffic.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;p&gt;&lt;span&gt;The issue is that the nRF5340 does not react to the incoming response. No uart handlers get triggered despite&amp;nbsp;&lt;/span&gt;&lt;span&gt;uart_rx_enable()&amp;nbsp;&lt;/span&gt;having been called, a handler registered with&amp;nbsp;uart_callback_set() and the Following interrupts being enabled&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1732975782924v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;For the MCUMGR configuration I use the following kconfig settings :&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;#Enable DFU SMP Target for nRF9160 DFU  
CONFIG_DFU_TARGET=y
CONFIG_MCUMGR_GRP_OS_CLIENT=y
CONFIG_DFU_TARGET_SMP=y
CONFIG_CONSOLE=y
CONFIG_UART_MCUMGR=y
CONFIG_MCUMGR_TRANSPORT_UART=y
CONFIG_MCUMGR_TRANSPORT_UART_ASYNC=y
CONFIG_SHELL=y
CONFIG_BASE64=y

# Enable SMP Server
CONFIG_MCUMGR=y
CONFIG_MCUMGR_GRP_IMG=y
# CONFIG_MCUMGR dependencies
CONFIG_NET_BUF=y
CONFIG_ZCBOR=y
# CONFIG_MCUMGR_GRP_IMG dependencies
CONFIG_SMP_CLIENT=y
CONFIG_IMG_MANAGER=y
CONFIG_MCUMGR_GRP_IMG_CLIENT=y
# CONFIG_IMG_MANAGER dependencies
CONFIG_STREAM_FLASH=y
CONFIG_MCUMGR_MGMT_NOTIFICATION_HOOKS=y
CONFIG_MCUMGR_SMP_COMMAND_STATUS_HOOKS=y
CONFIG_MCUMGR_GRP_IMG_UPLOAD_CHECK_HOOK=y
CONFIG_MCUMGR_GRP_IMG_STATUS_HOOKS=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Do you see anything wrong about my uart config or why the response gets ignored by the nRF5340?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot for your support&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Colin Cina&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART DFU of a nRF9160 in recovery mode via nRF5340.</title><link>https://devzone.nordicsemi.com/thread/512578?ContentTypeID=1</link><pubDate>Thu, 28 Nov 2024 12:56:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea740b05-2062-4190-8776-219d1b9ae039</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Colin,&lt;/p&gt;
&lt;p&gt;In addition to the usage demonstrated in &lt;code&gt;v2.8.0\nrf\tests\subsys\net\lib\mcumgr_smp_client&lt;/code&gt;, I found the following sample and guidance that showcase the &lt;code&gt;mcumgr&lt;/code&gt; client with the &lt;code&gt;img_mgmt_client&lt;/code&gt; API:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.8.0/page/nrf/samples/cellular/lwm2m_client/sample_description.html#mcumgr_client_for_external_fota"&gt;https://docs.nordicsemi.com/bundle/ncs-2.8.0/page/nrf/samples/cellular/lwm2m_client/sample_description.html#mcumgr_client_for_external_fota&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-8-bootloaders-and-dfu-fota/topic/exercise-1-dfu-over-uart/"&gt;Exercise 1 - DFU over UART - Nordic Developer Academy&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I recommend closely comparing the usage of the &lt;code&gt;img_mgmt_client&lt;/code&gt; API in these samples to ensure your implementation aligns with the demonstrated best practices.&lt;/p&gt;
&lt;p&gt;If the issue persists, I encourage you to share a minimal version of your &lt;code&gt;mcumgr&lt;/code&gt; client implementation, excluding any confidential code. This will help us analyze and troubleshoot the problem more effectively.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Charlie&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART DFU of a nRF9160 in recovery mode via nRF5340.</title><link>https://devzone.nordicsemi.com/thread/512202?ContentTypeID=1</link><pubDate>Tue, 26 Nov 2024 16:48:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95c97951-766e-46dd-91e1-7323cf76a287</guid><dc:creator>ColinC</dc:creator><description>&lt;p&gt;Hi, I am back with some more insights and questions on the usage of the img_mgmt_client. The API usage seems to&amp;nbsp; be restricted to the test code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The project I am working on is confidential so I can&amp;#39;t share the whole code.&amp;nbsp; Here is a short snippet that shows how I use the img_mgmt_client API :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;struct mcumgr_image_upload res_buf; 
struct img_mgmt_client img_mgr_cli;
struct smp_client_object smp_client;
struct mcumgr_image_data img_data[1];

#define READ_SIZE 124 

//Initialize the smp_client and the img_mgmt_client
smp_client_object_init(&amp;amp;smp_client, SMP_SERIAL_TRANSPORT);
img_mgmt_client_init(&amp;amp;img_mgr_cli, &amp;amp;smp_client, 1, img_data);

//Initialise the image upload
err = img_mgmt_client_upload_init(&amp;amp;img_mgr_cli, image_size, 0, NULL);
if(err != 0){
    LOG_ERR(&amp;quot;Failed to initialise the image upload&amp;quot;);
}

//Upload one chunk to the nRF9160
err = img_mgmt_client_upload(&amp;amp;img_mgr_cli, image_data, READ_SIZE, &amp;amp;res_buf);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The execution of&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;img_mgmt_client_upload() fails due to an&amp;nbsp;Attribution unit violation, the call stack is as follows:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;&lt;/span&gt;&lt;span data-contrast="auto"&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;sys_dlist_remove(sys_dnode_t&amp;#160;* node) (ncs\v2.7.0\zephyr\include\zephyr\sys\dlist.h:506)&amp;#160;

sys_dlist_get(sys_dlist_t&amp;#160;* list) (ncs\v2.7.0\zephyr\include\zephyr\sys\dlist.h:530)&amp;#160;

handle_poll_events(uint32_t state, struct&amp;#160;k_queue&amp;#160;* queue) (ncs\v2.7.0\zephyr\kernel\queue.c:90)&amp;#160;

queue_insert(struct&amp;#160;k_queue&amp;#160;* queue, void *&amp;#160;prev, void * data, _Bool&amp;#160;alloc, _Bool&amp;#160;is_append) (ncs\v2.7.0\zephyr\kernel\queue.c:170)&amp;#160;

net_buf_put(struct&amp;#160;k_fifo&amp;#160;*&amp;#160;fifo, struct&amp;#160;net_buf&amp;#160;*&amp;#160;buf) (ncs\v2.7.0\zephyr\subsys\net\buf.c:450)&amp;#160;

smp_client_send_cmd(struct&amp;#160;smp_client_object&amp;#160;*&amp;#160;smp_client, struct&amp;#160;net_buf&amp;#160;*&amp;#160;nb,&amp;#160;smp_client_res_fn&amp;#160;cb, void *&amp;#160;user_data, int&amp;#160;timeout_in_sec) (ncs\v2.7.0\zephyr\subsys\mgmt\mcumgr\smp_client\src\client.c:322)&amp;#160;

img_mgmt_client_upload(struct&amp;#160;img_mgmt_client&amp;#160;* client, const uint8_t * data,&amp;#160;size_t&amp;#160;length, struct&amp;#160;mcumgr_image_upload&amp;#160;*&amp;#160;res_buf) (ncs\v2.7.0\zephyr\subsys\mgmt\mcumgr\grp\img_mgmt_client\src\img_mgmt_client.c:420)&amp;#160;

perform_nrf9160_dfu(struct&amp;#160;k_work&amp;#160;* work) (Application Level Function, Top of callstack)&lt;/pre&gt;&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;It seems that the FIFO element in the SMP_client struct makes an illegal access. But I don&amp;#39;t understand why, as I have initialized the SMP_client.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Right now I am still unsure if using the img_mgmt_client API directly from Application level code the correct way is or what I am missing.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Based on this update, do you have more inputs that could help me advance with the DFU implementation?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for the support&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheers,&amp;nbsp;Colin&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART DFU of a nRF9160 in recovery mode via nRF5340.</title><link>https://devzone.nordicsemi.com/thread/508483?ContentTypeID=1</link><pubDate>Wed, 30 Oct 2024 10:00:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:266c1fcb-016d-4859-ad5c-bdf68376b9fa</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Of course, thank you for sharing your findings in advance, other developers will definitely benefit from your contribution.&lt;/p&gt;
&lt;p&gt;I will keep this ticket open.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART DFU of a nRF9160 in recovery mode via nRF5340.</title><link>https://devzone.nordicsemi.com/thread/508480?ContentTypeID=1</link><pubDate>Wed, 30 Oct 2024 09:45:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78bdb7e8-cccd-4d55-8d23-61cba8922ee3</guid><dc:creator>ColinC</dc:creator><description>&lt;p&gt;Hi Charlie,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Alright, I will give it a try. Could we leave this question open so that I can give an update if this is actually the way to go about it? It might be of interest of other users.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Colin&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART DFU of a nRF9160 in recovery mode via nRF5340.</title><link>https://devzone.nordicsemi.com/thread/508478?ContentTypeID=1</link><pubDate>Wed, 30 Oct 2024 09:42:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03bb34b9-418a-4d8d-93cc-7ce061765289</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Colin,&lt;/p&gt;
&lt;p&gt;I never tried myself with this&amp;nbsp;&lt;span&gt;img_mgmt_client API.&amp;nbsp;I would sugget you just give a try to verfiy your concern. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You can learn about the API usage by searching the function name in NCS code base direclty. I found some testing codes that shows the usage of&amp;nbsp; img_mgmt_client_upload.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Since smp is a subsystem maintained in Zephyr, you can try to reach developers at&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/issues"&gt;https://github.com/zephyrproject-rtos/zephyr/issues&lt;/a&gt;&amp;nbsp;if there you encounter any issue during your exploration.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/client_smp/smp_client_ble#instructions-for-updating-the-nrf52840-from-another-nrf52840"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART DFU of a nRF9160 in recovery mode via nRF5340.</title><link>https://devzone.nordicsemi.com/thread/508375?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2024 14:09:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d965c23-c0ab-44c7-9a9c-cb043b31411b</guid><dc:creator>ColinC</dc:creator><description>&lt;p&gt;Hi Charlie,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for the answer, interesting stuff! I&amp;#39;ll study the Advanced Firmware Update for external MCU article.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How I understand it, I have to use the img_mgmt_client API from my Application on the nRF5340.&lt;/p&gt;
&lt;p&gt;First calling img_mgmt_client_init and passing an smp_client_object struct which selects the uart transport layer.&lt;/p&gt;
&lt;p&gt;Assuming my statement above is correct:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If I have the image of the nRF9160 stored in flash, can I simply read the image chunkwise from flash passing it to call img_mgmt_client_upload()? Does the size of the data chunks matter or does the img_mgmt_client and the underlying transport layer handle it?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If my assumption is wrong, could you point me to the right API to use from the nRF5340 application to send chunks of the nRF9160 image to the nRF9160 via SMP using the uart transport layer?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Many thanks for the support&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheers&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Colin&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART DFU of a nRF9160 in recovery mode via nRF5340.</title><link>https://devzone.nordicsemi.com/thread/508351?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2024 12:45:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:401965fe-05e4-4a4e-87a9-f38c8d719032</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Colin,&lt;/p&gt;
&lt;p&gt;Thanks for checking with us about this concept.&lt;/p&gt;
&lt;p&gt;This concept is totocally possible and you basiclly have everything you need on the current NCS/Zephyr, Even the opposite or bidirection is possible, nRF9160 downloads firmware through LTE and do firmware update for another MCU like&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/cellular/lwm2m_client/fota_external_mcu.html"&gt;Evaluating LwM2M Advanced Firmware Update for external MCU&lt;/a&gt;&amp;nbsp;did. You need to add smp client/server to your MCUs accordingly.&lt;/p&gt;
&lt;p&gt;I know some companies implemented this solution based on this concept. See the references mentioned in this discussion provided by my colleague&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/114572/assistance-needed-for-ble-dfu-of-device-b-using-device-a-as-central/501687"&gt;(3) Assistance Needed for BLE DFU of Device B Using Device A as Central - Nordic Q&amp;amp;A - Nordic DevZone - Nordic DevZone&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>