HAL_FLASH_OB_Launch causes hang and needs power cycle to accept option bytes
We want to be able to set the RDP bytes to level 1 (read protect, but fallback allowed) via software for production. The device in question is based on an STMF723 and will be battery powered and fully assembled at the point where this protection needs to be applied on the production line.
I have the following function to set the option bytes:
HAL_FLASH_Unlock(); HAL_FLASH_OB_Unlock(); watchdog_feed(); HAL_FLASHEx_OBGetConfig(&flash_init); // 0 for no lock, 1 for upgradeable lock, 2 for permanent lock flash_init.RDPLevel = OB_RDP_LEVEL_1; HAL_FLASHEx_OBProgram(&flash_init); HAL_FLASH_OB_Launch(); // the Launch function will cause a reset if it works // if we get here, it failed HAL_FLASH_OB_Lock(); HAL_FLASH_Lock()
However, at the point where I "launch", the chip hangs and must be fully power cycled. At that point the read protect has worked, but this is not a possible step in production. Is there any way to set the RDP level without requiring a power cycle?
