<?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>5340 hwo to DFU external Flash</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93138/5340-hwo-to-dfu-external-flash</link><description>Hello, 
 NRF5340, NCS2.0.2, VScode 
 I designed a headset，MCU is 5340, and a external flash for DSP program. 
 the external flash connect to DSP and 5340 use SPI; 
 i can DFU 5340MCU self, 
 how to DFU external Flash for DSP program? 
 App_dfu.zip update</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 31 Oct 2022 08:22:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93138/5340-hwo-to-dfu-external-flash" /><item><title>RE: 5340 hwo to DFU external Flash</title><link>https://devzone.nordicsemi.com/thread/393154?ContentTypeID=1</link><pubDate>Mon, 31 Oct 2022 08:22:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6c1e686-426a-4159-9bc8-88d84459cffb</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;For more information about MCUboot I suggest you examine the MCUboot-documentation pages for NCS:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/wrapper.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/wrapper.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In addition I recommend you have a look at the adding dfu support to your application&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/ncs-dfu"&gt;Add DFU support to your application&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/ncs-dfu#serial_dfu_ext_flash"&gt;https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/ncs-dfu#serial_dfu_ext_flash&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The next item I would have a look at is the following ticket&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/82430/ncs-external-flash-ota-change-qspi-to-spi"&gt;ncs external flash ota change qspi to spi&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here you will find this sample for NCS v1.7.1, where with a DFU sample that uses BLE and writes the data to external flash. This ticket should also give some information about how to write and read from a specific part of the external flash&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 5340 hwo to DFU external Flash</title><link>https://devzone.nordicsemi.com/thread/393096?ContentTypeID=1</link><pubDate>Sat, 29 Oct 2022 01:22:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fa38d07-aaa4-4f43-8312-22e8a0448f65</guid><dc:creator>yoyou</dc:creator><description>&lt;p&gt;i know how to write to flash,&lt;/p&gt;
&lt;p&gt;my question is:&amp;nbsp; in DFUing,&amp;nbsp;How to distinguish the download data is app or for&amp;nbsp;&lt;span&gt;external Flash?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#0000ff;"&gt;ps:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#0000ff;"&gt;in&amp;nbsp;nRF5_SDK_17.0.2\examples\dfu\secure_bootloader\&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#0000ff;"&gt;verify receive data , then distinguish the data, then do update APP&amp;nbsp;or write to&amp;nbsp;external Flash.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#ff0000;"&gt;in NCS where is&amp;nbsp;bootloader codes and how to change it?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#ff0000;"&gt;see code as follow, NCS only&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="color:#ff0000;"&gt;#include &amp;lt;mgmt/mcumgr/smp_bt.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ff0000;"&gt;#include &amp;quot;os_mgmt/os_mgmt.h&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ff0000;"&gt;#include &amp;quot;img_mgmt/img_mgmt.h&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ff0000;"&gt;not use&amp;nbsp;bootloader?&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&lt;span style="color:#ff0000;"&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;bluetooth/bluetooth.h&amp;gt;
#if defined (NRF5340_XXAA_APPLICATION)
  #define CLOCK_FEATURE_HFCLK_DIVIDE_PRESENT
  #include &amp;quot;nrfx_clock.h&amp;quot;
#endif
#include &amp;lt;zephyr.h&amp;gt;
#include &amp;lt;sys/printk.h&amp;gt;
#include &amp;lt;devicetree.h&amp;gt;
#include &amp;lt;logging/log.h&amp;gt;
#include &amp;lt;device.h&amp;gt;
#include &amp;lt;drivers/gpio.h&amp;gt;
#include &amp;lt;hal/nrf_gpio.h&amp;gt;
#include &amp;lt;drivers/gpio.h&amp;gt;
#include &amp;lt;sys/reboot.h&amp;gt;
#include &amp;lt;settings/settings.h&amp;gt;
#include &amp;lt;mgmt/mcumgr/smp_bt.h&amp;gt;
#include &amp;quot;os_mgmt/os_mgmt.h&amp;quot;
#include &amp;quot;img_mgmt/img_mgmt.h&amp;quot;

LOG_MODULE_REGISTER(main, 4);

void ota()
{
	printk(&amp;quot;\n----------------OTA doing----------------\n\n&amp;quot;);
	os_mgmt_register_group();
	img_mgmt_register_group();
	smp_bt_register();

	int err = bt_enable(NULL);
	if (err) {
		printk(&amp;quot;Bluetooth init failed (err %d)\n&amp;quot;, err);
		return;
	}
	if (IS_ENABLED(CONFIG_SETTINGS)) {
		settings_load();
	}

	err = bt_le_adv_start(BT_LE_ADV_CONN, upad, ARRAY_SIZE(upad),upsd, ARRAY_SIZE(upsd));
	if (err) {
		printk(&amp;quot;Advertising failed to start (err %d)\n&amp;quot;, err);
		return;
	}
	printk(&amp;quot;   OTA Advertising started: %s\n&amp;quot;,bt_get_name());
	
	// if wait no OTA start, timeout 3min will reboot
	for (int i=0;i&amp;lt;180;i++) {
		k_msleep(1000);
	}
	printk(&amp;quot;\n---------------OTA timeout---------------\n\n&amp;quot;);
	sys_reboot(0);
}

void main(void)
{
	ota();
	while(true){
		printk(&amp;quot;********Hello World!********\n&amp;quot; );
		k_msleep(1000);
	}
}
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#ff0000;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#000000;"&gt;Best regards&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 5340 hwo to DFU external Flash</title><link>https://devzone.nordicsemi.com/thread/392451?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 15:19:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64152293-d417-49bd-ba18-b06b289ed918</guid><dc:creator>bdodge09</dc:creator><description>&lt;p&gt;You can read/write external flash from the 5340 to update the DSP.&amp;nbsp; Look at the sample in ncs called ./sdk-zephyr/samples/drivers/spi_flash/src/main.c&amp;nbsp;&amp;nbsp; It shows how to access qspi nor flash.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 5340 hwo to DFU external Flash</title><link>https://devzone.nordicsemi.com/thread/392271?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 03:10:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ba7db14-47f5-462a-933d-0f99b9a1fbfd</guid><dc:creator>yoyou</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;thanks for reply,&lt;/p&gt;
&lt;p&gt;i think,&lt;/p&gt;
&lt;p&gt;modify bootloader code to&amp;nbsp;judge the download hex is App or external Flash for DSP.&lt;/p&gt;
&lt;p&gt;if App, do update self;&lt;/p&gt;
&lt;p&gt;if for DSP, write to&amp;nbsp;external Flash only;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#ff0000;"&gt;but i don&amp;#39;t know how to find the code in NCS2.0.2.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 5340 hwo to DFU external Flash</title><link>https://devzone.nordicsemi.com/thread/392130?ContentTypeID=1</link><pubDate>Mon, 24 Oct 2022 11:40:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25c4c779-946f-49df-b57e-1f7415f49e72</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Unfortunately we don&amp;#39;t have any demos or guides for how to do this for a DSP. However it is possible to do the DFU for the DSP as well, but you will need to implement what you need yourself. One starting&amp;nbsp;point is to add the update bin/hex to a part of the flash that the DSP can access, and then perform the DFU from there&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>