vscode 上开发 MCU 嵌入式项目

插件1 ARM CMSIS Solution

The Arm® CMSIS Solution extension is a graphical user interface for csolution projects that use the CMSIS-Toolbox. The extension supports microcontroller devices that incorporate Arm Cortex®-M processors and Arm Ethos®-U Neural Processing Units (NPUs), and works with various C/C++ compilers and debuggers.

This extension is free to use and you can install it individually or as part of the Arm Keil® Studio Pack.

在 VScode 上可用:下载商店地址

插件2 Device Manager

Manages device connections and configuration for Arm Cortex-M based microcontrollers, development boards and debug probes.

The Device Manager extension allows you to manage hardware connections for Arm-based microcontrollers, development boards, and debug probes. You can install the extension individually or as part of the Arm Debugger extension pack.

Connect your hardware

This section describes how to connect your hardware for the first time.

  1. Click Device Manager

    in the Activity Bar.

  2. Connect your hardware to your computer over a USB connection.

    The Device Manager detects the hardware and a pop-up message displays in the bottom right-hand corner.

  3. Click OK to use the hardware.

    Alternatively, click Add Device

    and select your hardware in the drop-down list that displays at the top of the window.

    You can now use your hardware to run and debug a project.

To add more hardware, click Add Device

in the top right-hand corner.

Edit your hardware

If the Device Manager cannot detect your hardware or if you are using an external debug probe, you can edit the hardware entry. You can specify a Device Family Pack (DFP) and a device name retrieved from the pack to be able to work with your hardware. DFPs handle device support.

  1. Move your cursor over the hardware that you want to edit and click Configure Pack

    .

  2. Select a DFP for your hardware in the drop-down list.

  3. Select a device name in the drop-down list.

  4. To change the name of the hardware, click Rename Device , then rename your hardware and press Enter.

Open a serial monitor

Open a serial monitor. The serial output shows the output of your board. You can use the serial output as a debugging tool or to communicate directly with your board.

  1. Move your cursor over the hardware for which you want to open a serial monitor and click Open Serial .

    A drop-down list displays at the top of the window where you can select a baud rate. The baud rate is the data rate in bits per second between your computer and your hardware. To view the output of your hardware correctly, you must select an appropriate baud rate. The baud rate that you select must be the same as the baud rate of your active project.

  2. Select a baud rate.

    A Terminal tab opens with the baud rate selected.

插件3 GitLens(Git 的高级版本)

GitLens 将 Git 的强大功能从命令行"搬"到了你的代码行间,让代码历史变得触手可及,极大地提升了代码阅读、理解和协作的效率。

目前 GitLens 分为免费强大的社区版 (Community) 和功能更丰富的专业版 (Pro)。如果你是 VS Code 用户,非常推荐安装 GitLens 社区版体验一下,它会彻底改变你与 Git 交互的方式。

有了这3个最基本 VScode 插件,就可以不再使用 Keil ,而是全部在 VScode 上开发 ARM MCU 的单片机项目了。