user63601: I built a custom board that uses a STM32F411CEU6. My problem is that tried to upload a simple blink sketch (I'm using Arduino IDE with STM32 libraries) and I get the error:
ST-LINK SN  : 57FF72067166535645342467
ST-LINK FW  : V2J37S7
Board       : --
Voltage     : 3.23V
SWD freq    : 4000 KHz
Connect mode: Under Reset

Reset mode  : Hardware reset
Device ID   : 0x431
Revision ID : Rev A

Device name : STM32F411xC/E
Flash size  : 512 KBytes (default)
Device type : MCU
Device CPU  : Cortex-M4



Memory Programming ...
Opening and parsing file: Blink.ino.bin
  File          : Blink.ino.bin
  Size          : 11256 Bytes
  Address       : 0x08000000 


Erasing memory corresponding to segment 0:
Erasing internal memory sector 0
Error: failed to erase memory


Error: failed to erase memory

RUNNING Program ... 
  Address:      : 0x8000000
Warning: The core is locked up
Start operation achieved successfully
the selected serial port Start operation achieved successfully
 does not exist or your board is not connected

I'm using an ST-LINK V2 USB pen that works fine. I have a Black Pill with the same STM32 to use as a control and everything works ok.
Also, when I try to check the custom board with STM32CudeProgrammer, I get the error:
  22:16:27 :   Size          : 1024 Bytes
  22:16:27 :   Address       : 0x8000000
  22:16:27 : Read progress:
  22:16:27 : Error: Data read failed


user63601: The solution:

Open STM32CubeProgramer and click connect
Click Option Bytes (OB) located in the left bar
Select Read Out Protection and choose AA option
Then select PCROP and uncheck the box
Click apply


63601: <p>I built a custom board that uses a STM32F411CEU6. My problem is that tried to upload a simple blink sketch (I'm using Arduino IDE with STM32 libraries) and I get the error:</p>
<pre><code>ST-LINK SN  : 57FF72067166535645342467
ST-LINK FW  : V2J37S7
Board       : --
Voltage     : 3.23V
SWD freq    : 4000 KHz
Connect mode: Under Reset

Reset mode  : Hardware reset
Device ID   : 0x431
Revision ID : Rev A

Device name : STM32F411xC/E
Flash size  : 512 KBytes (default)
Device type : MCU
Device CPU  : Cortex-M4



Memory Programming ...
Opening and parsing file: Blink.ino.bin
  File          : Blink.ino.bin
  Size          : 11256 Bytes
  Address       : 0x08000000 


Erasing memory corresponding to segment 0:
Erasing internal memory sector 0
Error: failed to erase memory


Error: failed to erase memory

RUNNING Program ... 
  Address:      : 0x8000000
Warning: The core is locked up
Start operation achieved successfully
the selected serial port Start operation achieved successfully
 does not exist or your board is not connected
</code></pre>
<p>I'm using an ST-LINK V2 USB pen that works fine. I have a Black Pill with the same STM32 to use as a control and everything works ok.</p>
<p>Also, when I try to check the custom board with STM32CudeProgrammer, I get the error:</p>
<pre><code>  22:16:27 :   Size          : 1024 Bytes
  22:16:27 :   Address       : 0x8000000
  22:16:27 : Read progress:
  22:16:27 : Error: Data read failed
</code></pre>
 63601: <p>The solution:</p>
<ol>
<li>Open STM32CubeProgramer and click connect</li>
<li>Click Option Bytes (OB) located in the left bar</li>
<li>Select Read Out Protection and choose AA option</li>
<li>Then select PCROP and uncheck the box</li>
<li>Click apply</li>
</ol>
