Example of a flash task with extra arguments

nRF Connect for VS Code

tags
nRF Connect for VS Code

In the following example, the tasks.json file includes a custom nrf-connect-flash type with the extraArgs parameter to pass a custom --erase-mode=all argument to the flash runner:

{
  "version": "2.0.0",
  "tasks": [
    {
      "type": "nrf-connect-flash",
      "config": "${workspaceFolder:hello_world}/build_nrf52840",
      "snr": "683888634",
      "erase": false,
      "extraArgs": ["--erase-mode=all"],
      "problemMatcher": [],
      "label": "nRF Connect: Flash with erase mode set to all"
    }
  ]
}

The extraArgs arguments are appended to the flash command after all other standard arguments.