cancel
Showing results for 
Search instead for 
Did you mean: 

How to program the stm32F7xx flash via jtag and openocd?

Franzi.Edo
Senior
Posted on November 14, 2015 at 12:13

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

4 REPLIES 4
Uwe Bonnes
Principal II
Posted on November 14, 2015 at 13:37

Remi and me did some work around F7 with patches hanging in the queue for some time.  The patches got applied recently. So try OpenOCD git head. Let us know if there are loose ends.

Bye

Franzi.Edo
Senior
Posted on November 14, 2015 at 14:06

Thank's Uwe,

I will try again your last openocd commit.

I will keep you in touch, thank's

Regards, Edo

Franzi.Edo
Senior
Posted on November 14, 2015 at 15:07

Uwe,

Just tried your suggestion.

I downloaded the last openocd from the git

git clone git://git.code.sf.net/p/openocd/code openocd

Unfortunately, I got exactly the same log I posted.

Did you already tried to burn the flash of the F7 by JTAG-openocd?

Edo

Uwe Bonnes
Principal II
Posted on November 14, 2015 at 18:20

Please take the discussion to the openocd-user mailing list. The forum software here drives me nuts. I just uploaded an executable to the F7 disco board via the built-in stlink v2.1 and openocd git master.

Did you really use the new compiled executable? Was was your command line? Did the F7 get recognized? What was the terminal output? Any hints in a -d3 debug log?