AnsweredAssumed Answered

How to program the stm32F7xx flash via jtag and openocd?

Question asked by franzi.edo on Nov 14, 2015
Latest reply on Nov 14, 2015 by Uwe Bonnes
Hi, 
I have an hardware with a stm32F7xx and an FTDI chip (4232) that controls the JTAG. I would like to program the flash of the stm32F7xx via openocd (this procedure is really straightforward for the previous stm32F4xx). Impossible to program this flash. In the openocd community the activity around this stm32F7xx is really poor. For hardware reason I cannot use J-Link.
So, any experience around this topic? Just as a complement of information:
1. I patch openocd-0.9.0 with some proposed improvements for supporting the stm32F7xx flash
2. here is my openocd script (that works like a charme for the stm32F4xx)

interface ftdi
ftdi_vid_pid 0x0403 0x6011
ftdi_channel 1
ftdi_layout_init 0x0008 0x000b

source [find target/stm32f7x.cfg]
init
reset halt
sleep 1000
stm32f2x mass_erase 0
flash write_image ./EPROM.elf
reset run
shutdown

Thank you for your feedbacks
  Edo.

Here is the log

Open On-Chip Debugger 0.10.0-dev-00104-gf3be0f6 (2015-11-12-22:41)
Licensed under GNU GPL v2
For bug reports, read
     http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
cortex_m reset_config sysresetreq
Info : clock speed 2000 kHz
Info : JTAG tap: stm32f7x.cpu tap/device found: 0x5ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x5)
Info : JTAG tap: stm32f7x.bs tap/device found: 0x06449041 (mfg: 0x020, part: 0x6449, ver: 0x0)
Warn : JTAG tap: stm32f7x.bs       UNEXPECTED: 0x06449041 (mfg: 0x020, part: 0x6449, ver: 0x0)
Error: JTAG tap: stm32f7x.bs  expected 1 of 1: 0x06449071 (mfg: 0x038, part: 0x6449, ver: 0x0)
Error: Trying to use configured scan chain anyway...
Warn : Bypassing JTAG setup events due to errors
Info : stm32f7x.cpu: hardware has 8 breakpoints, 4 watchpoints
Error: stm32f7x.cpu -- clearing lockup after double fault
Polling target stm32f7x.cpu failed, trying to reexamine
Info : stm32f7x.cpu: hardware has 8 breakpoints, 4 watchpoints
Error: Can't assert SRST: nSRST signal is not defined
Info : JTAG tap: stm32f7x.cpu tap/device found: 0x5ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x5)
Info : JTAG tap: stm32f7x.bs tap/device found: 0x06449041 (mfg: 0x020, part: 0x6449, ver: 0x0)
Warn : JTAG tap: stm32f7x.bs       UNEXPECTED: 0x06449041 (mfg: 0x020, part: 0x6449, ver: 0x0)
Error: JTAG tap: stm32f7x.bs  expected 1 of 1: 0x06449071 (mfg: 0x038, part: 0x6449, ver: 0x0)
Error: Trying to use configured scan chain anyway...
Warn : Bypassing JTAG setup events due to errors
Error: Can't assert SRST: nSRST signal is not defined
stm32f7x.cpu: target state: halted
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0x01000003 pc: 0xfffffffe msp: 0xffffffd8
Info : device id = 0x10016449
Info : flash size = 1024kbytes
stm32x mass erase complete
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
Error: MEM_AP_CSW 0x2800062, MEM_AP_TAR 0x20000054
Error: Failed to read memory at 0x20000054
Error: failed to get read pointer
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
Error: MEM_AP_CSW 0x2800062, MEM_AP_TAR 0x20000050
Warn : target was in unknown state when halt was requested
Error: stm32f7x.cpu -- clearing lockup after double fault
Error: error waiting for target flash write algorithm
Error: error writing to flash at address 0x08000000 at offset 0x00000000







Outcomes