cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F767ZGT6 board cannot be reliably erased/programmed and run

Zhiyong Li
Associate II

Hi

One of a small production batch of our boards built around STM32F767ZGT6 has some bizarre behavior. When we tried to program it with STM32CubeProgrammer and a ST-LINK/V2 tool, occasionally we can download a test firmware, but if we power cycle the board, more often than not, we would not be able to download the same firmware again nor to perform a full chip erase. Please see the log below:

21:17:34 : Disconnected from device.
21:17:35 : UR connection mode is defined with the HWrst reset mode
21:17:35 : ST-LINK SN  : 53FF6E064980555733371287
21:17:35 : ST-LINK FW  : V2J45S7
21:17:35 : Board       : --
21:17:35 : Voltage     : 3.20V
21:17:35 : SWD freq    : 4000 KHz
21:17:35 : Connect mode: Under Reset
21:17:35 : Reset mode  : Hardware reset
21:17:35 : Device ID   : 0x451
21:17:35 : Revision ID : Rev Z
21:17:35 : Debug in Low Power mode is not supported for this device.
21:17:36 : UPLOADING OPTION BYTES DATA ...
21:17:36 :   Bank          : 0x00
21:17:36 :   Address       : 0x40023c14
21:17:36 :   Size          : 8 Bytes
21:17:36 : UPLOADING ...
21:17:36 :   Size          : 8192 Bytes
21:17:36 :   Address       : 0x8000000
21:17:36 : Read progress:
21:17:36 : Data read successfully
21:17:36 : Time elapsed during the read operation is: 00:00:00.063
21:17:39 : Opening and parsing file: stm32f767-board-test-v1.hex
21:17:39 : Memory Programming ...
21:17:39 :   File          : stm32f767-board-test-v1.hex
21:17:39 :   Size          : 688.88 KB 
21:17:39 :   Address       : 0x00200000 
21:17:39 : Erasing memory corresponding to sector 0:
21:17:39 : Erasing internal memory sectors [0 4]
21:17:40 : Erasing memory corresponding to sector 0:
21:17:40 : Erasing internal memory sectors [4 17]
21:17:41 : Error: failed to erase memory
21:17:41 : Error: failed to erase memory
21:18:01 : Disconnected from device.
21:18:01 : UR connection mode is defined with the HWrst reset mode
21:18:01 : ST-LINK SN  : 53FF6E064980555733371287
21:18:01 : ST-LINK FW  : V2J45S7
21:18:01 : Board       : --
21:18:01 : Voltage     : 3.20V
21:18:01 : SWD freq    : 4000 KHz
21:18:01 : Connect mode: Under Reset
21:18:01 : Reset mode  : Hardware reset
21:18:01 : Device ID   : 0x451
21:18:01 : Revision ID : Rev Z
21:18:01 : Debug in Low Power mode is not supported for this device.
21:18:01 : UPLOADING OPTION BYTES DATA ...
21:18:01 :   Bank          : 0x00
21:18:01 :   Address       : 0x40023c14
21:18:01 :   Size          : 8 Bytes
21:18:01 : UPLOADING ...
21:18:01 :   Size          : 8192 Bytes
21:18:01 :   Address       : 0x8000000
21:18:01 : Read progress:
21:18:01 : Data read successfully
21:18:01 : Time elapsed during the read operation is: 00:00:00.063
21:18:03 : Opening and parsing file: stm32f767-board-test-v1.hex
21:18:03 : Memory Programming ...
21:18:03 :   File          : stm32f767-board-test-v1.hex
21:18:03 :   Size          : 688.88 KB 
21:18:03 :   Address       : 0x00200000 
21:18:03 : Erasing memory corresponding to sector 0:
21:18:03 : Erasing internal memory sectors [0 4]
21:18:03 : Error: failed to erase memory
21:18:03 : Error: failed to erase memory
21:18:06 : Disconnected from device.
21:25:44 : UR connection mode is defined with the HWrst reset mode
21:25:44 : ST-LINK SN  : 53FF6E064980555733371287
21:25:44 : ST-LINK FW  : V2J45S7
21:25:44 : Board       : --
21:25:44 : Voltage     : 3.20V
21:25:44 : SWD freq    : 4000 KHz
21:25:44 : Connect mode: Under Reset
21:25:44 : Reset mode  : Hardware reset
21:25:44 : Device ID   : 0x451
21:25:44 : Revision ID : Rev Z
21:25:44 : Debug in Low Power mode is not supported for this device.
21:25:44 : UPLOADING OPTION BYTES DATA ...
21:25:44 :   Bank          : 0x00
21:25:44 :   Address       : 0x40023c14
21:25:44 :   Size          : 8 Bytes
21:25:44 : UPLOADING ...
21:25:44 :   Size          : 8192 Bytes
21:25:44 :   Address       : 0x8000000
21:25:44 : Read progress:
21:25:44 : Data read successfully
21:25:44 : Time elapsed during the read operation is: 00:00:00.054
21:25:49 : MASS ERASE ... 
21:25:56 : Mass erase successfully achieved
21:25:56 : UPLOADING ...
21:25:56 :   Size          : 8192 Bytes
21:25:56 :   Address       : 0x8000000
21:25:56 : Read progress:
21:25:57 : Data read successfully
21:25:57 : Time elapsed during the read operation is: 00:00:00.062
21:26:00 : Opening and parsing file: stm32f767-board-test-v1.hex
21:26:00 : Memory Programming ...
21:26:00 :   File          : stm32f767-board-test-v1.hex
21:26:00 :   Size          : 688.88 KB 
21:26:00 :   Address       : 0x00200000 
21:26:00 : Erasing memory corresponding to sector 0:
21:26:00 : Erasing internal memory sectors [0 4]
21:26:01 : Erasing memory corresponding to sector 0:
21:26:01 : Erasing internal memory sectors [4 17]
21:26:06 : Download in Progress:
21:26:14 : File download complete
21:26:14 : Time elapsed during download operation: 00:00:14.327
21:26:43 : Disconnected from device.
21:26:45 : UR connection mode is defined with the HWrst reset mode
21:26:45 : ST-LINK SN  : 53FF6E064980555733371287
21:26:45 : ST-LINK FW  : V2J45S7
21:26:45 : Board       : --
21:26:45 : Voltage     : 3.20V
21:26:45 : SWD freq    : 4000 KHz
21:26:45 : Connect mode: Under Reset
21:26:45 : Reset mode  : Hardware reset
21:26:45 : Device ID   : 0x451
21:26:45 : Revision ID : Rev Z
21:26:45 : Debug in Low Power mode is not supported for this device.
21:26:45 : UPLOADING OPTION BYTES DATA ...
21:26:45 :   Bank          : 0x00
21:26:45 :   Address       : 0x40023c14
21:26:45 :   Size          : 8 Bytes
21:26:45 : UPLOADING ...
21:26:45 :   Size          : 8192 Bytes
21:26:45 :   Address       : 0x8000000
21:26:45 : Read progress:
21:26:45 : Data read successfully
21:26:45 : Time elapsed during the read operation is: 00:00:00.053
21:26:47 : Opening and parsing file: stm32f767-board-test-v1.hex
21:26:47 : Memory Programming ...
21:26:47 :   File          : stm32f767-board-test-v1.hex
21:26:47 :   Size          : 688.88 KB 
21:26:47 :   Address       : 0x00200000 
21:26:47 : Erasing memory corresponding to sector 0:
21:26:47 : Erasing internal memory sectors [0 4]
21:26:48 : Erasing memory corresponding to sector 0:
21:26:48 : Erasing internal memory sectors [4 17]
21:26:53 : Download in Progress:
21:27:00 : File download complete
21:27:00 : Time elapsed during download operation: 00:00:13.937
21:27:07 : Disconnected from device.
21:27:12 : UR connection mode is defined with the HWrst reset mode
21:27:13 : ST-LINK SN  : 53FF6E064980555733371287
21:27:13 : ST-LINK FW  : V2J45S7
21:27:13 : Board       : --
21:27:13 : Voltage     : 3.20V
21:27:13 : SWD freq    : 4000 KHz
21:27:13 : Connect mode: Under Reset
21:27:13 : Reset mode  : Hardware reset
21:27:13 : Device ID   : 0x451
21:27:13 : Revision ID : Rev Z
21:27:13 : Debug in Low Power mode is not supported for this device.
21:27:13 : UPLOADING OPTION BYTES DATA ...
21:27:13 :   Bank          : 0x00
21:27:13 :   Address       : 0x40023c14
21:27:13 :   Size          : 8 Bytes
21:27:13 : UPLOADING ...
21:27:13 :   Size          : 8192 Bytes
21:27:13 :   Address       : 0x8000000
21:27:13 : Read progress:
21:27:13 : Data read successfully
21:27:13 : Time elapsed during the read operation is: 00:00:00.054
21:27:16 : Opening and parsing file: stm32f767-board-test-v1.hex
21:27:16 : Memory Programming ...
21:27:16 :   File          : stm32f767-board-test-v1.hex
21:27:16 :   Size          : 688.88 KB 
21:27:16 :   Address       : 0x00200000 
21:27:16 : Erasing memory corresponding to sector 0:
21:27:16 : Erasing internal memory sectors [0 4]
21:27:17 : Erasing memory corresponding to sector 0:
21:27:17 : Erasing internal memory sectors [4 17]
21:27:17 : Error: failed to erase memory
21:27:17 : Error: failed to erase memory
21:27:25 : MASS ERASE ... 
21:27:25 : Error: Mass erase operation failed.Please verify flash protection

Given the same firmware was able to run and do what it is designed to do on other boards from the same batch, I don't think the firmware itself is doing something out of line on this particular board. More likely there is some hardware issue with this board. Given the behavior described here, can someone offer a pointer to what could be the hardware issue and if there is some way the board can be salvaged?

Thanks.

3 REPLIES 3
Zhiyong Li
Associate II

I measured the voltage on VCAP1/2, both are reliably at 1.2V, and BOOT0 is reliably pulled to GND. Also PDR_ON is connected to VCC(3.3V). Hope this will help understand the issue.

Andrew Neil
Super User

@Zhiyong Li wrote:

More likely there is some hardware issue with this board. 


So please post your schematics & layout.

Some good, clear photos would also help.

 

How is your ST-Link connected? Are you sure it's genuine?

How to recognize a genuine ST-LINK/V2 versus a cloned one

 

How to write your question to maximize your chances to find a solution 

 

PS:

Is your hardware design in accordance with AN4661Getting started with STM32F7 Series MCU hardware development  ?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

The F767 family are not exactly low-power devices, so layout and component placement are probably crucial.
I'm not a hardware designer, but perhaps some experienced users or ST staff can look at it.

The description sounds like the design is "borderline critical".
Flashing usually happens with HSI and default settings, i.e. low clock speeds.
I would try some "working boards" with simple test programs at the intended full target clock speed.