Skip to main content
CHoog.1
Associate II
April 8, 2024
Question

Problem with STM32CubeProgrammer version 2.16.0 and STM32G0B1xx USB DFU

  • April 8, 2024
  • 8 replies
  • 3332 views

Hello, there is a problem with programming STM32G0Bxx/B1xx/C1xx using  STM32CubeProgrammer version 2.16.0 

A have a HEX file starting at address 0x8001800 and with length 0x32800.

When programming this using USB DFU, the tool first starts to erase some of the sectors first.

Which is what i expect. Only the number of sectors and the address go wrong. See part of log of the tool:

"14:38:58 : Size : 202.00 KB
14:38:58 : Address : 0x08001800
14:38:58 : Erasing memory corresponding to segment 0:
14:38:58 : Erasing internal memory sectors [1 51]
14:38:58 : erasing sector 0001 @: 0x08000800 done
14:38:58 : erasing sector 0002 @: 0x08001000 done"

As the sector size is 2K for this MCU type, it should erase sector 3 to 103 (or 102)!

And it should start at address 0x80001800!

Please fix asap.

Something similar was already reported by my colleague.

 

Thanks,

Regards,

Corné

8 replies

Joe WILLIAMS
ST Employee
April 24, 2024

Hi CHoog.1

This post has been escalated to the ST Online Support Team for additional assistance.  We'll contact you directly.

Kind Regards

Joe WILLIAMS

STMicro Support

STTwo-32
Technical Moderator
April 26, 2024

Hello @CHoog.1 

Sorry for the late replay. I'm not able to reproduce this behavior on my side (with both GUI and CLI):

STTwo32_0-1714113431878.png

Could you please share your .hex file and your device ID so that we can test it.

Best Regards.

STTwo-32

Graduate
May 6, 2024

Bumb, We see the same problem with our firmware...

 

Lets get a fix quickly please..

STTwo-32
Technical Moderator
May 6, 2024

Can you give more details and share your .hex file and the MCU that you are using.

Best Regards. 

STTwo-32

CHoog.1
CHoog.1Author
Associate II
May 13, 2024

STM32G0B1KC is the exact type of the MCU i am using.

When programming a hex file, not starting at 0x8000000 you immediately see the problem with the erases send before the actual programming starts.

Also when just easing individual sectors, you see an error in the calculation of the 'Progam Counter' as the value is called. The value send with the FDU_DOWNLOAD command with wValue = 0 is calculated wrong.

And maybe there is something wrong with the size of the sector. The flash sector size of this MCU is just 2Kbyte.

Not the 4K as shown on that Erase & Programming menu.

 

 

CHoog.1
CHoog.1Author
Associate II
May 13, 2024
18:07:45 : Device ID : 0x0467
 18:07:45 : UPLOADING OPTION BYTES DATA ...
 18:07:45 : Bank : 0x00
 18:07:45 : Address : 0x1fff7800
 18:07:45 : Size : 68 Bytes
 18:07:45 : Bank : 0x01
 18:07:45 : Address : 0x1fff7870
 18:07:45 : Size : 4 Bytes
 18:07:45 : UPLOADING ...
 18:07:45 : Size : 1024 Bytes
 18:07:45 : Address : 0x8000000
 18:07:45 : Read progress:
 18:07:45 : Data read successfully
 18:07:45 : Time elapsed during the read operation is: 00:00:00.003
 18:10:54 : Memory Programming ...
 18:10:54 : Opening and parsing file: DP_FX7_Debug_enc.hex
 18:10:54 : File : DP_FX7_Debug_enc.hex
 18:10:54 : Size : 200.00 KB 
 18:10:54 : Address : 0x08002000 
 18:10:54 : Erasing memory corresponding to segment 0:
 18:10:54 : Erasing internal memory sectors [2 51]
 18:10:54 : erasing sector 0002 @: 0x08001000 done
 18:10:54 : erasing sector 0003 @: 0x08001800 done
 18:10:54 : erasing sector 0004 @: 0x08002000 done
 18:10:54 : erasing sector 0005 @: 0x08002800 done
 18:10:54 : erasing sector 0006 @: 0x08003000 done
 18:10:54 : erasing sector 0007 @: 0x08003800 done
 18:10:54 : erasing sector 0008 @: 0x08004000 done
 18:10:54 : erasing sector 0009 @: 0x08004800 done
 18:10:54 : erasing sector 0010 @: 0x08005000 done
 18:10:54 : erasing sector 0011 @: 0x08005800 done
 18:10:54 : erasing sector 0012 @: 0x08006000 done
 18:10:54 : erasing sector 0013 @: 0x08006800 done
 18:10:54 : erasing sector 0014 @: 0x08007000 done
 18:10:54 : erasing sector 0015 @: 0x08007800 done
 18:10:54 : erasing sector 0016 @: 0x08008000 done
 18:10:54 : erasing sector 0017 @: 0x08008800 done
 18:10:54 : erasing sector 0018 @: 0x08009000 done
 18:10:54 : erasing sector 0019 @: 0x08009800 done
 18:10:54 : erasing sector 0020 @: 0x0800a000 done
 18:10:54 : erasing sector 0021 @: 0x0800a800 done
 18:10:54 : erasing sector 0022 @: 0x0800b000 done
 18:10:54 : erasing sector 0023 @: 0x0800b800 done
 18:10:54 : erasing sector 0024 @: 0x0800c000 done
 18:10:54 : erasing sector 0025 @: 0x0800c800 done
 18:10:54 : erasing sector 0026 @: 0x0800d000 done
 18:10:54 : erasing sector 0027 @: 0x0800d800 done
 18:10:54 : erasing sector 0028 @: 0x0800e000 done
 18:10:54 : erasing sector 0029 @: 0x0800e800 done
 18:10:54 : erasing sector 0030 @: 0x0800f000 done
 18:10:54 : erasing sector 0031 @: 0x0800f800 done
CHoog.1
CHoog.1Author
Associate II
May 13, 2024
 18:10:54 : erasing sector 0032 @: 0x08010000 done
 18:10:54 : erasing sector 0033 @: 0x08010800 done
 18:10:54 : erasing sector 0034 @: 0x08011000 done
 18:10:54 : erasing sector 0035 @: 0x08011800 done
 18:10:55 : erasing sector 0036 @: 0x08012000 done
 18:10:55 : erasing sector 0037 @: 0x08012800 done
 18:10:55 : erasing sector 0038 @: 0x08013000 done
 18:10:55 : erasing sector 0039 @: 0x08013800 done
 18:10:55 : erasing sector 0040 @: 0x08014000 done
 18:10:55 : erasing sector 0041 @: 0x08014800 done
 18:10:55 : erasing sector 0042 @: 0x08015000 done
 18:10:55 : erasing sector 0043 @: 0x08015800 done
 18:10:55 : erasing sector 0044 @: 0x08016000 done
 18:10:55 : erasing sector 0045 @: 0x08016800 done
 18:10:55 : erasing sector 0046 @: 0x08017000 done
 18:10:55 : erasing sector 0047 @: 0x08017800 done
 18:10:55 : erasing sector 0048 @: 0x08018000 done
 18:10:55 : erasing sector 0049 @: 0x08018800 done
 18:10:55 : erasing sector 0050 @: 0x08019000 done
 18:10:55 : erasing sector 0051 @: 0x08019800 done
 18:10:55 : Download in Progress:
 18:10:57 : File download complete

 

As you can see the start address of the erase is wrong. Also the end address and the nr of sectors erased is wrong.

The data in the hex file ends at 0x8034000 (not at 801A000)

 

STTwo-32
Technical Moderator
May 13, 2024

Hello @CHoog.1 

Could you please share your .hex file.

Best Regards.

STTwo-32

 

CHoog.1
CHoog.1Author
Associate II
May 14, 2024

Please send me an email or something i can send the hex file to? (something more private)

BenMack99
Associate III
May 21, 2024

I am seeing what I think is a similar problem.

STM32CubeProgrammer version 2.16.0

STM32G0B0RET6 target, device ID 0x467, Rev Z, 512KB flash, bootloader 0xD0

If I try to load a large bin file (425kB), then the programmer tries to erase 65364 sectors! When using ST-Link it seems to get past that and programs the flash OK, but when using USB it just locks up. It doesn't happen with smaller files that will fit in bank 1, just larger files that require 2 banks.

If I do a full chip erase first, then tick "skip flash erase before prog" then it avoids this problem. However I want to preserve config data at top of flash, so this is not a good workaround.

Happy to post more info, logs etc, here, just ask. I can send you the bin file privately, pm me

Many thanks, Ben

PS basic logs in case it helps. Via ST-Link:-

15:32:16 : File : wf3835-tank-combined.bin
15:32:16 : Size : 425.17 KB 
15:32:16 : Address : 0x08000000 
15:32:16 : Erasing memory corresponding to segment 0:
15:32:16 : Erasing internal memory sectors [0 65364]
15:32:20 : Download in Progress:
15:32:25 : File download complete

Via USB:-

12:14:06 : File : wf3835-tank-combined.bin
12:14:06 : Size : 425.17 KB 
12:14:06 : Address : 0x08000000 
12:14:06 : Erasing memory corresponding to segment 0:
12:14:06 : Erasing internal memory sectors [0 65364]
12:14:06 : erasing sector 0000 @: 0x08000000 done
...
12:14:12 : erasing sector 0255 @: 0x0807f800 done
12:14:12 : sector 0256 does not exist
etc until it locks up
Visitor II
June 10, 2024

Some other people are seeing a similar issues with version 2.16:
https://groups.io/g/nanovna-users/topic/error_sector_0000_does_not/105259683?dir=asc

I saw the issue myself when using v2.16 to update the firmware of my X-NUCLEO-LPM01A . I didn't work (failed silency) . Switching back to v2.15 solved the issue