打造一个通用性MCU架构,支持CX32/AT32/NRF51/NRF52等。 OS支持RTX4/RTX5/FreeRtos。 采用VsCode+GCC组合,VsCode+KEIL5,超强开发方式。 QQ群:524408033

LiSun

打造一个通用性MCU架构,支持CX32/AT32/NRF51/NRF52等。 OS支持RTX4/RTX5/FreeRtos。 采用VsCode+GCC组合,VsCode+KEIL5,超强开发方式。 QQ群:524408033

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

好处:多版本IAR相互兼容,不会导致项目工程打开失败。代码提示方便,开发便捷

工具准备:(文末有一键打包)

  1. VSCODE 至少V1.69以上 下载
    (内含插件:C/C++;C++ Intellisense;Embedded IDE;Cortex Debug;IAR Build;IAR C-SPY Debug;git;Git Graph)
    联网PC直接跳过
    无网PC一定要下载Embedded IDE3.9离线包
    补丁需要释放到[x:\VSCode\data\extensions]

  2. IAR 7.80.4 下载 IAR 8.20.2 下载 IAR 8.40.2 下载 IAR 9.30.1(文件末尾)

  3. OpenOCD 20211118 下载
    注:需要修改后,才能OpenOCD调试。
    x:\OpenOCD-20211118-0.11.0\share\openocd\scripts\target\ti_cc26x0.cfg

在文本首段添加:
transport select jtag
adapter speed 8000

在这里插入图片描述
Git(非必须) https://wwz.lanzout.com/iFoVb0ajl80j 密码:9nac

4. VSCODE–IAR Build使用方法

在这里插入图片描述
在这里插入图片描述
功能:编译-重编译-清理-打开IAR
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "iar",
            "command": "build",
            "project": "${command:iar-config.project-file}",
            "config": "${command:iar-config.project-configuration}",
            "builder": "${command:iar-config.toolchain}/common/bin/iarbuild.exe",
            "label": "IAR--Build",
            "group": "build",
            "extraBuildArguments": [
                "-parallel",
                "8"
            ],
            "problemMatcher": [
                "$iar-cc",
                "$iar-linker"
            ]
        },
        {
            "type": "iar",
            "command": "rebuild",
            "project": "${command:iar-config.project-file}",
            "config": "${command:iar-config.project-configuration}",
            "builder": "${command:iar-config.toolchain}/common/bin/iarbuild.exe",
            "label": "IAR--Rebuild",
            "group": "none",
            "problemMatcher": [
                "$iar-cc",
                "$iar-linker"
            ]
        },
        {
            "type": "iar",
            "command": "clean",
            "project": "${command:iar-config.project-file}",
            "config": "${command:iar-config.project-configuration}",
            "builder": "${command:iar-config.toolchain}/common/bin/iarbuild.exe",
            "label": "IAR--Clean",
            "group": "none",
            "problemMatcher": [
                "$iar-cc",
                "$iar-linker"
            ]
        },
        {
            "type": "iar",
            "command": "open",
            "workbench": "${command:iar-config.toolchain}/common/bin/IarIdePm.exe",
            "workspace": "${command:iar-build.selectIarWorkspace}",
            "label": "IAR--Open IAR",
            "problemMatcher": []
        },
        {
            "label": "EIDE--Flash",
            "command": "${command:eide.project.uploadToDevice}"
        },
        {
            "label": "IAR--Build--Flash",
            "type": "shell",
            "dependsOn": [
                "IAR--Build",
                "EIDE--Flash"
            ],
            "dependsOrder": "sequence",
            "problemMatcher": []
        },
    ]
}

快捷键重定义:x:\VSCode\data\user-data\User\keybindings.json

// 将键绑定放在此文件中以覆盖默认值auto[]
[
    {
        "key": "ctrl+shift+oem_plus",
        "command": "-workbench.action.zoomIn"
    },
    {
        "key": "ctrl+shift+oem_minus",
        "command": "-workbench.action.zoomOut"
    },
    {
        "key": "ctrl+shift+oem_plus",
        "command": "editor.action.transformToUppercase"
    },
    {
        "key": "ctrl+shift+oem_minus",
        "command": "editor.action.transformToLowercase"
    },
    {
        "key": "ctrl+alt+f6",
        "command": "eide.project.buildAndFlash"
    },
	// 任务快捷键定义
	{
		"key": "f7",
		"command": "workbench.action.tasks.runTask",
		"args": "IAR--Build",
		"when": "editorTextFocus || terminalFocus || filesExplorerFocus"
	},
	{
		"key": "ctrl+alt+f7",
		"command": "workbench.action.tasks.runTask",
		"args": "IAR--Rebuild",
		"when": "editorTextFocus || terminalFocus || filesExplorerFocus"
    },
    {
        "key": "f7",
        "command": "-eide.project.build",
        "when": "cl.eide.projectActived && !isInDiffEditor"
    },
    {
        "key": "ctrl+alt+f7",
        "command": "-eide.project.rebuild",
        "when": "cl.eide.projectActived"
    },
	// 编译+烧录+Debug
	{
		"key": "ctrl+alt+f6",
		"command": "workbench.action.tasks.runTask",
		"args": "IAR--Build--Flash--Debug",
		"when": "editorTextFocus || terminalFocus || filesExplorerFocus"
    },
]

5. VSCODE–Embedded IDE使用方法(目前只有烧录功能可用,预计2周适配IAR编译)

切换烧录器,内置Jlink和Openocd+XDS110
在这里插入图片描述
说明文档:https://em-ide.com/zh-cn/docs/intro

  1. 配置工具环境
    vscode–设置
    在这里插入图片描述
    将下面内容,根据实际路径填入。
{
    "iar-build.iarInstallDirectories": [
        "c:\\IAR784",
        "c:\\IAR8.40",
        "c:\\IAR8.20"
    ],
    "files.trimTrailingWhitespace": true,
    "files.autoGuessEncoding": true,
    "editor.renderWhitespace": "boundary",
    "cortex-debug.armToolchainPath": "C:\\ti\\arm-none-eabi\\bin",
    "cortex-debug.openocdPath": "C:\\ti\\OpenOCD\\bin\\openocd.exe",
    "cortex-debug.JLinkGDBServerPath": "C:\\ti\\JLink\\JLinkGDBServerCL.exe",
    "cortex-debug.showRTOS": true,
    "git.enableSmartCommit": true,
    "EIDE.ARM.Option.AxfToElf": true,
    "EIDE.JLink.InstallDirectory": "C:\\ti\\JLink\\",
    "EIDE.OpenOCD.ExePath": "C:\\ti\\OpenOCD\\bin\\openocd.exe",
    "EIDE.ARM.GCC.InstallDirectory": "C:\\ti\\arm-none-eabi\\",
    "explorer.confirmDelete": false,
    "terminal.integrated.profiles.windows": {
        "gitBash": {		//这里的名称开头若是大写不能有空格(如:GitBash)
            "path": "G:\\Git\\bin\\bash.exe", //此处是git本地安装路径
        },
        "JLinkRTTClient":{
            "path": "C:\\ti\\JLink\\JLinkRTTClient.exe",
        }
    },
}

在这里插入图片描述

一键下载:
Vscode+openocd+arm-none-eabi+JLink

IAR下载:
IAR7.80.2
链接:https://pan.baidu.com/s/1eEqn8HBkJ_W5sHSJQX5heA 提取码:x2wb
在这里插入图片描述

协议栈下载:
simplelink_cc2640r2_sdk_1_35_00_33
simplelink_cc2640r2_sdk_4_20_00_04
simplelink_cc13x2_26x2_sdk_4_40_04_04

posted on 2022-08-30 20:21  xuejianqiang  阅读(40)  评论(0编辑  收藏  举报  来源
打造一个通用性MCU架构,支持CX32/AT32/NRF51/NRF52等。 OS支持RTX4/RTX5/FreeRtos。 采用VsCode+GCC组合,VsCode+KEIL5,超强开发方式。 QQ群:524408033