cancel
Showing results for 
Search instead for 
Did you mean: 

Refreshing IWDG without initializing it causes FLASH->SR->CFGBSY to be set

HRadt.1
Senior

When trying to refresh IWDG when it has not been initialized, causes the FLASH->SR->CFGBSY bit to get stuck on SET. It will not return to zero ever.

Also mentioned in this post: https://community.st.com/s/question/0D50X0000Bh5LOVSQ2/trouble-programming-flash-with-halflashprogram by JHuan.1

I couldn't find anything in the reference manual, nor in the errata sheet of the STM32WB55 cpu. Is there a link between IWDG and FLASH that I'm not aware of? Or how could IWDG have any effect on FLASH?

1 ACCEPTED SOLUTION

Accepted Solutions
HRadt.1
Senior

Okay, this one is clearly my fault, but in case someone stumbles on the same symptoms:

Not calling MX_IWDG_Init() leaves the hiwdg handle uninitialized. Invoking the refresh through the HAL then effectively causes a flash write to address 0, which is an alias for FLASH_BASE (0x08000000). Just writing that address then causes the CFGBSY bit to get stuck.

View solution in original post

1 REPLY 1
HRadt.1
Senior

Okay, this one is clearly my fault, but in case someone stumbles on the same symptoms:

Not calling MX_IWDG_Init() leaves the hiwdg handle uninitialized. Invoking the refresh through the HAL then effectively causes a flash write to address 0, which is an alias for FLASH_BASE (0x08000000). Just writing that address then causes the CFGBSY bit to get stuck.