# VS Code Configuration
Example configurations for debugging programs in-editor with VS Code.
This directory contains configurations for two platforms:
- `LM3S6965EVB` on QEMU
- `STM32F303x` via OpenOCD
## Required Extensions
If you have the `code` command in your path, you can run the following commands to install the necessary extensions.
```sh
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.
- [Rust Language Server (RLS)](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust)
- [Cortex-Debug](https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug)
## Use
The quickstart comes with two debug configurations.
Both are configured to build the project, using the default settings from `.cargo/config`, prior to starting a debug session.
1. QEMU: Starts a debug session using an emulation of the `LM3S6965EVB` mcu.
- This works on a fresh `cargo generate` without modification of any of the settings described above.
- Semihosting output will be written to the Output view `Adapter Output`.
- `ITM` logging does not work with QEMU emulation.
2. OpenOCD: Starts a debug session for a `STM32F3DISCOVERY` board (or any `STM32F303x` running at 8MHz).
- Follow the instructions above for configuring the build with `.cargo/config` and the `memory.x` linker script.
- `ITM` output will be written to the Output view `SWO: ITM [port: 0, type: console]` output.
### Git
Files in the `.vscode/` directory are `.gitignore`d by default because many files that may end up in the `.vscode/` directory should not be committed and shared.
If you would like to save this debug configuration to your repository and share it with your team, you'll need to explicitly `git add` the files to your repository.
```sh
git add -f .vscode/launch.json
git add -f .vscode/tasks.json
git add -f .vscode/*.svd
```
## Customizing for other targets
For full documentation, see the [Cortex-Debug][cortex-debug] repository.
### Device
Some configurations use this to automatically find the SVD file.
Replace this with the part number for your device.
```json
"device": "STM32F303VCT6",
```
### OpenOCD Config Files
The `configFiles` property specifies a list of files to pass to OpenOCD.
```json
"configFiles": [
"interface/stlink-v2-1.cfg",
"target/stm32f3x.cfg"
],
```
See the [OpenOCD config docs][openocd-config] for more information and the [OpenOCD repository for available configuration files][openocd-repo].
### SVD
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.
You can probably find the SVD for your device on the vendor's website.
For example, the STM32F3DISCOVERY board uses an mcu from the `STM32F303x` line of processors.
All the SVD files for the STM32F3 series are available on [ST's Website][stm32f3].
Download the [stm32f3 SVD pack][stm32f3-svd], and copy the `STM32F303.svd` file into `.vscode/`.
This line of the config tells the Cortex-Debug plug in where to find the file.
```json
"svdFile": "${workspaceRoot}/.vscode/STM32F303.svd",
```
For other processors, simply copy the correct `*.svd` file into the project and update the config accordingly.
### CPU Frequency
If your device is running at a frequency other than 8MHz, you'll need to modify this line of `launch.json` for the `ITM` output to work correctly.
```json
"cpuFrequency": 8000000,
```
### Other GDB Servers
For information on setting up GDB servers other than OpenOCD, see the [Cortex-Debug repository][cortex-debug].
[cortex-debug]: https://github.com/Marus/cortex-debug
[stm32f3]: https://www.st.com/content/st_com/en/products/microcontrollers-microprocessors/stm32-32-bit-arm-cortex-mcus/stm32-mainstream-mcus/stm32f3-series.html#resource
[stm32f3-svd]: https://www.st.com/resource/en/svd/stm32f3_svd.zip
[openocd-config]: http://openocd.org/doc/html/Config-File-Guidelines.html
[openocd-repo]: https://sourceforge.net/p/openocd/code/ci/master/tree/tcl/
![avatar](https://profile-avatar.csdnimg.cn/default.jpg!1)
快撑死的鱼
- 粉丝: 2w+
- 资源: 9155
最新资源
- ssm+vue的台球厅管理系统(有报告)。Javaee项目,ssm vue前后端分离项目。
- Comsol电磁波模型下的金属超表面光栅:基于TE与TM偏振斜入射时的多级衍射与反射光谱计算研究 ,Comsol电磁波模型下的金属超表面光栅:探究TE TM偏振斜入射时不同衍射级反射光谱的精细计算
- 插头式网站Javascript防护脚本
- ssm+vue的企业员工管理系统(有报告)。Javaee项目,ssm vue前后端分离项目。
- 光伏储能虚拟同步发电机J与D参数协同自适应控制:VSG功能实现与仿真分析,光伏储能虚拟同步发电机参数协同自适应控制及高效能量管理仿真模型研究,光伏储能同步发电机J和D参数协同自适应控制仿真模型 ①自适
- 冷链物流政策发展演变及趋势研判-2024.pdf
- 金融业数据库创新发展报告(2024).pdf
- 从中国企业视角看元宇宙发展研究报告 2024-52页.pdf
- 数据治理体系总体方案与实施路线图(27页).pptx
- PLC状态机大解析:西门子进阶实战教程SICAR4.0、OMAC与CPG源码集萃,PLC标准状态机实战资料集合:迈向行业高手的西门子1500 PLC与TP1200触摸屏HMI进阶教程,标准PLC状态机
- JESD209-5C LPDDR5/5X
- PMSM永磁同步电机参数高精度辨识仿真:定子电阻、DQ电感与转子磁链辨识,适用于表贴与内嵌式电机,算法简洁,支持多种芯片,Matlab2018版,PMSM永磁同步电机参数高精度辨识仿真:定子电阻、DQ
- 基于COMSOL的岩石损伤与热水力损伤耦合模型研究,COMSOL下的岩石损伤与热水力损伤耦合模型研究,comsol 岩石损伤 热水力损伤耦合模型 ,comsol; 岩石损伤; 热水力损伤; 耦合模型
- 模拟IC设计专题:基于Gpdk工艺与Cadence电路工具的以太网PHY项目学习资料集,模拟IC设计技术解析:以太网络系统级电路设计与版图实战教程(含Gpdk工艺),模拟ic设计,一个完整的以太网项目
- JESD209-4-1A LPDDR4X
- 利用元胞自动机模拟晶粒生长与熔池微观组织演变:从枝晶到合金凝固的动态观察,基于元胞自动机的晶粒生长与熔池微观组织演变模拟研究,元胞自动机模拟晶粒生长 熔池微观组织演变,模拟枝晶,晶粒生长,合金凝固,熔
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)