VS_Code RT_Thread环境搭建与问题解决(二)兼容RT_Studio创建的工程

        目前vscode中的rt_studio插件主要支持的是以scons环境的编译,但是RT_Studio使用的是makefile,直接使用vscode打开点击编译是失败的,刚开始我试着把RT_Studio中的项目修改为scons编译,试了一下,编译通过,但是有个Hard警告“warning: cannot find entry symbol Reset_Handler; defaulting to 0000000008000000”,下载到板子后也不运行,网上找了好几种方法,也没有得到很好的解决,后面想了一下,RT_Studio默认创建的就是makefile项目,总不能创建一个项目修改一个项目吧,那还不如直接修改vscode的插件,做个兼容,还一劳永逸。

        建议先看一下VS_Code RT_Thread环境搭建与问题解决(一)-CSDN博客

        1.修改编译的地方 搜索 scons -j定位到地方,把run修改为如下

run() { this.terminal.sendText(c.getClsLabel());const e = new n.RttStudioSetting("RTT_Studio.Build.Parallel_Jobs"),t = String(e.getSettingValue(this.targetFolder));const fs = require('fs');const debugDir = this.location + "/Debug";if (fs.existsSync(debugDir)) {//return t ?    this.terminal.sendText(`make -C ${debugDir} -j ` + t) : this.terminal.sendText(`make -C ${debugDir}`),!0 this.terminal.sendText(`make -C ${debugDir}`),!0 }else {return t ? this.terminal.sendText("scons -j " + t) : this.terminal.sendText("scons"),!0}}

上图是解压缩的样子,注释那里是因为我电脑在vscode使用make -j会卡死,所以只采用了下面那句,如果你电脑不会出现这种问题,可以把注释去掉,然后把下一句注释或者删除都行。

2.修改清除的地方,搜索scons -c定位到地方,把run修改为如下

run() {const fs = require('fs');const debugDir = this.location + "/Debug"; if (fs.existsSync(debugDir)) {return this.terminal.sendText(s.getCDLabel() + this.location), this.terminal.sendText(s.getClsLabel()), this.terminal.sendText(`make clean -C ${debugDir}`), !0}else {return this.terminal.sendText(s.getCDLabel() + this.location), this.terminal.sendText(s.getClsLabel()), this.terminal.sendText("scons -c"), !0}}

保存重启vscode即可

  • 24
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值