cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeProgrammer failed to erase memory.

tpate.17
Associate II

Hi, 

I'm using B-L4S5I-IOT01A board, Unable to program the board using stm32cubeprogrammer. Got Error: failed to erase memory. Tried to mass erase the chip, got Error: Mass erase operation failed.Please verify flash protection

here is the stm32cubeprogrammer CLI log for STM32_Programmer_CLI.exe -c port=SWD -ob displ command

C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>STM32_Programmer_CLI.exe -c port=SWD -ob displ
-------------------------------------------------------------------
STM32CubeProgrammer v2.18.0
-------------------------------------------------------------------

ST-LINK SN : 0673FF3134354D5043061550
ST-LINK FW : V2J45M31
Board : STM32L4S5I-DK
Voltage : 3.20V
SWD freq : 4000 KHz
Connect mode: Normal
Reset mode : Software reset
Device ID : 0x470
Revision ID : Rev W
Device name : STM32L4Rxxx/STM32L4Sxxx
Flash size : 2 MBytes
Device type : MCU
Device CPU : Cortex-M4
BL Version : 0x95
Debug in Low Power mode enabled


UPLOADING OPTION BYTES DATA ...

Bank : 0x00
Address : 0x40022020
Size : 20 Bytes

██████████████████████████████████████████████████ 100%

Bank : 0x01
Address : 0x40022044
Size : 16 Bytes

██████████████████████████████████████████████████ 100%


OPTION BYTES BANK: 0

Read Out Protection:

RDP : 0xAA (Level 0, no protection)

BOR Level:

BOR_LEV : 0x1 (BOR Level 1, reset level threshold is around 2.0 V)

User Configuration:

nRST_STOP : 0x1 (No reset generated when entering Stop mode)
nRST_STDBY : 0x1 (No reset generated when entering Standby mode)
nRST_SHDW : 0x1 (No reset generated when entering the Shutdown mode)
IWDG_SW : 0x1 (Software independent watchdog)
IWDG_STOP : 0x1 (IWDG counter active in stop mode)
IWDG_STDBY : 0x1 (IWDG counter active in standby mode)
WWDG_SW : 0x1 (Software window watchdog)
BFB2 : 0x0 (Dual-bank boot disable)
DBANK : 0x0 (Single bank mode with 128 bits data read width)
nBOOT1 : 0x1 (Boot from system memory when BOOT0=1)
SRAM2_PE : 0x1 (SRAM2 parity check disable)
SRAM2_RST : 0x1 (SRAM2 is not erased when a system reset occurs)
nSWBOOT0 : 0x1 (BOOT0 taken from PH3/BOOT0 pin)
nBOOT0 : 0x1 (BOOT0 = 0, boot from system memory when nSWBOOT0=1 and main flash is empty,otherwise, boot from main flash memory)

PCROP Protection (Bank 1):

PCROP1_STRT : 0x0 (0x8000000)
PCROP1_END : 0x0 (0x8000000)
PCROP_RDP : 0x0 (PCROP zone is kept when RDP is decreased)

Write Protection (FLASH_WRP1AR):

WRP1A_STRT : 0xFF (0x81FE000)
WRP1A_END : 0xFF (0x81FE000)

Write Protection (FLASH_WRP2AR):

WRP2A_STRT : 0x0 (0x8100000)
WRP2A_END : 0x0 (0x8100000)
OPTION BYTES BANK: 1

PCROP Protection (Bank 2):

PCROP2_STRT : 0x0 (0x8100000)
PCROP2_END : 0x0 (0x8100000)

Write Protection (FLASH_WRP1BR):

WRP1B_STRT : 0x0 (0x8000000)
WRP1B_END : 0x0 (0x8000000)

Write Protection (FLASH_WRP2BR):

WRP2B_STRT : 0x0 (0x8100000)
WRP2B_END : 0x0 (0x8100000)

 

Can someone guide me to disable the write protection in option bytes

 

Thank you in advance

 

11 REPLIES 11

Hi, thanks for your reply.

Yes, we are working together, and we have tried your suggestions, but we are still unable to recover the chip. Since we have already tried using software, can you suggest a hardware method to erase the chip so we can try that instead? Please reply to this message here instead of responding to two separate accounts.


@avinpat_8 wrote:

Please reply to this message here instead of responding to two separate accounts.


Indeed, creating two separate threads on the same topic is unhelpful.

I've merged them.