Build, Flash, or Debug a Project#

In the Si extension view, hover over your project to reveal the following action buttons:

  • Build: Compiles your project

  • Flash: Programs your target device

  • Debug: Launches the debugger

Build, Flash, and Debug iconsBuild, Flash, and Debug icons

Attach to a Running Target#

The Simplicity Studio VS Code extension does not currently provide a built-in option to attach to a running target. However, this is supported through the Cortex-Debug extension by adding an attach configuration to the project’s launch.json file.

This procedure assumes you have debugged the project at least once so that .vscode/launch.json exists.

Attach the Configuration#

  1. In the Si Activity bar, open your project's .vscode/launch.json file.

  2. In the configuration[] array, select and copy the existing launch configuration (typically from the opening bracket ({) on line 3 through the closing bracket (}) for that block).

    Select Existing ConfigurationSelect Existing Configuration

  3. Paste the copy after the existing configuration. Use it as the starting point for your attach configuration.

  4. In the copied configuration block, change debug in the name to attach. You can use any name, but it should show that this entry is for an attach configuration.

  5. Change request from launch to attach.

  6. Delete the runtoEntryPoint line.

  7. Delete the preLaunchTask line.

  8. Change breakAfterReset from true to false.

  9. If they are present, delete the overrideLaunchCommands and overrideResetCommands sections.

  10. By default, attach halts the processor so you can inspect the target state and set breakpoints. To attach without halting, add a postAttachCommands entry:

      "postAttachCommands": ["continue"]

    Note: If you use continue, the processor does not stop at attach. The Pause button does not work until you set a breakpoint and hit it. After that, Pause works when you resume.

  11. Save the file.

Use an Attach Configuration#

From the Silicon Labs Activity Bar (Si), select the debug icon. A drop-down lists every configuration in launch.json, including your attach configuration.

Do not use the Si extension toolbar debug icon to start an attach session. Instead, open the Run and Debug view from the activity bar and select your attach configuration from the dropdown.

Select Attach ConfigurationSelect Attach Configuration

Select Start Debugging (F5) (green arrow) to attach to the running target.