Skip to main content
Associate III
August 13, 2023
Solved

Can't run basic example in CubeIDE on Mac OS Error: failed to erase memory - Encountered Error when

  • August 13, 2023
  • 2 replies
  • 1298 views

Hello,

I'm trying to run an example in CubeIDE 1.13.1, but receive the following error. Strangely, executing that binary from the command line in terminal does work...

 

STMicroelectronics ST-LINK GDB server. Version 7.4.0

Copyright (c) 2023, STMicroelectronics. All rights reserved.

 

Starting server with the following options:

Persistent Mode : Disabled

Logging Level : 1

Listen Port Number : 61234

Status Refresh Delay : 15s

Verbose Mode : Disabled

SWD Debug : Enabled

InitWhile : Enabled

 

Waiting for debugger connection...

Debugger connected

Waiting for debugger connection...

Debugger connected

Waiting for debugger connection...

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

STM32CubeProgrammer v2.14.0

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

 

 

 

Log output file: /tmp/STM32CubeProgrammer_932A7A.log

ST-LINK SN : 066EFF525282494867242444

ST-LINK FW : V2J42M27

Board : NUCLEO-F446RE

Voltage : 3.25V

SWD freq : 4000 KHz

Connect mode: Under Reset

Reset mode : Hardware reset

Device ID : 0x421

Revision ID : Rev A

Device name : STM32F446xx

Flash size : 512 KBytes (default)

Device type : MCU

Device CPU : Cortex-M4

BL Version : 0x0

 

 

 

Memory Programming ...

Opening and parsing file: ST-LINK_GDB_server_hAMQNL.srec

File : ST-LINK_GDB_server_hAMQNL.srec

Size : 398.77 KB

Address : 0x08000000

 

 

Erasing memory corresponding to segment 0:

Error: failed to erase memory

 

 

Error: failed to erase memory

Encountered Error when opening /Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.macos64_2.1.0.202305091550/tools/bin/STM32_Programmer_CLI

Error in STM32CubeProgrammer

Shutting down...

Exit.

 

    This topic has been closed for replies.
    Best answer by AnkhInnovationsLLC

    So this actually ended up being that the board was previously used and returned to Mouser...
    All write protect bits were set... SPRMOD was also changed from the default. Opening up STM32Prog and resetting things from there worked and the board can now be flashed.

    2 replies

    RhSilicon
    Lead
    August 14, 2023

    Try version 1.12.1

    AnkhInnovationsLLCAuthorBest answer
    Associate III
    August 14, 2023

    So this actually ended up being that the board was previously used and returned to Mouser...
    All write protect bits were set... SPRMOD was also changed from the default. Opening up STM32Prog and resetting things from there worked and the board can now be flashed.