Launching Ozone from VS Code
Jump to navigation
Jump to search
This article describes how to launch SEGGER Ozone from within Visual Studio Code (VS Code).
That approach relies on the builtin VS Code tasks feature which can be configured via a JSON file (see https://code.visualstudio.com/docs/debugtest/tasks).
NOTE: Make sure to adapt the arguments below according to your specific project requirements (e.g. -device <your_device>).
The supported command-line arguments are explained in detail in the Ozone User Guide & Reference Manual (https://www.segger.com/downloads/jlink/UM08025_Ozone.pdf).
HOW TO
- Obtain Ozone: https://www.segger.com/products/development-tools/ozone-j-link-debugger as well as any required license (if applicable).
- Install Ozone and make sure the path to
ozoneis within the $PATH environment variable. - Edit the file
.vscode/.tasks.jsonlocated in your VS Code workspace (if the file does not yet exist, then you may create it). - Add a task according to this pattern:
- If NOT using the VS Code CMake extension:
{ "version": "2.0.0", "tasks": [ { "label": "Launch Ozone", "type": "shell", "command": "ozone -device STM32F746NG -select USB -if SWD -project dbgWithOzone.jdebug -programfile <path_to_the_application_elf_file>", "problemMatcher": [] } ] }
- If using the VS Code CMake extension:
{ "version": "2.0.0", "tasks": [ { "label": "Launch Ozone", "type": "shell", "command": "ozone -device STM32F746NG -select USB -if SWD -project dbgWithOzone.jdebug -programfile ${command:cmake.launchTargetPath}", "problemMatcher": [] } ] }
- In the case that the CMake-extension is being used, then
${command:cmake.launchTargetPath}automatically resolves to the build-target of the CMake project currently selected in VS Code.
- If NOT using the VS Code CMake extension:
- Launch the task by using the Command Palette
(Ctrl+Shift+P), filtering on 'task' and selectingTasks: Run Taskand then choosingLaunch Ozonefrom the drop-down list that gets shown.