cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE v1.8 fails to connect to OpenOCD with error message: Could not verify ST device!

p69
Associate

I need to write code using STM32CubeIDE for the STM32F407ZG on the STM32-E407 dev board from Olimex. The dev board is connected to the PC running windows 10 via the Olimex ARM-USB-OCD-H Jtag debugger.  

I installed the drivers (WinUSB (v6.1.7600.16385)) for the ARM-USB-OCD-H using Zadig, then run openocd (openocd-0.9.0-rc1).

0693W00000HrU1wQAF.png 

To test it, I created and built a simple program using STM32CubeIDE. In another terminal, I run arm-none-eabi-gdb.exe. I can connect to the openocd and program the board. 

0693W00000HrU3xQAF.pngEverything is working so far.

But when I loaded it using STM32CubeIDE (Version: 1.8.0, Build: 11526_20211125_0815 (UTC), I got this error: Could not verify ST device!

 0693W00000HrU4HQAV.pngOpenOCD reported that: invalid command name "WriteDP�? 

This is my debug configuration settings: 

0693W00000HrU0jQAF.pngUsing STM32CubeIDE version 1.6 and with the same settings and same program, I can load and debug the program. 

I really want to use the latest STM32CubeIDE. Any help appreciated.

4 REPLIES 4
Markus GIRDLAND
ST Employee

Hello there!

It seems that OpenOCD is unable to detect the device correctly, perhaps due to the set-up you are using.

I'm not sure if it would work but you could try to use a custom "User Defined" script and then use STs own ST_scripts cfg files to have the DP_write, DP_read, AP_rd and AP_wr routines that can be found in the mon_cmd_extension.cfg files that is sourced from another cfg file.

That might be able to get around the issue, let me know if it works or not!

Hi Markus,

Thanks for your reply.

But sorry I can't follow your instructions. How to create and use a custom script? Is there an example?

Thanks,

Paul.

Search for mon_cmd_extension.cfg in your STM32Cube installation.

Copy the definitions of those commands into your own OpenOCD script (you might be able to just -f the ST script, but the paths would get messy really quickly).

I encountered the same bug as you - spent a while reimplementing those commands manually before finding out that ST already implemented them.

Just make sure that your debug adapter driver provides DAP access.

Hi. Did you solve the problem? I have same problem and I couldn't solve.