• [CC2642R1][VSCODE+Embedded IDE+IAR Build+Cortex-Debug] TI CC2642R1基于VsCode的开发环境


    好处:多版本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": []
            },
        ]
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70

    快捷键重定义: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"
        },
    ]
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53

    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",
            }
        },
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28

    在这里插入图片描述

    一键下载:
    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

  • 相关阅读:
    SSM学习48:日期型请求参数
    LeetCode 1475. 商品折扣后的最终价格 / 687. 最长同值路径 / 652. 寻找重复的子树
    OpenGL坐标系转换
    《中国垒球》:晋级决赛·剑指冠军
    jquery实现下拉框
    Google刚刚推出了图神经网络Tensorflow-GNN
    oracle INSERT 批量插入写法
    CSDN文章复制没有图片只有文字
    【算法】滑动窗口题单——3.不定长滑动窗口(求最短/最小)⭐ 删除最短的子数组使剩余数组有序
    基于微信小程序的智能垃圾分类回收系统,附源码、教程
  • 原文地址:https://blog.csdn.net/qq_29246181/article/details/126600431