STM32_Programmer_CLI.exe question
I have a custom board with STM32G070RB micro. I programmed the board several times for debugging in the development phase using theST-LINK//V2 in CubeIDE.
Now I would like to generate a .bat file to program the boards, but I am facing some problems.
My command line is the following (I am using ST-LINK/V2):
STM32_Programmer_CLI.exe -c port=SWD freq=4000 mode=UR -e all -w "file.hex" -v -ob RDP=0xBB and it worked well.
In order to reprogram the board I did:
STM32_Programmer_CLI.exe -c port=SWD freq=4000 mode=UR -ob RDP=0xAA.
After this I can reprogram the board using the first command. Everything looked good at that moment, but I tried to program the board again from the CubeIDE (like I did for several times) and the programming from CubeIDE failed. I thought that I have to put the read protection to level; 0 and I tried to send the command STM32_Programmer_CLI.exe -c port=SWD freq=4000 mode=UR -ob RDP=0xAA but no more worked. It responds with "Error: No STM32 target found!" message.
I tried to connect to the board with ST LINK Utility and STM32CubeProgrammer GUI without success. My board now is locked, I cannot reprogram the board. I will replace the MCU, but the question is why the MCU cannot be programmed?
p.s.: In my code I've configured the SWD pins to Serial Wire.

