Clion中stm32开发烧录出现“monitor“ command not supported by this target.解决方法
解决在Clion中使用OpenOCD+DAPLink烧录嵌入式开发板出现“不支持monitor指令”
问题
could not connect (error 138): ϵͳ��ͼ���������ϲ����ϲ��������ϵ�Ŀ¼��
You can't do that when your target is `exec'
"monitor" command not supported by this target.
You can't do that when your target is `exec'
上传完成,但存在问题
monitor reset
"monitor" command not supported by this target.
排查步骤
1.工具链配置地址
确认除调试器
外,所有路径均指向STM32CubeCLT
给出的工具链地址
注意:C编译器选择arm-none-eabi-gcc.exe C++编译器选择arm-none-eabi-g++.exe
2. CMake设置
工具链选择上述配置
3. OpenOCD设置
- 运行配置中添加一个OpenOCD
- 可执行配置文件选择
项目文件夹\cmake编译目录\项目名称.elf
- 面板配置文件如下(以daplink stm32f1为例)
adapter driver cmsis-dap
transport select swdsource [find target/stm32f1x.cfg]adapter speed 10000
配置文件需要与实际使用的烧录器与MCU对应
全部配置文件可以在(不推荐,建议按上面格式自己写一个)OpenOCD安装目录\share\openocd\scripts\board
替换整个配置文件- 可选择的芯片在
OpenOCD安装目录\share\openocd\scripts\target
替换adapter driver XXXXX
- 全部烧录器配置文件在
OpenOCD安装目录\share\openocd\scripts\interface
替换source [find target/XXXXX]
正确配置OpenOCD调试可以解决"monitor" command not supported by this target.
问题
常见错误包括:
- 没有选择正确的二进制文件路径
- 面板配置文件错误,烧录器和芯片不匹配
- openocd端口错误,一般参考图片中的设置保持默认即可
clion不需要像eclipse那样单独用终端开启一个openocd服务,配置正确按运行按钮就会正常运行