Core is locked up after programming option bytes with CLI programmer
I use a STM32L412 on a custom board.
I have a programing script for our production which calls STM32_Programmer_CLI.exe for downloading a hex file and also some parameters to program the option bytes:
STM32_Programmer_CLI.exe -c port=SWD freq=24000 mode=PowerDown -d example.hex -v -ob SRAM2_PE=0 SRAM2_RST=0 BOR_LEV=1 WRP1A_STRT=0x0 WRP1A_END=0x3d RDP=0xBB -ob displ -rst -scoreEverything works fine, the option bytes are shown correctly, but at the end it says:
MCU Reset
Software reset is performed
Core is locked upThe device is dead. Only a power cycle helps to come out of this.
Has anybody an idea, what I am doing wrong here? I already tried some different reset or run commands, but nothing helps. The device stays locked.
I guess, the problem is with setting the read out protection.
I tried to set the option bytes in the firmware at startup, when I set the OBL_LAUNCH bit, I also get a lock or the system seems to boot in the system memory, because the PC register is something like 0x1FFF2xxx. But I am not sure.
Is not a real big problem, because a power cycle solves it, but want to understand, what I am doing wrong or if it is a "feature" of the chip.
I also tried this after running the script above
STM32_Programmer_CLI.exe -c port=SWD freq=24000 mode=PowerDown -ob displ -rst -scoreBut it also locks the core.
