cancel
Showing results for 
Search instead for 
Did you mean: 

CLI fails to mass-erase the flash memory

TPier
Associate III

Hi

The command to download our firmware is as follow (with the option bytes display to show that protection is disabled):

STM32_Programmer_CLI.exe -c port=SWD mode=HOTPLUG -ob displ -e all -d C:\Temp\cu.hex -d C:\Temp\data.hex -v -rst

The result always gives an error for the flash mass-erase:

-------------------------------------------------------------------
                       STM32CubeProgrammer v2.9.0
      -------------------------------------------------------------------
 
ST-LINK SN  : 31FF6E064D4E353821590843
ST-LINK FW  : V2J29S7
Board       : --
Voltage     : 3.26V
SWD freq    : 4000 KHz
Connect mode: Hot Plug
Reset mode  : Software reset
Device ID   : 0x418
Revision ID : Rev Z
Device name : STM32F105/F107 Connectivity Line
Flash size  : 256 KBytes
Device type : MCU
Device CPU  : Cortex-M3
BL Version  : --
 
UPLOADING OPTION BYTES DATA ...
 
  Bank          : 0x00
  Address       : 0x4002201c
  Size          : 8 Bytes
 
██████████████████████████████████████████████████ 100%
 
  Bank          : 0x01
  Address       : 0x1ffff800
  Size          : 16 Bytes
 
██████████████████████████████████████████████████ 100%
 
OPTION BYTES BANK: 0
 
   Read Out Protection:
 
     RDP          : Disabled (Flash memory is not read-protected.)
 
   User Configuration:
 
     WDG_SW       : 0x1 (Software watchdog)
     nRST_STOP    : 0x1 (No reset generated)
     nRST_STDBY   : 0x1 (No reset generated)
 
   User Data:
 
     Data0        : 0xFF  (0xFF)
     Data1        : 0xFF  (0xFF)
 
   Write Protection:
 
     WRP0         : 0x1 (Write protection not active on this sector)
     WRP1         : 0x1 (Write protection not active on this sector)
     WRP2         : 0x1 (Write protection not active on this sector)
     WRP3         : 0x1 (Write protection not active on this sector)
     WRP4         : 0x1 (Write protection not active on this sector)
     WRP5         : 0x1 (Write protection not active on this sector)
     WRP6         : 0x1 (Write protection not active on this sector)
     WRP7         : 0x1 (Write protection not active on this sector)
     WRP8         : 0x1 (Write protection not active on this sector)
     WRP9         : 0x1 (Write protection not active on this sector)
     WRP10        : 0x1 (Write protection not active on this sector)
     WRP11        : 0x1 (Write protection not active on this sector)
     WRP12        : 0x1 (Write protection not active on this sector)
     WRP13        : 0x1 (Write protection not active on this sector)
     WRP14        : 0x1 (Write protection not active on this sector)
     WRP15        : 0x1 (Write protection not active on this sector)
     WRP16        : 0x1 (Write protection not active on this sector)
     WRP17        : 0x1 (Write protection not active on this sector)
     WRP18        : 0x1 (Write protection not active on this sector)
     WRP19        : 0x1 (Write protection not active on this sector)
     WRP20        : 0x1 (Write protection not active on this sector)
     WRP21        : 0x1 (Write protection not active on this sector)
     WRP22        : 0x1 (Write protection not active on this sector)
     WRP23        : 0x1 (Write protection not active on this sector)
     WRP24        : 0x1 (Write protection not active on this sector)
     WRP25        : 0x1 (Write protection not active on this sector)
     WRP26        : 0x1 (Write protection not active on this sector)
     WRP27        : 0x1 (Write protection not active on this sector)
     WRP28        : 0x1 (Write protection not active on this sector)
     WRP29        : 0x1 (Write protection not active on this sector)
     WRP30        : 0x1 (Write protection not active on this sector)
     WRP31        : 0x1 (Write protection not active on this sector)
 
Erase sector(s) ...
 
Error: Mass erase operation failed.
Please verify flash protection
 
 
Memory Programming ...
Opening and parsing file: cu.hex
  File          : cu.hex
  Size          : 32 KBytes
  Address       : 0x08000000
 
 
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 15]
Download in Progress:
██████████████████████████████████████████████████ 100%
 
File download complete
Time elapsed during download operation: 00:00:01.725
 
 
Memory Programming ...
Opening and parsing file: data.hex
  File          : data.hex
  Size          : 8 Bytes
  Address       : 0x08007000
 
 
Erasing memory corresponding to segment 0:
Erasing internal memory sector 14
Download in Progress:
██████████████████████████████████████████████████ 100%
 
File download complete
Time elapsed during download operation: 00:00:00.095
 
 
 
Verifying ...
 
 
Read progress:
██████████████████████████████████████████████████ 100%
 
Download verified successfully
 
 
 
MCU Reset
 
Software reset is performed

When I replace the mass-erase with the request to only erase the sectors of interest (-e [0 15], I got no error but also no guarantee of the operation done:

Existing specified sectors are erased successfully
Protected sectors are not erased

Additional info: if the erase step is not provided, the failure happens while attempting erasing sectors before the first download.

Why this error ?

Many thanks in advance.

Regards

0 REPLIES 0