cancel
Showing results for 
Search instead for 
Did you mean: 

Bug: STM32CubeProgrammer 2.4.0 CLI, missing STM32_Prog_DB.xml doesn't throw an error, but doesn't work as expected

eGDY2CVw4jwV
Associate II

Hi,

I'm trying to slim down the required files to use the STM32CubeProgrammer CLI tool as mentioned in my other question.

I noticed if i was missing the STM32_Prog_DB.xml file from one folder above, the erase operation of the affected sectors fails silently, but no error is reported or mentioned on some firmware files:

> .\bin\STM32_Programmer_CLI.exe -c port=COM3 br=57600 P=EVEN db=8 sb=1 -w .\firmware_silent.hex
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.4.0
      -------------------------------------------------------------------
 
Serial Port COM3 is successfully opened.
Port configuration: parity = even, baudrate = 57600, data-bit = 8,
                     stop-bit = 1.0, flow-control = off
Activating device: OK
Chip ID: 0x413
BootLoader protocol version: 3.1
 
 
Memory Programming ...
Opening and parsing file: firmware_silent.hex
  File          : firmware_silent.hex
  Size          : 25104 Bytes
  Address       : 0x08000000
 
 
Erasing memory corresponding to segment 0:
Download in Progress:
██████████████████████████████████████████████████ 100%
 
File download complete
Time elapsed during download operation: 00:00:06.701

The command finishes with exit code 0.

Afterwards no sector was erased, but the new firmware file was written over the existing flash memory content.

A verification read afterwards failed of course.

Adding the file again works as expected:

> .\bin\STM32_Programmer_CLI.exe -c port=COM3 br=57600 P=EVEN db=8 sb=1 -w .\firmware_silent.hex
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.4.0
      -------------------------------------------------------------------
 
Serial Port COM3 is successfully opened.
Port configuration: parity = even, baudrate = 57600, data-bit = 8,
                     stop-bit = 1.0, flow-control = off
Activating device: OK
Chip ID: 0x413
BootLoader protocol version: 3.1
Device name : STM32F405xx/F407xx/F415xx/F417xx
Flash size  : 1 MBytes (default)
Device type : MCU
Device CPU  : Cortex-M4
 
 
 
Memory Programming ...
Opening and parsing file: firmware_silent.hex
  File          : firmware_silent.hex
  Size          : 25104 Bytes
  Address       : 0x08000000
 
 
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 1]
Download in Progress:
██████████████████████████████████████████████████ 100%
 
File download complete
Time elapsed during download operation: 00:00:07.477

I don't know if it's expected behavour, but as a user I'd rather get en error if the erase operation is not performed correctly.

---------------------------------------------------------------

Further Testing showed the following: Using a second hex file which is working with STM32_Prog_DB.xml present works:

> .\bin\STM32_Programmer_CLI.exe -c port=COM3 br=57600 P=EVEN db=8 sb=1 -w .\firmware_fails.hex
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.4.0
      -------------------------------------------------------------------
 
Serial Port COM3 is successfully opened.
Port configuration: parity = even, baudrate = 57600, data-bit = 8,
                     stop-bit = 1.0, flow-control = off
Activating device: OK
Chip ID: 0x413
BootLoader protocol version: 3.1
Device name : STM32F405xx/F407xx/F415xx/F417xx
Flash size  : 1 MBytes (default)
Device type : MCU
Device CPU  : Cortex-M4
 
 
 
Memory Programming ...
Opening and parsing file: firmware_fails.hex
  File          : firmware_fails.hex
  Size          : 1022 Bytes
  Address       : 0x08000000
 
 
Erasing memory corresponding to segment 0:
Erasing internal memory sector 0
Download in Progress:
██████████████████████████████████████████████████ 100%
 
File download complete
Time elapsed during download operation: 00:00:00.703

Removing the file again leads to a crash with exit code -1073741819:

> .\bin\STM32_Programmer_CLI.exe -c port=COM3 br=57600 P=EVEN db=8 sb=1 -w .\firmware_fails.hex
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.4.0
      -------------------------------------------------------------------
 
Serial Port COM3 is successfully opened.
Port configuration: parity = even, baudrate = 57600, data-bit = 8,
                     stop-bit = 1.0, flow-control = off
Activating device: OK
Chip ID: 0x413
BootLoader protocol version: 3.1
 
 
Memory Programming ...
Opening and parsing file: firmware_fails.hex
  File          : firmware_fails.hex
  Size          : 1022 Bytes
  Address       : 0x08000000
 
 
Erasing memory corresponding to segment 0:

Further details as verbose log attached.

Best regards.

2 REPLIES 2
Houda GHABRI
ST Employee

Hi @eGDY2CVw4jwV​ ​ ,

This file is required because it contains an MCU database, so you cannot delete it.

it is silent because the tool does not expect you to delete this required file.

Anyway, I will submit a request to the development team to add, if possible, a verification of file existence. .

regards,

Houda

eGDY2CVw4jwV
Associate II

Hi @Houda GHABRI​ ,

thank's for the information.

Best regards