Error: jtag status contains invalid mode value - communication failure
Hello,
I use SW on Mac. I have custom board with STM32F405RGT. In Cube I set SYS/Debug to “Serial Wire”. Reset mode set “Connect under reset”.
Once I try to run it via ST Link v2 programmer, I’m getting following error:
------
Open On-Chip Debugger 0.10.0-dev-00010-g96aab7b (2018-07-13-06:43)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter_nsrst_delay: 100
adapter speed: 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v28 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : vid/pid are not identical: 0x0483/0x374B 0x0483/0x3748
Info : using stlink api v2
Info : Target voltage: 3.251715
Info : Stlink adapter speed set to 1800 kHz
Info : STM32F405RGTx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Stlink adapter speed set to 1800 kHz
adapter speed: 1800 kHz
Error: jtag status contains invalid mode value - communication failure
TARGET: STM32F405RGTx.cpu - Not halted
in procedure ‘program’
in procedure ‘reset’ called at file “embedded:startup.tcl”, line 490
in procedure ‘ocd_bouncer’
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target STM32F405RGTx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
- Unable to reset target **
shutdown command invoked
------
At the same time I’m able to upload firmware by st-flash utility:
------
> st-info --probe
Found 1 stlink programmers
serial: 383f70064d55343259280943
openocd: “\x38\x3f\x70\x06\x4d\x55\x34\x32\x59\x28\x09\x43”
flash: 1048576 (pagesize: 16384)
sram: 196608
chipid: 0x0413
descr: F4 device
> st-flash --format ihex write black-pill.hex
st-flash 1.3.0
2018-10-25T10:00:28 INFO /Users/jerry/Downloads/stlink-master/src/common.c: Loading device parameters....
2018-10-25T10:00:28 INFO /Users/jerry/Downloads/stlink-master/src/common.c: Device connected is: F4 device, id 0x10076413
2018-10-25T10:00:28 INFO /Users/jerry/Downloads/stlink-master/src/common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 16384 bytes
2018-10-25T10:00:28 INFO /Users/jerry/Downloads/stlink-master/src/common.c: Attempting to write 4744 (0x1288) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08000000 erased
2018-10-25T10:00:28 INFO /Users/jerry/Downloads/stlink-master/src/common.c: Finished erasing 1 pages of 16384 (0x4000) bytes
2018-10-25T10:00:28 INFO /Users/jerry/Downloads/stlink-master/src/common.c: Starting Flash write for F2/F4/L4
2018-10-25T10:00:28 INFO /Users/jerry/Downloads/stlink-master/src/flash_loader.c: Successfully loaded flash loader in sram
enabling 32-bit flash writes
size: 4744
2018-10-25T10:00:28 INFO /Users/jerry/Downloads/stlink-master/src/common.c: Starting verification of write complete
2018-10-25T10:00:28 INFO /Users/jerry/Downloads/stlink-master/src/common.c: Flash written and verified! jolly good!
------
Could you point me what’s wrong with SW setup?