2025-02-03 11:41 PM - edited 2025-02-04 12:03 AM
Hello.
Is it possible to reset the product state from closed to open
internaly by the firmware on a STM32H563?
Can i do this easy by rewriting the ProductState to 0xED, or do i need additional provision information or the provisioning password to do this?
I don't want to kill my stm32-board, if i rewrite the product state and there is no way to do a Regression with STM32CubeProgrammer after this..
FLASH_OBProgramInitTypeDef OB;
HAL_FLASHEx_OBGetConfig(&OB);
HAL_FLASH_Unlock();
HAL_FLASH_OB_Unlock();
OB.ProductState = OB_PROD_STATE_OPEN;
if ( HAL_FLASHEx_OBProgram(&OB) != HAL_OK )
{
HAL_FLASH_OB_Lock();
HAL_FLASH_Lock();
return HAL_ERROR;
}
HAL_FLASH_OB_Launch();
HAL_FLASH_OB_Lock();
HAL_FLASH_Lock();