cancel
Showing results for 
Search instead for 
Did you mean: 

OpenOCD failed : stm32f4x.cfg:77: Error: invalid subcommand "newtap stm32f412 cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x4ba00477"

WLou.1660
Associate

Hi experts,

We have created a project on WICED 43xx_Wi-Fi sdk for STM32F412 MCU+43438 wlan chip.

We have connected st-link V2 debugger to the EVB and we could see "STM32 STLink"​ in windows Device Manager.

When we used openOCD to flash debugger to EVB, it would show below error:

Here comes the command and terminal output that we used to programming.

****************************************************************************

C:\Users\wayne\Documents\WICED-Studio-6.3\43xxx_Wi-Fi>tools\OpenOCD\Win32\openocd-all-brcm-libftdi.exe -s tools\OpenOCD\scripts -f tools\OpenOCD\stm32f412discovery.cfg -f tools\OpenOCD\stm32f4x.cfg

Open On-Chip Debugger 0.10.0+dev-00227-g0d15c62 (2018-03-27-15:19)

Licensed under GNU GPL v2

For bug reports, read

    http://openocd.org/doc/doxygen/bugs.html

Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD

adapter speed: 2000 kHz

adapter_nsrst_delay: 100

none separate

srst_only separate srst_nogate srst_open_drain connect_deassert_srst

adapter speed: 1000 kHz

adapter_nsrst_delay: 100

tools\OpenOCD\stm32f4x.cfg:77: Error: invalid subcommand "newtap stm32f412 cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x4ba00477"

in procedure 'script'

at file "embedded:startup.tcl", line 60

in procedure 'jtag' called at file "tools\OpenOCD\stm32f4x.cfg", line 77

****************************************************************************

Please help for clarifying this issue and if need anything information please let me know.

Your help will be appreciated.

Thanks.

BR,

Wayne

1 REPLY 1
Andreas Bolsch
Lead II

Apparently you created 'stm32f412discovery.cfg' yourself? This file should in turn *include* 'stm32f4x.cfg' automatically, no need to specify this on the command line.

The stm32f4x.cfg bundled with openocd sources works fine and uses 'swj_newdap' instead of 'newdap'. So probably you're using (parts of) an older version of openocd mixed with a newer one?

Look at e.g. http://openocd.zylin.com/#/c/4321/7/tcl/board/stm32f412g-disco.cfg, remove the QSPI stuff and use that as a template. But please don't use 'stm32f412discovery.cfg' or similar as file name, as that should be reserved for a plain STM32F412G-Discovery board only. The best way would be to create cfg file specific for your board which just *includes* stm32f412g-disco.cfg and adds the additional stuff for your board extensions.