<?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>Program external spi flash using nrfjprog</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/115701/program-external-spi-flash-using-nrfjprog</link><description>Hi, 
 
 is it possible to write data to external spi flash using nrfjprog? This would be on a custom board, which has nRF9160 with extra external SPI flash (not QSPI)? 
 
 Kind regards, 
 
 Luc</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 24 Oct 2024 10:17:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/115701/program-external-spi-flash-using-nrfjprog" /><item><title>RE: Program external spi flash using nrfjprog</title><link>https://devzone.nordicsemi.com/thread/507706?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2024 10:17:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a872aa6c-1d43-4838-948f-db741aac369c</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Always happy to&amp;nbsp;help out. Hope you have a wonderful day!&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: Program external spi flash using nrfjprog</title><link>https://devzone.nordicsemi.com/thread/507627?ContentTypeID=1</link><pubDate>Wed, 23 Oct 2024 16:02:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85e828f2-1171-4ae0-8bd7-02209d1c3f5c</guid><dc:creator>BrianW</dc:creator><description>&lt;p&gt;thanks, that work nicely! Much handier for production initialisation of the external flash areas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Program external spi flash using nrfjprog</title><link>https://devzone.nordicsemi.com/thread/507549?ContentTypeID=1</link><pubDate>Wed, 23 Oct 2024 10:31:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be3004d7-1a65-49cc-b127-87bfc072be39</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 a .hex file that has the correct offset, you can program it directly with nrfjprog and it will automatically figure out that it is in the QSPI XIP area:&lt;/p&gt;
&lt;p&gt;nrfjprog --program &amp;lt;qspi.hex&amp;gt; --verify -f nrf53&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Or if you want to read:&lt;/p&gt;
&lt;p&gt;nrfjprog --readqspi readout.hex -f nrf53&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note that the XIP area differs on nRF52840 (0x1200_0000) and nRF5340 (0x1000_0000):&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf52840/page/memory.html#ariaid-title4"&gt;https://docs.nordicsemi.com/bundle/ps_nrf52840/page/memory.html#ariaid-title4&lt;/a&gt;&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;Please note that the &amp;quot;-f nrf53&amp;quot; (or -f nrf52 if nrf52840 is targeted) is crucial when communicating over QSPI.&lt;/p&gt;
&lt;p&gt;If not, you will see errors similar to this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;$ nrfjprog --memwr 0x10000000 --val 0x12345678
Parsing parameters.
[error] [ Client] - Encountered error -2: Command qspi_init_preconfigured executed for 47 milliseconds with result -2
[error] [ Worker] - QSPI driver is not configured! Configure QSPI before attempting to initialize.
ERROR: Requested operation is currently unavailable.
ERROR: Check logs for more details.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;While with the correct family switch:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;$ nrfjprog --memwr 0x10000000 --val 0x12345678 -f nrf53
Parsing parameters.
[ #################### ]   0.000s | Reading external memory, 0x0004 bytes @ 0x00000000 - Done                          
Initializing the QSPI peripheral.
Writing.
Uninitializing the QSPI peripheral.

$ nrfjprog --memrd 0x10000000 -f nrf53
[ #################### ]   0.000s | Reading external memory, 0x0004 bytes @ 0x00000000 - Done                          
0x10000000: 12345678                              |xV4.|

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I see that I&amp;#39;ve misinformed you:&lt;/p&gt;
[quote user="hkn"]nRF52840/nRF52833/nRF5340[/quote]
&lt;p&gt;My apologies, nRF52833 does not have QSPI, so I will edit this and remove that reference.&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: Program external spi flash using nrfjprog</title><link>https://devzone.nordicsemi.com/thread/507538?ContentTypeID=1</link><pubDate>Wed, 23 Oct 2024 09:41:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e317892-bd76-427b-96ca-737939912187</guid><dc:creator>BrianW</dc:creator><description>[quote userid="2115" url="~/f/nordic-q-a/115701/program-external-spi-flash-using-nrfjprog/507485"]it only supports QSPI based flash devices on nRF52840/nRF52833/nRF5340.[/quote]
&lt;p&gt;Can you point me to the documentation/examples on how to do this on an nrf5340 board with a QSPI external flash (same schematic as the nrf5340DK boards), as this would be very useful for my production process!&lt;/p&gt;
&lt;p&gt;The only doc I find is this one&lt;/p&gt;
&lt;p&gt;&lt;a id="" href="https://docs.nordicsemi.com/bundle/ug_nrf_cltools/page/UG/cltools/nrf_nrfjprogexe_reference.html"&gt;https://docs.nordicsemi.com/bundle/ug_nrf_cltools/page/UG/cltools/nrf_nrfjprogexe_reference.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;but it a) notes the qspi options are depreciated without giving details on the &amp;#39;toml&amp;#39; replacements and b) says it only works on nrf52?&lt;/p&gt;
&lt;p&gt;thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Program external spi flash using nrfjprog</title><link>https://devzone.nordicsemi.com/thread/507485?ContentTypeID=1</link><pubDate>Wed, 23 Oct 2024 06:30:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:acee2f5a-92f3-4a77-82c7-c871b9c7140a</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;Unfortunately, nrfjprog does not have SPI flash capabilities, it only supports QSPI based flash devices on nRF52840/&lt;span style="text-decoration:line-through;"&gt;nRF52833&lt;/span&gt;/nRF5340.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;*edit* listed incorrect device.&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>