2018-12-11 01:33 AM
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)
2019-02-11 05:25 AM
Did you find a way to program the option bytes? If yes, could you let me know how, I'm somehow stuck at same point, the only difference is I'm trying to set/reset the BFB2 bit with no success so far. I'm using same code, on an STM32L476...
2019-02-12 12:36 AM
No I did not succeded until now.
I'm still wishing an answer ...