<?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>Update firmware via SPI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86130/update-firmware-via-spi</link><description>According to the way our production and the way we update the firmware. 
 I will need a bootloader for nrf5340, so I can update the firmware via SPI. 
 What will be the best example code to use for this kind of project? 
 
 We can use JLINK the first</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Mar 2022 08:33:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86130/update-firmware-via-spi" /><item><title>RE: Update firmware via SPI</title><link>https://devzone.nordicsemi.com/thread/360465?ContentTypeID=1</link><pubDate>Tue, 29 Mar 2022 08:33:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:caec642c-cf9e-4395-b6e0-b6ca11503095</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
[quote user="Sigurd Hellesvik"]For Serial Recovery, I am testing if it will work for the nRF5340 now, and will update you on what I find tomorrow.[/quote]
&lt;p&gt;Since you got what you needed, I thought that I needed not hurry with this.&lt;/p&gt;
&lt;p&gt;But I figured it out today.&lt;/p&gt;
&lt;p&gt;Our &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrf/applications/machine_learning/README.html"&gt;Machine Learning Sample&lt;/a&gt; implements Serial Recovery for nRF5340, so you can use this with mcumgr to perform DFU over serial.&lt;br /&gt;Use the following commands to update both cores after resetting the device into Serial Recovery Mode(reset when holding button1):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;mcumgr --conntype=serial --connstring=&amp;quot;dev=/dev/ttyACM2,baud=115200,mtu=512&amp;quot;image upload -n 3 build/zephyr/net_core_app_update.bin
#wait min. 2 minutes to allow Network Core to copy image
mcumgr --conntype=serial --connstring=&amp;quot;dev=/dev/ttyACM2,baud=115200,mtu=512&amp;quot; image uploadbuild/zephyr/app_update.bin
mcumgr --conntype=serial --connstring=&amp;quot;dev=/dev/ttyACM2,baud=115200,mtu=512&amp;quot;image list
mcumgr --conntype=serial --connstring=&amp;quot;dev=/dev/ttyACM2,baud=115200,mtu=512&amp;quot; reset&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So in case you need it later, and for reference for others, I will leave this explanation here.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update firmware via SPI</title><link>https://devzone.nordicsemi.com/thread/359822?ContentTypeID=1</link><pubDate>Thu, 24 Mar 2022 13:35:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ef576b7-1370-4dda-96a9-b0a35412eb78</guid><dc:creator>Frede Nielsen</dc:creator><description>&lt;p&gt;Hi Sigurd&lt;/p&gt;
&lt;p&gt;Thanks for your fast answer.&lt;/p&gt;
&lt;p&gt;You have answered my question.&lt;/p&gt;
&lt;p&gt;Our products have one main processor, all update of the product goes through this processor. The processors internally in the product use either SPI or I2C to communicate to the main processor. Have not decided yet what we will do about nrf5340, but thanks for your effort.&lt;/p&gt;
&lt;p&gt;Br, Frede.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update firmware via SPI</title><link>https://devzone.nordicsemi.com/thread/359636?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 14:28:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59bccd54-2988-4157-aa99-55d06995f8ea</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi Nielsen&lt;/p&gt;
&lt;p&gt;The nRF Connect SDK use &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/mcuboot/wrapper.html"&gt;MCUBoot&lt;/a&gt; as a bootloader. &lt;br /&gt;&lt;span style="font-size:75%;"&gt;(Possibly together with the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrf/samples/bootloader/README.html"&gt;nRF Secure Immutable Bootloader&lt;/a&gt;(NSIB, previously called b0). But if you do not have specific need for NSIB, it is easier to just use MCUBoot.)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;MCUBoot use either Serial recovery or SMP to receive updates. &lt;br /&gt;For SMP, see the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/README.html"&gt;zephyr SMP SERVER sample&lt;/a&gt;. &lt;br /&gt;For Serial Recovery, I am testing if it will work for the nRF5340 now, and will update you on what I find tomorrow.&lt;/p&gt;
&lt;p&gt;Either way, the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/zephyr/guides/device_mgmt/mcumgr.html"&gt;mcumgr&lt;/a&gt; is used for sending the new firmware to the nRF device. This supports the following transports:&lt;/p&gt;
&lt;p&gt;BLE (Bluetooth Low Energy)&lt;br /&gt;Serial (UART)&lt;br /&gt;UDP over IP&lt;/p&gt;
&lt;p&gt;In other words, unfortunately not SPI.&lt;/p&gt;
&lt;p&gt;I would recommend you to consider using UART or Bluetooth Low Energy instead of SPI.&lt;br /&gt;However, if you want to implement transport over SPI yourself, this could maybe be possible. &lt;br /&gt;But I do not know how much work it would be, as I have not done anything similar myself.&lt;/p&gt;
&lt;p&gt;In this case, maybe the following links could be helpful:&lt;br /&gt;&lt;a href="https://docs.zephyrproject.org/latest/guides/device_mgmt/smp_protocol.html"&gt;SMP Protocol Specification&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.zephyrproject.org/latest/guides/device_mgmt/smp_groups/smp_group_8.html"&gt;File management&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/zephyrproject-rtos/mcumgr"&gt;https://github.com/zephyrproject-rtos/mcumgr&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Did this answer your questions?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>