Unable to download program to STM32F4 Discovery Board using OpenOCD-0.8.0 and simulink

8 次查看(过去 30 天)
Hello together,
I use Matlab-R2015b with Hardware Support Packages for STM32F4 Discovery Board. I'm not able to download program to STM32F4 Discovery Board using OpenOCD and simulink. I got the following error-message:
### Launching openOCD server "C:\MATLAB\SupportPackages\R2015b\openocd-0.8.0\bin\openocd-0.8.0.exe" -f board/stm32f4discovery.cfg:
Unable to launch the openOCD debugger to download the executable to target. Check the following:
1. Are the 'ST-Link/V2' drivers installed properly?
2. Did you connect the STM32F4-Discovery board to the host computer using a USB cable?
3. Re-connect the STM32F4-Discovery board to the host machine and check that the drivers are detected.
For more information, look in the logfile generated by openOCD: C:/temp/stm32f4discovery_pb_led_ert_rtw/mw_openocd_log.txt.
Content of mw_openocd_log.txt:
Open On-Chip Debugger 0.8.0 (2014-04-28-08:39)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : This adapter doesn't support configurable speed
Error: open failed
in procedure 'transport'
in procedure 'init'
I installed the driver for ST-Link and ST-Link V2. I can download the program to the board using ST-Link Ultility or Keil.
Could someone please help me? Thank you in advance!

回答(4 个)

Ashot Melkonyan
Ashot Melkonyan 2016-5-24
Hi Florence, yes I solved the issue. The Problem in my case was the rihght Installation of the OpenOCD Version. And we have to correct the wrong path references in the configuration files. Matlab assumes the Version of OpenOCD 6, but the right Version is openocd-0.8.0. so you have to manually correct this. Generally try to run OpenOCD from the command line "- standalone" then let matlab to run it.
Regards, Ashot
  1 个评论
Florence Zhu
Florence Zhu 2016-5-25
Thanks, in my case I followed the following steps from Mathwork input to get the problem fixed: (1) Go to the folder where your support packages are installed and go to the openocd-0.8.0 folder. For example, the default is C:\MATLAB\SupportPackages\R2015b\openocd-0.8.0 (2) Open scripts\board\stm32f4discovery.cfg (3) Change source [find interface/stlink-v2.cfg] to source [find interface/stlink-v2-1.cfg] (4) Save and restart MATLAB. Try the example again.

请先登录,再进行评论。


Ashot Melkonyan
Ashot Melkonyan 2016-4-22
Hi QuangHuy and community, I got the same Problem, is there any solution?

jano song
jano song 2016-6-1
编辑:Walter Roberson 2016-6-1
thank you so much,I solved my issue.

Hosam
Hosam 2016-12-19
Hello together,
I use Matlab-R2014a with Hardware Support Packages for STM32F4 Discovery Board. I'm not able to download program to STM32F4 Discovery Board using OpenOCD and simulink. I got the following error-message:
### Launching openOCD server C:\MATLAB\SupportPackages\R2014a\openocd-0.6.1/bin/openocd-0.6.1.exe -f board/stm32f4discovery.cfg: Following error captured during invoking of openOCD server:
Open On-Chip Debugger 0.6.1 (2012-10-07-10:34) Licensed under GNU GPL v2 For bug reports, read <http://openocd.sourceforge.net/doc/doxygen/bugs.html> adapter speed: 1000 kHz srst_only separate srst_nogate srst_open_drain Info : clock speed 1000 kHz Error: open failed in procedure 'transport' in procedure 'init'
"### Done invoking postbuild tool." ### Successful completion of build procedure for model: stm32f4discovery_led4
I installed the driver for ST-Link and ST-Link V2. I can download the program to the board using ST-Link Ultility or Keil.
Could someone please help me? Thank you in advance!

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by