<?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>nrf5340 QSPI flash programming via SWD</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114515/nrf5340-qspi-flash-programming-via-swd</link><description>Hello, 
 We would like to program the external flash connected to the nRF5340 via SWD during manufacturing. 
 Is this possible? Do you have any documentation that explains how to do it? 
 Thank you,</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 05 Sep 2024 12:51:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114515/nrf5340-qspi-flash-programming-via-swd" /><item><title>RE: nrf5340 QSPI flash programming via SWD</title><link>https://devzone.nordicsemi.com/thread/501370?ContentTypeID=1</link><pubDate>Thu, 05 Sep 2024 12:51:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01079858-6df1-4f50-942c-bb75558828fd</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 your external flash is connected via QSPI with the dedicated pins as&amp;nbsp;shown&amp;nbsp;here under &amp;quot;Recommend usage&amp;quot;:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf5340/page/chapters/pin.html"&gt;https://docs.nordicsemi.com/bundle/ps_nrf5340/page/chapters/pin.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then you shall be able to use nrfjprog to program the QSPI:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfjprog --program &amp;lt;qspi_content.hex&amp;gt; --verify -f nrf53&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This assumes that the input .hex file is offset&amp;#39;ed to the XIP area:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf5340/page/chapters/memory/appmem.html"&gt;https://docs.nordicsemi.com/bundle/ps_nrf5340/page/chapters/memory/appmem.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can then use nrfjprog --readqspi readback.hex -f nrf53 to verify the written content.&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>