<?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>VSCode Plugin Erase and Flash without erasing external flash. west flash --erase without erasing QSPI flash</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/124471/vscode-plugin-erase-and-flash-without-erasing-external-flash-west-flash---erase-without-erasing-qspi-flash</link><description>Since a while back ( github.com/.../999b6a14a4556f16d2f535207a84ceb2cca54f8a) the west flash command with --erase was changed so that --erase would also erase external flash. It adds options to override that also by adding new arguments --erase-mode and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 26 Feb 2026 23:42:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/124471/vscode-plugin-erase-and-flash-without-erasing-external-flash-west-flash---erase-without-erasing-qspi-flash" /><item><title>RE: VSCode Plugin Erase and Flash without erasing external flash. west flash --erase without erasing QSPI flash</title><link>https://devzone.nordicsemi.com/thread/562183?ContentTypeID=1</link><pubDate>Thu, 26 Feb 2026 23:42:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4432d41-8d09-4fe3-a553-fe381bede45a</guid><dc:creator>Monkeytronics</dc:creator><description>&lt;p&gt;Not sure if useful to you, but due to the extreme flakiness of flashing and debugging in the nrf connect VS Code extension, I wrote a few lines to allow use of custom build &amp;amp; flash etc scripts:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;...

&amp;quot;nrf-connect.taskBindings&amp;quot;: {
         &amp;quot;eraseAndFlash&amp;quot;: [
            {
               &amp;quot;taskName&amp;quot;: &amp;quot;Monkey Script&amp;quot;
            }
         ]
      }
   },
   &amp;quot;tasks&amp;quot;: {
      &amp;quot;version&amp;quot;: &amp;quot;2.0.0&amp;quot;,
      &amp;quot;tasks&amp;quot;: [
         {
            &amp;quot;type&amp;quot;: &amp;quot;nrf-connect-shell&amp;quot;,
            &amp;quot;label&amp;quot;: &amp;quot;Monkey Script&amp;quot;,
            &amp;quot;command&amp;quot;: &amp;quot;base=$(cygpath &amp;#39;${workspaceFolder}&amp;#39;) &amp;amp;&amp;amp; bash \&amp;quot;${base}/z-prod-utils/scripts/monkey_flash.bash\&amp;quot;&amp;quot;,
            &amp;quot;cwd&amp;quot;: &amp;quot;${activeConfig}&amp;quot;,
            &amp;quot;problemMatcher&amp;quot;: []
         }
      ]
   },&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and then in the script (just a bash script) - you can do whatever the hell you like.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;## Get 
build_folder=$(dirname $(pwd))
domain_name=$(basename $(pwd))
build_folder_name=$(basename ${build_folder})


echo &amp;quot;=========================================&amp;quot;
echo &amp;quot;Monkey Flash Script&amp;quot;
echo &amp;quot;=========================================&amp;quot;
echo &amp;quot;&amp;quot;
echo &amp;quot;App build Location  : $(pwd)&amp;quot;
echo &amp;quot;App domain_name     : ${domain_name}&amp;quot;
echo &amp;quot;build_folder        : ${build_folder_name}&amp;quot;
echo &amp;quot;&amp;quot;


echo &amp;quot;=========================================&amp;quot;
echo &amp;quot;Flashing to nRF9151DK&amp;quot;
echo &amp;quot;=========================================&amp;quot;
echo &amp;quot;std command = west flash -d ${build_folder} --domain ${domain_name} --dev-id 1051278334&amp;quot;
echo &amp;quot;=========================================&amp;quot;
echo &amp;quot;&amp;quot;
echo &amp;quot;our command = west flash -d ${build_folder} --domain ${domain_name} --recover&amp;quot;
echo &amp;quot;=========================================&amp;quot;
echo &amp;quot;&amp;quot;
west flash -d ${build_folder} --domain ${domain_name} --recover
echo &amp;quot;&amp;quot;&lt;/pre&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><item><title>RE: VSCode Plugin Erase and Flash without erasing external flash. west flash --erase without erasing QSPI flash</title><link>https://devzone.nordicsemi.com/thread/553384?ContentTypeID=1</link><pubDate>Wed, 05 Nov 2025 09:09:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4f507a4-7818-4b4b-b11d-40be90ca7e5c</guid><dc:creator>jakkra</dc:creator><description>&lt;p&gt;Ok got it. Feel free to close the ticket.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: VSCode Plugin Erase and Flash without erasing external flash. west flash --erase without erasing QSPI flash</title><link>https://devzone.nordicsemi.com/thread/553383?ContentTypeID=1</link><pubDate>Wed, 05 Nov 2025 09:07:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c18c9506-677d-420a-aaaa-c8d9e8abc6a6</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Jakob&lt;/p&gt;
&lt;p&gt;Just wanted to give you an updated on this. There is no immediate release coming to the VS Code plugin for this feature I&amp;#39;m afraid, so for now you will be restricted to using the command line west flash tool.&lt;/p&gt;
&lt;p&gt;Please contact the Nordic sales rep. of your region to get information on when it can be expected in the VS Code plugin.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: VSCode Plugin Erase and Flash without erasing external flash. west flash --erase without erasing QSPI flash</title><link>https://devzone.nordicsemi.com/thread/552614?ContentTypeID=1</link><pubDate>Tue, 28 Oct 2025 10:34:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06883c7f-b3d5-4072-9766-28e51338aac0</guid><dc:creator>jakkra</dc:creator><description>&lt;p&gt;Fantastic :) Now just need to be able to feed those arguments from VSCode Plugin :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: VSCode Plugin Erase and Flash without erasing external flash. west flash --erase without erasing QSPI flash</title><link>https://devzone.nordicsemi.com/thread/552540?ContentTypeID=1</link><pubDate>Mon, 27 Oct 2025 17:05:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bf2c4cf-20f6-4993-85fd-0771f8654be9</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;See&lt;a href="https://github.com/zephyrproject-rtos/zephyr/commit/146fd2c88ec38655d61d8fa3fc879cb47a9fd33d"&gt; this commit&lt;/a&gt; for the issue you have reported.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: VSCode Plugin Erase and Flash without erasing external flash. west flash --erase without erasing QSPI flash</title><link>https://devzone.nordicsemi.com/thread/549884?ContentTypeID=1</link><pubDate>Fri, 26 Sep 2025 10:40:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b50afddb-eca4-4543-8571-42d5e4dd8229</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;We are working on this and I have created an internal ticket to track the bug you reported. I will keep you updated here. Apologies for any inconvenience this may have caused.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt; Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: VSCode Plugin Erase and Flash without erasing external flash. west flash --erase without erasing QSPI flash</title><link>https://devzone.nordicsemi.com/thread/549733?ContentTypeID=1</link><pubDate>Wed, 24 Sep 2025 21:25:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ae0f633-8452-4d7b-acb0-7726f164982b</guid><dc:creator>jakkra</dc:creator><description>&lt;p&gt;Hi, yes this I tried before, but AFAIK I can&amp;#39;t get the actual selected build folder there hence not a good solution.&lt;br /&gt;I need to dynamically the folder and device id like this, I do not want to hard code it.&lt;br /&gt;west flash -d&amp;nbsp;build_folder --dev-id dev_id_corresponding_to_this_build_folder&lt;br /&gt;&lt;br /&gt;Anyway I patched Zephyr to not do erase of external flash for now so we are good until both VSCode (1&lt;span&gt;. (Bug)&lt;/span&gt;) and west flash&amp;nbsp;(&lt;span&gt;2. (Feature request)) are fixed.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: VSCode Plugin Erase and Flash without erasing external flash. west flash --erase without erasing QSPI flash</title><link>https://devzone.nordicsemi.com/thread/549686?ContentTypeID=1</link><pubDate>Wed, 24 Sep 2025 12:44:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a22c583a-3f26-43a9-88f4-7564a04a5cd2</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Until the upcoming release, a possible workaround is to create a task of type &lt;code&gt;nrf-connect-shell&lt;/code&gt; instead of &lt;code&gt;nrf-connect-flash&lt;/code&gt;, specify the full &lt;code&gt;west flash&lt;/code&gt; command with the required arguments, and then bind that task to the build configuration.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;{
   &amp;quot;label&amp;quot;: &amp;quot;My Custom Flash Task&amp;quot;,
   &amp;quot;command&amp;quot;: &amp;quot;west flash --erase-mode=all --ext-erase-mode=none&amp;quot;,
   &amp;quot;type&amp;quot;: &amp;quot;nrf-connect-shell&amp;quot;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;quot;nrf-connect.taskBindings&amp;quot;: {
      &amp;quot;flash&amp;quot;: [
        {
          &amp;quot;taskName&amp;quot;: &amp;quot;My Custom Flash Task&amp;quot;,
          &amp;quot;buildConfigs&amp;quot;: [&amp;quot;${workspaceFolder}/build&amp;quot;]
        }
      ]
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: VSCode Plugin Erase and Flash without erasing external flash. west flash --erase without erasing QSPI flash</title><link>https://devzone.nordicsemi.com/thread/549559?ContentTypeID=1</link><pubDate>Tue, 23 Sep 2025 12:16:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:270eda68-01a6-4082-804a-031b1ed01953</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Sorry for the delay in responding to this issue. I wanted to check internally before getting back to you.&lt;/p&gt;
[quote user=""]&lt;p&gt;(Feature request) There is no way in VSCode Plugin to in a generic way add this. (when above is fixed)&lt;/p&gt;
&lt;p&gt;I want to use the vscode task type &amp;quot;nrf-connect-flash&amp;quot; as it automatically knows the active app, build dir. etc. So as far as I know there is not way to manually create shell command that calls west flash manually with those arguments that work for any application in the plugin.&lt;/p&gt;
&lt;p&gt;This is what I want:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;{&lt;/code&gt;&lt;br /&gt;&lt;code&gt; &amp;quot;type&amp;quot;: &amp;quot;nrf-connect-flash&amp;quot;,&lt;/code&gt;&lt;br /&gt;&lt;code&gt; &amp;quot;label&amp;quot;: &amp;quot;Custom Flash with Erase&amp;quot;,&lt;/code&gt;&lt;br /&gt;&lt;code&gt; &amp;quot;config&amp;quot;: &amp;quot;${activeConfig}&amp;quot;,&lt;/code&gt;&lt;br /&gt;&lt;code&gt; &amp;quot;erase&amp;quot;: true,&lt;/code&gt;&lt;br /&gt;&lt;code&gt; &amp;quot;softreset&amp;quot;: false,&lt;/code&gt;&lt;br /&gt;&lt;code&gt; &amp;quot;args&amp;quot;: ["-erase-mode=all", "--ext-erase-mode=none"], //&amp;lt;- Appends extra args to west flash, not supported by plugin today&lt;/code&gt;&lt;br /&gt;&lt;code&gt; &amp;quot;problemMatcher&amp;quot;: []&lt;/code&gt;&lt;br /&gt;&lt;code&gt;}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Alternatively adding the external flash config to the VSCode Plugin such as &amp;quot;erase&amp;quot; and &amp;quot;softreset&amp;quot; already are. Probably the better way.&lt;/p&gt;
&lt;p&gt;The reason this is important i that for us is w&lt;span&gt;e want to flash with --erase as it&amp;#39;s much faster as we use pretty much whole nRF5340 flash. Doing a sector erase is much slower ~30 seconds compare to chip erase ~few seconds only. So without --erase each flash during development adds like ~25 seconds.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Now since the change (commit referenced earlier) --erase also wipes the full external flash, which takes 2 minutes for us and also all content is gone. We save resources on external flash that takes ~60 seconds to upload there.&amp;nbsp;&lt;/p&gt;[/quote]
&lt;p&gt;We are already working on this, and you can expect the feature in an upcoming release, although I don’t have a clear timeline to share at the moment.&lt;/p&gt;
&lt;p&gt;I will also get back to you regarding the other question you asked.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>