Skip to content

Latest commit

 

History

History
65 lines (42 loc) · 2.86 KB

File metadata and controls

65 lines (42 loc) · 2.86 KB

VS Code Configuration

Example configuration for debugging programs in-editor with VS Code.

Required Extensions

If you have the code command in your path, you can run the following commands to install the necessary extensions.

code --install-extension rust-lang.rust
code --install-extension marus25.cortex-debug

Otherwise, you can use the Extensions view to search for and install them, or go directly to their marketplace pages and click the "Install" button.

Use

The Debug (OpenOCD): Starts a debug session for a STM32F3DISCOVERY board. It will use the default .cargo/config configuration to build the executable, upload it to the device, and start a debug session.

ITM output, if used, will be written to the Output view SWO: ITM [port: 0, type: console] output.

Git

Files in the .vscode/ directory are .gitignored by default because many files that may end up in the .vscode/ directory should not be committed and shared.
However, a number of files are explicitly tracked, because they define complex debug configurations and should be shared with anyone cloning your project.

SVD File

The SVD file is a standard way of describing all registers and peripherals of an ARM Cortex-M mCU.
Cortex-Debug needs this file to display the current register values for the peripherals on the device.

For licensing reasons, we're unable to include the SVD file in the quickstart repository, but it can be downloaded from the ST's Website.

Download the stm32f3 SVD pack, and copy the STM32F303.svd file into ~/.svd/.
This line of the config tells the Cortex-Debug plug in where to find the file.

"svdFile": "${env:HOME}/.svd/STM32F303.svd",

Personally, I like keeping them in my home directory so I don't have to keep multiple copies of the SVD on disk, but you could also keep the file under .vscode/ if you have a private project where there are no licensing concerns around the SVD file.

"svdFile": "${workspaceRoot}/.vscode/STM32F303.svd",

CPU Frequency

If your device is running at a frequency other than the default 8MHz, you'll need to modify this line of launch.json for the ITM output to work correctly.

"cpuFrequency": 8000000,