elmot / clion-embedded-arm

OpenOCD + STM32CubeMX support for CLion
https://blog.jetbrains.com/clion/2017/12/clion-for-embedded-development-part-ii
Other
170 stars 29 forks source link

Does STLink V2 support now? #136

Closed kuai6 closed 5 years ago

kuai6 commented 5 years ago

I use a STLink-v2 with my own board. The chip is STM32F103VETx

Expected Behavior

Controller is flashing and debugging correctly

Actual Behavior

/opt/openocd/0.10.0-11-20190118-1134/bin/openocd -c "tcl_port disabled" -s /opt/openocd/0.10.0-11-20190118-1134/scripts -f target/stm32f1x.cfg -c "program \"/home/k...r.elf\"" -c "init;reset init;"
GNU MCU Eclipse 64-bit Open On-Chip Debugger 0.10.0+dev-00462-gdd1d90111 (2019-01-18-11:37)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
Error: Debug adapter does not support any transports? Check config file order.
Error: unable to select a session transport. Can't continue.
shutdown command invoked 

Steps to Reproduce the Problem

  1. Import project into CLion
  2. Update Cmake with CubeMX project
  3. Try to flash or debug

Specifications

I think it must be -f interface/stlink-v2.cfg added into command, like this:

/opt/openocd/0.10.0-11-20190118-1134/bin/openocd -c "tcl_port disabled" -s /opt/openocd/0.10.0-11-20190118-1134/scripts -f interface/stlink-v2.cfg -f target/stm32f1x.cfg -c "program \"/home/k...r.elf\"" -c "init;reset init;"
elmot commented 5 years ago

You use chip config file, and that is not enough. You may use compatible board config file(try st_nucleo_f103rb.cfg, i.e. stlink/v2+ stm32F103RB ). Those files are very simple and in most cases just include interface config and chip config. + or take it as an example and write your own board file.