vscode+cortex 调试jflash不支持的芯片

习惯了vscode + cmake+ cortex-debug进行项目开发·······

无奈好多国产MCU不在jflash设备列表,但是都有keil支持包!

1. jflash添加设备即可

JFlash添加芯片_大白菜价的博客-CSDN博客_jflash添加芯片型号

添加完设备,可以调试了,但是发现通过elf文件下载的程序不完整,无法运行·····

曲线救国,先调用jflash下载hex,再调试

2.

构建jflash下载的task

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "jlink_download",
            "type": "shell",
            "command": "D:/software/SEGGER/JLink/JLink.exe -autoconnect 1 -device CMS32F55xx -if swd -speed 1000 -commandfile download.jlink",
            "problemMatcher": []
        }
    ]
}

建立一个文件download.jlink

文件内容

erase
loadfile ./build/XXXX.hex 
qc

OK

cortex-debug配置文件把设备写成Cotex-M0,这样cortex-debug就因为找不到下载算法二不进行下载程序

加入启动调试前任务即可

"preLaunchTask": "jlink_download"

实测,一切OK

*************************************************************************************************

keil支持cmd调用,所以,在cortex-debug调试前调用keil下载程序即可!

建立一个此芯片的剋了工程

直接上task吧。

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "rm",
            "type": "shell",
            "command": "rm -r ./MDK-ARM/Objects/*.axf"
        },
        {
            "label": "copy",
            "type": "shell",
            "command": "copy ./build/BLDC.elf ./MDK-ARM/Objects/FM33_BLDC.axf",
            "dependsOn": [
                "rm"
            ]
        },
        {
            "label": "keil_download",
            "type": "shell",
            "command": "D:\\software\\KEIL\\UV4\\UV4.exe -f ./MDK-ARM/FM33_BLDC.uvprojx -j0",
            "dependsOn": [
                "copy"
            ]
        },
    ]
}

BLDC.elf   cmake编译的文件名称

FM33_BLDC.axf  keil生产的文件名称

在launch加入"preLaunchTask": "keil_download",就可以!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值