3

I have troubles to use OpenOCD. For some reasons OpenOCD can't find swj-dp.tcl but the file is existing in C:\OpenOCD\share\openocd\scripts\target.

Open On-Chip Debugger 0.9.0 (2015-08-15-12:41)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
C:\OpenOCD\share\openocd\scripts\target\stm32f1x.cfg:6: Error: Can't find target/swj-dp.tcl
in procedure 'script' 
at file "embedded:startup.tcl", line 60
at file "C:\OpenOCD\share\openocd\scripts\target\stm32f1x.cfg", line 6

Error Message

Do you have any idea or advice for me? Thank you

Drimer
  • 93
  • 2
  • 14

1 Answers1

7

The problem arises from the fact that openocd configuration files are TCL scripts which include other scripts. And those included scripts are searched for only in provided search directories (IIRC, by default only current directory). So you need to provide additional search directories:

openocd -s C:\OpenOCD\share\openocd\scripts -f ...
Kirill Dmitrenko
  • 3,474
  • 23
  • 31