Build on Debug in VS Code

When I click "Flash" in the nRF Connect extension for VS Code, it will first build the project, then flash the device.

When I click "Debug", it will flash the last built image to the device (but will not build any changes).

Is there a way to include the "Build" step in the "Debug" command, so it functions the same way the "Flash" command does?

Parents
  • Hello Jordan,

    You can create a custom launch configuration with the cogwheel icon on the debug button. There's a field in that json object called something like preLaunchTask, which you can add to execute any task from tasks.json before debugging starts. You'll need to make a task binding for the build task to combine the two, but that would be the way to do it

    Regards,

    Elfving

Reply
  • Hello Jordan,

    You can create a custom launch configuration with the cogwheel icon on the debug button. There's a field in that json object called something like preLaunchTask, which you can add to execute any task from tasks.json before debugging starts. You'll need to make a task binding for the build task to combine the two, but that would be the way to do it

    Regards,

    Elfving

Children
Related