好处:多版本IAR相互兼容,不会导致项目工程打开失败。代码提示方便,开发便捷
工具准备:(文末有一键打包)
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]
IAR 7.80.4 下载 IAR 8.20.2 下载 IAR 8.40.2 下载 IAR 9.30.1(文件末尾)
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
功能:编译-重编译-清理-打开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"
},
]
切换烧录器,内置Jlink和Openocd+XDS110
说明文档:https://em-ide.com/zh-cn/docs/intro
{
"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