Posted on January 17, 2018 at 06:12I am getting problem while making the &sharpIWDG work with the hardware watchdog feature in &sharpSTM32F103RB. I am doing this so that the watchdog is automatically enabled at power-on.
To make the hardware option work an option byte is written to the flash memory.
Looking at the Option byte programming(section 2.3.5) of the Flash Programming manual attached. I follow the sequence
- Checking that no Flash memory operation is ongoing by checking the BSY bit in theFLASH_SR register.
- Unlocking the OPTWRE bit in the FLASH_CR register.
- Setting the OPTPG bit in the FLASH_CR register.
- Write the data (half-word) to the desired address[Where to write, I know the address but which register?]Looking at section 2.5 I want to clear the bit 16 of the flash memory that has address 0x1FFF F800. What I am not sure about is that where can I write this (bit 16: WDG_SW) value so that the MCU knows that watchdog needs to be hardware and not software.
Does there need to be a pointer pointing to the address?How to Write the Half Word?
Thank You in advance,
Cheers
Arjun
#flash-writing #stm32-iwdg #iwdg #stm32