我想问一下clion编译的makefile项目能通过openocd Download&Run的方式通过dplink下载器进行下载吗

Answered

我想问一下clion编译的makefile项目能通过openocd Download&Run的方式通过dplink下载器进行下载吗,如果可以的话能教我一下clion应该怎样设置吗?

0
1 comment

Hello!

By dplink, do you mean DAPLink?

If so, you can try the following (steps are based on CLion 2026.2):

  1. Open Settings | Build, Execution, Deployment | Embedded Development and check that CLion has found the OpenOCD location. If it hasn't, specify the path manually.
  2. Create an OpenOCD config file in your project, for example daplink.cfg, with the content below. Replace <chip> with the file name from the OpenOCD scripts/target directory that matches your MCU, for example stm32f1x for the STM32F1 series.

    source [find interface/cmsis-dap.cfg]
    transport select swd
    source [find target/<chip>.cfg]
  3. Open Run | Edit Configurations, click +, and select OpenOCD Download & Run.
  4. Select your Makefile target and the executable (.elf) to download.
  5. In the Board config file field, enter the path to the daplink.cfg file from step 2.
  6. Click Run to download the program, or Debug to download and start debugging.

For more information about the OpenOCD Download & Run run/debug configuration, see the OpenOCD support article.

0

Please sign in to leave a comment.