2019-11-04 03:09 AM
STM32F030C8 - I'm not using any of the ST libraries.
I'm attempting to secure the mcu.
I unlock flash and unlock the option write - verified.
I am using a J-Link debugger to verify the process.
Option byte before process == 0xaa55 - or level 0 access
I erase the option bytes and verify that they are 0xffff.
I program 0x11 into the option byte and verify that the option bytes read 0x11ee
I execute the following instruction to enter level 1 read access
FLASH->CR |= FLASH_CR_OBL_LAUNCH;
The mcu resets as expected.
I can still connect to the mcu using the J-Link debugger and debug as if the mcu was at level 0 again. Reading the option bytes show that indeed I'm back at level 0 with the option bytes being 0xaa55.
Any ideas or comments as to why the mcu is reverting back to level 0?
Thanks
2019-11-04 07:57 AM
The mcu was really at level 1.
The J-link was not stating that the device was secure and was automatically erasing and performing a bulk erase without letting me know.
Addressed the J-link notification issue and now I can confirm I am actually securing the device.
Closed.