cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeProgrammer upload fail after update to 2.20

PKola.1
Associate III

After update to the latest Cubu Programmer v2.20 a get this error when uploading the firmware:

11:29:37 : Opening and parsing file: 1000BASET1-MC-ETH v1.3.hex
11:29:37 : Memory Programming ...
11:29:37 : File : 1000BASET1-MC-ETH v1.3.hex
11:29:37 : Size : 56.78 KB
11:29:37 : Address : 0x08000000
11:29:37 : Erasing memory corresponding to segment 0:
11:29:37 : Erasing internal memory sectors [0 28]
11:29:38 : Erasing memory corresponding to segment 1:
11:29:38 : Error: Sector size: 0x00000008 Bytes is out of range
11:29:38 : Error: failed to erase memory

In previous version (2.19) it works correctly.

MCU: STM32G473RBT6
Thanks

8 REPLIES 8
TDK
Super User

Should work, but how did you generate the HEX file? Does it have non-contiguous regions?

Perhaps try with the BIN or ELF file instead.

If you feel a post has answered your question, please click "Accept as Solution".
PKola.1
Associate III

Unfortunately, neither the BIN nor the ELF is working. Both worked in the previous version.

14:32:34 : Erasing memory corresponding to segment 0:
14:32:34 : Erasing internal memory sectors [0 28]
14:32:35 : Erasing memory corresponding to segment 1:
14:32:35 : Error: Operation exceeds memory limits
14:32:35 : Error: failed to erase memory
14:32:47 : Number of partitions: C:\Users\petr_kolar\Desktop\repos mach\Automotive Ethernet\1000base-t1-media-converter\NoBootloader\1000BASET1-MC-ETH.bin
14:32:47 : Number of segments: 1
14:32:47 : segment[0]: address= 0x0, size= 0x1DFE2
14:32:52 : Opening and parsing file: 1000BASET1-MC-ETH.bin
14:32:52 : Memory Programming ...
14:32:52 : File : 1000BASET1-MC-ETH.bin
14:32:52 : Size : 119.97 KB
14:32:52 : Address : 0x08000000
14:32:52 : Erasing memory corresponding to segment 0:
14:32:52 : Error: Operation exceeds memory limits
14:32:53 : Error: failed to erase memory

Same for ELF

TDK
Super User

Are option bytes configured for dual bank? DBANK bit.

 

Your BIN file is twice the size of your HEX file?


> 11:29:37 : File : 1000BASET1-MC-ETH v1.3.hex
> 11:29:37 : Size : 56.78 KB

 

> 14:32:52 : File : 1000BASET1-MC-ETH.bin
> 14:32:52 : Size : 119.97 KB

 

Seems like a bug. Maybe someone used 1000 instead of 1024 in the code.

If you feel a post has answered your question, please click "Accept as Solution".
PKola.1
Associate III


> Are option bytes configured for dual bank? DBANK bit.

Yes, DBANK is set.

> Your BIN file is twice the size of your HEX file?

The BIN file includes all address space, making it larger. The HEX file is sparse, containing only used regions. This has always worked until version 2.20. The files are generated by STM32CubeIDE. 



PKola.1
Associate III

@Aziz BRIGUI here is the hex file named as .txt you can try it. 

Jbin0101
Associate II

I'm having the same problems too. Just updated to the newest cubeIDE, and now I can't program my micro because the compiler complains of a lack of memory space. STM32G474RB.

image.png

 

image.png

 

Not close to filling up the flash, so I'm extremely confused what changed. 

I also tried switching back to an older revision of the software I'm working on, that i KNOW compiled and uploaded before. It also now fails with the same error.


Edit:::

yep, can confirm it's stm32cubeprogrammer related. I swapped the unpacked older version 2.2.1 into the new 2.2.200 folder, and now I can program again. So something's amiss with cubeprogrammer.

STOne-32
ST Employee

Dear @PKola.1 @Jbin0101  @TDK ,

Thank you for the feedback on this change on CubeProgrammer extra checking out of boundaries. well noted and this is an internal number for Tracking #215054, our teams will be back to You.

Ciao

STOne-32.

Maryem
ST Employee

Hello,

Apologies for the delay in my response.

This issue is related to the dual-bank flash memory layout of STM32G4 devices with 128 KB flash. For these devices, Bank 2 starts at address 0x08040000, which is separate from Bank 1 (starting at 0x08000000 and ending at 0x0800FFFF). This means the flash memory is split into two separate areas, not one continuous block.

@PKola.1, your shared hex file contains a segment at address 0x0801DFE0, which is not valid for the STM32G4 with 128 KB, as it falls outside the expected flash memory regions.

To properly download the full memory for this device with DBANK enabled, you need to either use two separate 64 KB binary files (one for each bank) or create a hex file with two separate segments matching each bank’s address. Please note that this is the expected behavior of the tool.

 

Maryem.


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.