STM32F103RET6 can't disable read out protection
Hey,
I am using STM32F103RET6 MCU in my own project and program it via SWD through Nucleo F446RE's ST-Link.
Since I activated CAN peripherial I can't load a project to the MCU. I don't know if CAN is the problem.
When I try to load a program through ST-Link Utility I receive messages and I am disconnected immadietly:
17:52:11 : ST-LINK SN : 066DFF504955657867124523
17:52:11 : V2J33M25
17:52:11 : Connected via SWD.
17:52:11 : SWD Frequency = 1,8 MHz.
17:52:11 : Connection mode : Connect Under Reset.
17:52:11 : Debug in Low Power mode enabled.
17:52:11 : Device ID:0x414
17:52:11 : Device flash Size : 512KBytes
17:52:11 : Device family :STM32F10xx High-density
17:52:12 : Disconnected from device.
17:52:12 : Connection to device is lost: check power supply and debug connection.
17:52:12 : If the target is in low power mode, please enable "Debug in Low Power mode" option from Target->settings menu.
The same thing holding 'RESET' button on Nucleo: (allows me to connect to the board):
17:53:43 : Memory-Loader error
17:53:43 : Error occured during erase operation!
17:53:45 : Disconnected from device.
17:53:45 : Connection to device is lost: check power supply and debug connection.
17:53:45 : If the target is in low power mode, please enable "Debug in Low Power mode" option from Target->settings menu.
So I decided to load almost empty project to the MCU also holding 'RESET':
17:55:07 : Read out protection is activated.
17:55:12 : Could not disable Read Out Protection!
17:55:15 : Internal command error
17:55:15 : Error occured during erase operation!
17:55:15 : Can not connect to device!
17:55:17 : Disconnected from device.
So I tried to disable Read Out Protection through Option Bytes and I receive a message:
---------------------------
Error
---------------------------
Could not set Option bytes!
Please reset the target and retry.
---------------------------
OK
---------------------------
As far as I can see, there is no choice of Level 0,1 and 2 or RDP. Only 'Enabled' and 'Disabled'. No message that enabling will result in permament writing of MCU and can not be reversable.
Therefore where is the problem? How can I set Option Bytes without ST-Link? Is it possible through SWD or bootloader?
Thanks in advance,
Szymon
