openocd - wrong paths on win x64
Hi,
I was not able to download/debug generated code into a STM32F3 Discovery board (STM32F303). It was not possible to connect to the target.
Testing openocd alone I have observed that openocd directory is set to “/usr/bin” (below is opeocd output):
Debug: 17 32 options.c:98 add_default_dirs(): bindir=/usr/bin
Debug: 18 32 options.c:99 add_default_dirs(): pkgdatadir=/usr/share/openocd
this could be not so big problem (my guess) but the path where “script” folder is located on a win 64 system is not correct:
Debug: 22 47 configuration.c:44 add_script_search_dir(): adding C:/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.openocd.win32_1.2.0.201505291716/tools/openocd/bin/usr/share/openocd/scripts
On my sistem openocd ‘scripts’ folder is located on this path:
C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.2.0.201506021103\resources\openocd\scripts\board
so the above path will not working.
I have check this on both Win 7 x64 and Win 8.1 x64 machine. Installer used was “install_sw4stm32_win_64bits-v1.2.exe”, and last updates after install.
Using another Windows buil for opencod (Freddie Chopin) I was able to connect to the board (see logs attached).
Attached is the command line scripts used and log files.
Plese let me know if you can reproduce this behavior.
Did you build yourself openocd ?
=========
Here are parts of the opeocd output (Freddie Chopin build) - just for reference:
Commnad line window:
------------
C:\openocd-0.9.0_fc\bin\openocd.exe -f c:\openocd-0.9.0_fc\scripts\board\stm32f3discovery.cfg -d3 -l d:\openocd_log_fc.txt
Open On-Chip Debugger 0.9.0 (2015-05-19-12:06)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
User : 13 0 command.c:546 command_print(): debug_level: 3
Debug: 14 16 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_log_output d:openocd_log_fc.txt
Debug: 15 16 command.c:145 script_debug(): command - log_output ocd_log_output d:openocd_log_fc.txt
Parts of the log file:
-----------
Debug: 17 32 options.c:98 add_default_dirs(): bindir=bin
Debug: 18 32 options.c:99 add_default_dirs(): pkgdatadir=
Debug: 19 32 options.c:100 add_default_dirs(): run_prefix=C:/openocd-0.9.0_fc/
Debug: 20 32 configuration.c:44 add_script_search_dir(): adding C:\Users\ciprian\AppData\Roaming/OpenOCD
Debug: 21 32 configuration.c:44 add_script_search_dir(): adding C:/openocd-0.9.0_fc//site
Debug: 22 32 configuration.c:44 add_script_search_dir(): adding C:/openocd-0.9.0_fc//scripts
Debug: 23 32 configuration.c:84 find_file(): found c:\openocd-0.9.0_fc\scripts\board\stm32f3discovery.cfg
Debug: 24 32 configuration.c:84 find_file(): found C:/openocd-0.9.0_fc//scripts/interface/stlink-v2.cfg
.........
Debug: 257 47 stlink_usb.c:1602 stlink_usb_open(): stlink_usb_open
Debug: 258 47 stlink_usb.c:1619 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x3748 serial:
Info : 259 120 stlink_usb.c:523 stlink_usb_version(): STLINK v2 JTAG v23 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : 260 120 stlink_usb.c:1730 stlink_usb_open(): using stlink api v2
Debug: 261 120 stlink_usb.c:722 stlink_usb_init_mode(): MODE: 0x02
Info : 262 120 stlink_usb.c:555 stlink_usb_check_voltage(): Target voltage: 2.907062
Above is a sucesfull connection to the board (see voltage target and STLINK version of the target board)