Frequently Asked Questions (FAQ)

General Questions

Q: Do the Workspace and Tools Setup, Import Application, and Create New Application wizards work for bare-metal CMake / SDK projects?

A: Yes. In 0.5 all three wizards support both Zephyr and bare-metal CMake / SDK projects. The Workspace and Tools Setup wizard detects the project type from the selected source and adapts its steps. Import Application supports multi-sample selection for both CMake / SDK and Zephyr sources; for Zephyr, each selected sample is paired with the board chosen in the wizard. Create New Application generates either an empty project or a copy of a sample template, with a .vscode/settings.json populated with toolchain, environment variables, and an initial build configuration.

Q: How do I remove a configured SDK or Repository?

A: In the Application view, hover the SDK or Repository node and click the inline trash icon. The extension prompts for confirmation, then removes the entry from onsemi.repositories. Files on disk are not deleted.

Q: How do I cancel a long-running build / configure / clean / flash?

A: Click the inline stop icon on the project node while a task is running, run onsemi: Project: Stop Task from the Command Palette, or right-click the project node and choose Stop Task.

Q: Do I need to install tools manually?

A: No. The Workspace and Tools Setup panel can download and install all required tools automatically. The extension has a default set of tools it installs based on the project type (Zephyr or CMake/SDK). If your repository/SDK contains a tools.json file, the extension will install the tools specified in that file instead.

Q: Can I work with multiple projects simultaneously?

A: Yes. Use VS Code’s multi-root workspace feature. Each project maintains independent settings in its .vscode/settings.json.

Q: How do I switch between debug and release builds?

A: Define multiple build configurations in onsemi.build.configurations and switch using the “Select Active Configuration” command or via the Application Explorer.

Debugging

Q: How do I start debugging my application?

A: Build your project first, then use onsemi: Project: Debug command. The extension will automatically select the generated ELF file.

Q: Can I have multiple debug configurations?

A: Yes. Use the Debug Configuration panel to create multiple configurations.

Q: How do I configure J-Link debugging?

A: Open the Debug Configuration panel, select or create a GDB configuration, and configure:

  • Target → GDB server path (JLinkGDBServerCL)

  • J-Link settings (device, interface, speed)

  • Connection details (host, port)

Q: What if I have multiple ELF files?

A: Use onsemi: Project: Select Active ELF to choose which ELF file to debug. The selected file appears in the status bar.

Q: How do I view peripheral registers during debugging?

A: Configure the SVD file path in the Debug Configuration panel under the “Peripheral Inspector” tab. The Peripheral Inspector view will then show registers during debug sessions.

Zephyr-Specific

Q: How do I add custom Kconfig options?

A: Create a prj.conf file in your project root and add to build configuration:

{
  "envs": [
    {
      "name": "CONF_FILE",
      "value": "prj.conf"
    }
  ]
}

Q: How do I use devicetree overlays?

A: Create overlay files (.overlay) and reference them in build configuration:

{
  "envs": [
    {
      "name": "DTC_OVERLAY_FILE",
      "value": "boards/my_board.overlay"
    }
  ]
}

Q: How do I enable sysbuild?

A: Set sysbuild: true in your build configuration:

{
  "name": "my-config",
  "sysbuild": true
}

CMake-Specific

Q: How do I set CMake variables?

A: Use cacheVars in build configuration:

{
  "cacheVars": [
    {
      "name": "MY_VARIABLE",
      "value": "my_value"
    }
  ]
}

Q: Can I use CMake presets?

A: Yes. Specify preset names in build configuration:

{
  "configurationPreset": "my-configure-preset",
  "buildPreset": "my-build-preset"
}

Q: How do I build specific targets?

A: The extension will prompt for targets during build. You can also specify in tasks.json:

{
  "type": "onsemi.cmake",
  "command": "build",
  "targets": ["my_target", "another_target"]
}

Q: How do I use ``menuconfig`` / ``guiconfig`` for CMake projects?

A: When a CMake project exposes menuconfig or guiconfig targets, the extension auto-detects them and enables the corresponding KConfig Config action on the project node along with the onsemi: Project: Menuconfig / onsemi: Project: Guiconfig commands. No additional setting is required.

Q: My CMake superbuild has different source directories per build configuration. How do I express that?

A: Set sourceDir per entry in onsemi.build.configurations. Each value is the source directory for that configuration, relative to the project root. When omitted, the project’s default source directory is used.

Q: How do I declare that my project depends on a specific SDK and version?

A: Add an sdkDependencies map to the project’s sdk.json (next to CMakePresets.json). Each key is an installed SDK’s name; each value is a semver range. Example:

{
  "sdkDependencies": {
    "onsemi-bm-sdk": "^1.4.0"
  }
}

At configure time the extension resolves each dependency against the SDKs registered under onsemi.repositories and exports each matched SDK’s envVarName so $env{...} substitutions in CMakePresets.json resolve to the correct install path. If a dependency cannot be satisfied the extension reports the required range and the installed versions, and configuration is aborted.


Note

This extension is under active development. Features and APIs may change in future releases. Please check the changelog for breaking changes when updating.