0

我遵循了 StmCubeMxproject 和 OpenOCD 支持中的所有步骤(https://www.jetbrains.com/help/clion/embedded-overview.html

我的操作系统是 Windows 10。

这是 .cfg 文件:

# External  stlink
source [find interface/stlink.cfg]

# External v2.1 stlink
# source [find interface/stlink-v2-1.cfg]

# External v2.0 stlink
# source [find interface/stlink-v2.cfg]

transport select hla_swd

source [find target/stm32l4x.cfg]

reset_config srst_only

这些是设置:

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

它编译的代码。

我尝试将代码上传到带有外部 st-link 的 Stm32L486 板上(只需按下运行按钮),但这是我得到的错误:

[0m[0mOpen On-Chip Debugger 0.11.0 (2021-07-29) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results mi
ght differ compared to plain JTAG/SWD
Info : DEPRECATED target event trace-config
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : clock speed 500 kHz
Info : STLINK V2J37S0 (API v2) VID:PID 0483:3748
Info : Target voltage: 2.639374
Info : stm32l4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : gdb port disabled
Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080002b8 msp: 0x20018000
** Programming Started **
Info : device idcode = 0x10076415 (STM32L47/L48xx - Rev 4 : 0x1007 - Flash singl
e-bank)
Info : RDP level 0 (0xAA)
Info : flash size = 1024kbytes
Info : flash mode : dual-bank
Warn : Adding extra erase range, 0x08001438 .. 0x080017ff
** Programming Finished **
Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
shutdown command invoked
4

0 回答 0