Skip to main content
PieterInHetBos
Associate II
March 29, 2023
Solved

Problem with STM32G0B0: failed to download Segment[0]

  • March 29, 2023
  • 4 replies
  • 6661 views

I have a Nucleo board with a new MCU, base board is the Nucleo-G070RB. Now it is a ST link with a STM32G0BORE.

I have a problem with the internal bootloader where i cannot upload a new program via USB DFU.

There is no hardware problem because VCP works just fine. No data corruption of something.

I have tried .HEX .BIN and .ELF all have the same problem.

This is the error log is have:

18:04:57 : UR connection mode is defined with the HWrst reset mode

 18:04:57 : USB speed  : Full Speed (12MBit/s)

 18:04:57 : Manuf. ID  : STMicroelectronics

 18:04:57 : Product ID : DFU in FS Mode

 18:04:57 : SN     : 204E315A4630

 18:04:57 : DFU protocol: 1.1

 18:04:57 : Board    : --

 18:04:57 : Device ID  : 0x0467

 18:04:57 : UPLOADING OPTION BYTES DATA ...

 18:04:57 :  Bank     : 0x00

 18:04:57 :  Address    : 0x1fff7800

 18:04:57 :  Size     : 68 Bytes

 18:04:57 :  Bank     : 0x01

 18:04:57 :  Address    : 0x1fff7870

 18:04:57 :  Size     : 4 Bytes

 18:04:57 : UPLOADING ...

 18:04:57 :  Size     : 1024 Bytes

 18:04:57 :  Address    : 0x8000000

 18:04:57 : Read progress:

 18:04:57 : Data read successfully

 18:04:57 : Time elapsed during the read operation is: 00:00:00.031

 18:05:05 : Memory Programming ...

 18:05:05 : Opening and parsing file: g0b0test.hex

 18:05:05 :  File     : g0b0test.hex

 18:05:05 :  Size     : 42.56 KB 

 18:05:05 :  Address    : 0x08000000 

 18:05:05 : Erasing memory corresponding to segment 0:

 18:05:05 : Not flash Memory : No erase done

 18:05:05 : File segment @0x08000000 is not 255-bytes aligned. It will be aligned to @0x07FFFFF8

 18:05:05 : Download in Progress:

 18:05:05 : Error: failed to download Segment[0]

 18:05:05 : Error: failed to download the File

 18:05:05 : RUNNING Program ... 

 18:05:05 :  Address:   : 0x08000000

 18:05:05 : Start operation achieved successfully

 18:05:06 : Warning: Connection to device 0x467 is lost

 18:05:06 : Disconnected from device.

This topic has been closed for replies.
Best answer by Imen.D

Hi @PieterInHetBos,

Can you please check Option Byte setting?

Try this workaround: Force to erase 'entire flash' memory, before start debugging.

Can you please share the Option Bytes parameters and the log file, in order to investigate the issue.

4 replies

Technical Moderator
March 30, 2023

Hello @PieterInHetBos​ and welcome to the Community :)

Could you please try to use STM32CubeProgrammer on standalone.

Make sure to use latest release of CubeProgrammer, and try to upgrade ST-LINK firmware.

Check the registers and ensure that “flash empty�? is not causing such issue.

I advise you to erase the flash memory first.

Imen

"When your question is answered, please close this topic by clicking ""Accept as Solution"".ThanksImen"
Piranha
Principal III
March 30, 2023

A code, which expects a 255-byte alignment, is definitely broken:

https://community.st.com/s/question/0D53W00002CMICqSAP/stm32cubeprogrammer-213-bugs

Senior III
March 30, 2023

Hi Imen,

It seems that the 0x467 loader is really broken. The bigger problem is that CubeIDE is also relying on it to load the program before debugging, and it is now impossible on some of the G0 devices.

This must be fixed as soon as possible...

Best regards,

Kraal

Technical Moderator
April 5, 2023

Hi @Kraal​, Hi @PieterInHetBos​ ,

Our team is very aware of this issue now and working to fix this in the coming release.

An internal ticket ID 149042 is submitted in order to improve the tool.

(PS: ID 149042 This is an internal tracking number and is not accessible or usable by customers).

Imen

"When your question is answered, please close this topic by clicking ""Accept as Solution"".ThanksImen"
PieterInHetBos
Associate II
April 18, 2023

Dear Imen,

Any luck on a update?

Technical Moderator
April 18, 2023

Hi @PieterInHetBos​ ,

The fix is integrated and will be published in the STM32Cubeprogrammer v2.14.0.

But, for the moment I can't give you any information about delivery date.

Imen

"When your question is answered, please close this topic by clicking ""Accept as Solution"".ThanksImen"
Technical Moderator
February 2, 2024

Hi @PieterInHetBos

Please share the log file and which board used.

"When your question is answered, please close this topic by clicking ""Accept as Solution"".ThanksImen"
PieterInHetBos
Associate II
February 2, 2024

Hi @Imen.D 

I could not repoduce the issue so i am sure it was a skill issue