使用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栏目下就可以生成和清理编译文件了。

相关推荐
爱编程的小吴1 天前
通义灵码输出软件设计文档实例1
arm开发·ai写作
szxinmai主板定制专家1 天前
基于 PC 的控制技术+ethercat+linux实时系统,助力追踪标签规模化生产,支持国产化
arm开发·人工智能·嵌入式硬件·yolo·fpga开发
切糕师学AI1 天前
ARM 汇编器中的伪指令(Assembler Directives)
开发语言·arm开发·c#
FansyMeng1 天前
VSCode配置anaconda
vscode·python
陌上花开缓缓归以2 天前
OPENWRT 端口link问题
linux·arm开发
郝亚军2 天前
获取libiec61850和如何编译iec61850库
mcu·tcp/ip
Anarkh_Lee2 天前
在VSCode中使用MCP实现智能问数
数据库·ide·vscode·ai·编辑器·ai编程·数据库开发
liu_endong2 天前
杰发科技AC7840——打印所有GPIO的PORT配置寄存器
mcu·算法·杰发科技·autochips·车规芯片
一心赚狗粮的宇叔2 天前
VScode常用扩展包&Node.js安装及npm包安装
vscode·npm·node.js·web
紫竹苑主2 天前
VS Cose + PlatformIO +ESP32-S3 + ESPIDF开发环境安装卡壳持续等待问题解决
vscode·python·嵌入式硬件·物联网·硬件架构