[<<][arm][>>][..]
Wed Oct 29 17:16:31 EDT 2014

Can't connect after flashing bad code + FIX


Now I get:


[master] tom@zoo:~/armdev/stm32f103$ ./openocd 
Open On-Chip Debugger 0.8.0 (2014-10-29-15:46)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m reset_config sysresetreq
Info : clock speed 1000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: stm32f103c8t6.cpu: IR capture error; saw 0x0f not 0x01
Warn : Bypassing JTAG setup events due to errors
Warn : Invalid ACK 0x7 in JTAG-DP transaction



When holding reset it does come up properly.


[master] tom@zoo:~/pub/git/armdev/stm32f103$ ./openocd 
Open On-Chip Debugger 0.5.0 (2011-08-09-08:45)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.berlios.de/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m3 reset_config sysresetreq
100 kHz
Info : clock speed 100 kHz
Info : JTAG tap: stm32f103c8t6.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f103c8t6.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
Info : stm32f103c8t6.cpu: hardware has 6 breakpoints, 4 watchpoints

When releasing reset:

Warn : Invalid ACK 0x7 in JTAG-DP transaction
Polling target stm32f103c8t6.cpu failed, GDB will be halted. Polling again in 100ms

When pressing reset:

Polling target stm32f103c8t6.cpu succeeded again


This started happening after uploading something.

Keeping the reset button pressed:

(gdb) connect
Polling target stm32f103c8t6.cpu succeeded again
Info : accepting 'gdb' connection from 3333
Info : device id = 0x20036410
Warn : STM32 flash size failed, probe inaccurate - assuming 128k flash
Info : flash size = 128kbytes
undefined debug reason 7 - target needs reset

(gdb) mon reset
Info : JTAG tap: stm32f103c8t6.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32f103c8t6.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)



So this worked:
- physically hold target in reset
- start openocd
- start gdb  (possibly with .elf)
- issue "mon halt" then release physical reset
=> target is halted and can be programmed.

I just erased the flash[1] and now it connects properly.

(gdb) mon flash erase_address  0x08000000 0x00020000
erased address 0x08000000 (length 131072) in 0.026083s (4907.411 KiB/s)


Tried again - didn't work.

With BOOT0=1 and BOOT1=1

(gdb) mon flash banks
#0 : stm32f103c8t6.flash (stm32f1x) at 0x08000000, size 0x00010000, buswidth 0, chipwidth 0
(gdb) mon flash erase_address  0x08000000 0x00010000
erased address 0x08000000 (length 65536) in 0.024643s (2597.086 KiB/s)


[1] http://openocd.sourceforge.net/doc/html/Flash-Commands.html




[Reply][About]
[<<][arm][>>][..]