使用VScode开发ARM核芯片通用配置

针对基于CMake构建的芯片例程开发均可以使用如下配置,本文暂时只讲操作不讲原理,网上资料很多大家可以自己去搜。

建议:在C盘直接新建一个Work/ToolChain来管理各种复杂的环境变量。

首先安装编译器arm-none-eabi-*组件:

其次是cmake工具:

然后是ninja:

在VScode上面安装clangd组件,并且从官网上面下载LLVM组合使用。

clangd直接搜这里:

LLVM需要在VScode中添加路径,首先点这个齿轮找到设置:

然后在这边:

在获取到的工程内新建.vscode,添加下面两个json文件(需要根据你获得的SDK修改)。

launch.json,注意这个gdbPath的路径需要改成你用的。

bash 复制代码
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "testsuit",
            "cwd": "${workspaceFolder}/testsuite/EVB-NTO",
            "executable": "./GCC/out/testsuite.elf",
            "gdbPath" : "C:/arm-none-eabi/bin/arm-none-eabi-gdb.exe",
            "request": "attach",
            "type": "cortex-debug",
            "servertype" : "external",
            "gdbTarget": "127.0.0.1:3331",
            "rtos": "Azure",
            "overrideResetCommands": [
                // RCURST1: reset core system
                "monitor memU32 0x40040084 0x000055aa",
                "monitor reset",
                "load",
                "monitor reset 1",
                // "monitor reset 4",
            ],
            "overrideRestartCommands": [
                "monitor reset 1",
                // "monitor reset 4",
            ]
        }
        
    ]
}

settings.json,第一行路径决定了编译目标;

bash 复制代码
{
    "cmake.sourceDirectory": "${workspaceFolder}/testsuite/EVB-NTO/GCC/scripts/cmake",
    "cortex-debug.variableUseNaturalFormat": false,
    "clangd.arguments": [
        "--all-scopes-completion",
        "--completion-style=detailed",
        "--query-driver=C:/arm-none-eabi/bin/arm-none-eabi*",
        "--compile-commands-dir=${workspaceFolder}/testsuite/EVB-NTO/GCC/out",
        "--pretty",
        "--background-index"
    ],
    "C_Cpp.intelliSenseEngine": "disabled",
    "commentTranslate.targetLanguage": "zh-CN"
}

注意第一个路径,对应着你的"目标构建文件"的CMakelists和CMakePresets,这是一种目前很流行的工程固件编译管理模式,通过编译脚本编译出不同的开发板、产品板适配的固件。

最后ctrl+shift+p,reload重启一下VScode,可以实现精准跳转了,来到CMake栏目下就可以生成和清理编译文件了。

相关推荐
mklpo1475 小时前
在win7 sp1 系统上安装最新版 的 Visual Studio Code。2026-10-04
ide·vscode·编辑器
ebiobiz19 小时前
极海 APM32 使用 Nimmake 编译指南
c++·python·单片机·嵌入式硬件·mcu
女神下凡1 天前
芯参谋(37):EEPROM_电路设计指南
arm开发·单片机·嵌入式硬件·fpga开发·设计规范
Brilliantwxx1 天前
【STM32】 DMA 源码分析与实战(下):DMA 收发状态机与 HAL 分层
android·开发语言·stm32·单片机·嵌入式硬件·mcu
女神下凡2 天前
芯参谋(30):EMMC eMCP 软件设计规范
arm开发·单片机·嵌入式硬件·设计规范
SKH.2 天前
ARM-uart
arm开发·单片机
AOI小白新手上路2 天前
韦东山《ARM 架构与编程》基于I.MX6ULL 3-1 硬件知识_LED 原理图 · 学习笔记
arm开发·学习·架构
一条破秋裤2 天前
TCP 缓冲区:用户空间 stdio 与内核 Socket 缓冲
arm开发·网络协议·tcp/ip
Brilliantwxx2 天前
【STM32】 DMA中断机制、NVIC 联动与配置实战前章
stm32·单片机·嵌入式硬件·mcu
Horn Still Sounds3 天前
IMX6ULL裸机|I2C通信协议 + ADC模数转换学习笔记
arm开发·笔记·单片机·嵌入式硬件