Question
Trying to write STM32L462CE options Byte. Modification is never set in flash after LAUNCH or POwer cycle.
Here is what my code looks like:
FLASH_OBProgramInitTypeDef pOBInit;
pOBInit.USERConfig = FLASH_OB_GetUser();
HAL_FLASH_Unlock();
HAL_FLASH_OB_Unlock();
pOBInit.OptionType = OPTIONBYTE_USER;
pOBInit.USERType = OB_USER_IWDG_STOP;
pOBInit.USERConfig &= ~(FLASH_OPTR_IWDG_STOP); // FREEZE during STOP
//pOBInit.USERConfig |= OB_USER_IWDG_STOP; // RUN during STOP
HAL_FLASHEx_OBProgram(&pOBInit);
HAL_FLASH_OB_Launch(); // Should reset MCU(Cf RM0351 p 114)
