cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 "failed to download Sector[0]" error in DFU download

Spaghetto
Associate III

Hello forum,
i'm working with a custom design where a STM32H743XIH6 is provided on the board along with an USB connection. I'm actually dealing with an issue on USB firmware programming using STM32CubeProgrammer v2.19.0 (up-to-date, but same issue occur with previous versions).

When downloading firmware the following error occurs:

10:34:53 : STM32CubeProgrammer API v2.19.0 | Windows-64Bits
10:34:59 : UR connection mode is defined with the HWrst reset mode
10:34:59 : USB speed : Full Speed (12MBit/s)
10:34:59 : Manuf. ID : STMicroelectronics
10:34:59 : Product ID : DFU in FS Mode
10:34:59 : SN : 200364500000
10:34:59 : DFU protocol: 1.1
10:34:59 : Board : --
10:34:59 : Device ID : 0x0450
10:34:59 : UPLOADING OPTION BYTES DATA ...
10:34:59 : Bank : 0x00
10:34:59 : Address : 0x5200201c
10:34:59 : Size : 308 Bytes
10:34:59 : UPLOADING ...
10:34:59 : Size : 1024 Bytes
10:34:59 : Address : 0x8000000
10:34:59 : Read progress:
10:34:59 : Data read successfully
10:34:59 : Time elapsed during the read operation is: 00:00:00.004
10:35:14 : Opening and parsing file: H7adctest.elf
10:35:14 : Memory Programming ...
10:35:14 : File : H7adctest.elf
10:35:14 : Size : 60.15 KB
10:35:14 : Address : 0x08000000
10:35:14 : Erasing memory corresponding to sector 0:
10:35:14 : Erasing internal memory sector 0
10:35:15 : Erasing memory corresponding to sector 0:
10:35:15 : Not flash Memory : No erase done
10:35:15 : Download in Progress:
10:35:16 : Error: failed to download Sector[0]
10:35:16 : Error: failed to download the File

Error: failed to download the fileError: failed to download the file

Some other test have been given:

  • After giving that error, it look like the board start with a fully functioning behaviour
  • I can succesfully do a "Full chip erase" in "Erasing & Programming" tab
  • I can successfully read the memory
  • Same problem occur downloading .elf and .hex file
  • Randomly (without making any modifications) I got the same error on "Sector[2]"
  • When doing "compare memory with file" i got a "Warning: First difference found at 0x8000000" but, I don't see any difference.

Warning: difference foundWarning: difference found

Thanks in advance for your support,
Luca

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Super User

PavelA_0-1751615578680.png

Normally a firmware image for STM32H743 should not contain anything loaded in RAM areas (like your segment[1], segment[2]).  Check the link script.   CubeProgrammer could handle this better: sanitize the image before programming, ignore 0-size segments... 

 

 

View solution in original post

5 REPLIES 5

Check voltage and capacitors placed on VCAP pins.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi Tesla,
according to design:

Spaghetto_0-1751459820417.png

where C2,C3,C4: "CAP 2.2UF 50V X7R 10%" TAIYO YUDEN UMK212BB7225KG-T.

They seems compliant to datasheet, I'm only in doubt with ESR (which installed ones seems mismatch):

Spaghetto_1-1751459926159.png

I measure a stable 1.01V on all three VCAP pins when in DFU mode, since I use internal regulator it should be ok.

Spaghetto_2-1751460128844.png

Does it makes sense?

Spaghetto
Associate III

Just let me underline that I have no problems downloading the firmware via SWD. 

Tried adding 100nF in parallel to those caps but nothing changed, below the layout is shown.

Could anyone suggest me any more test to be performed?

Thanks in advance

Spaghetto_0-1751613625513.png

 

Pavel A.
Super User

PavelA_0-1751615578680.png

Normally a firmware image for STM32H743 should not contain anything loaded in RAM areas (like your segment[1], segment[2]).  Check the link script.   CubeProgrammer could handle this better: sanitize the image before programming, ignore 0-size segments... 

 

 

Spaghetto
Associate III

Hi @Pavel A. ,
thanks for the hint which, in practice, the pointed out the issue which I've had completely missed.

I fully understand segment[2], since I set up the MPU for an external 8MB SDRAM, I don't understand the segment[1] but I related it to the DMA: since on the STM32H743 I'm using ADC via DMA I had to modify the to modify the linker as suggested on this post (section "GCC linkerscript (*.ld file)").

To omit this section in the hex\elf file I was loading into STM32CubeProgrammer I just appended the "NOLOAD" property to the code suggested and everything started working flawlessly (all the segments disappeared in the Log console).

  .dma_buffer (NOLOAD) : /* Space before ':' is critical */
	{
	  *(.dma_buffer)
	} >RAM_D2

Spaghetto_0-1751617106822.png

Thank you for your help,
Luca