2020-09-29 03:36 AM
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?
Solved! Go to Solution.
2020-09-29 01:31 PM
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.
2020-09-29 01:31 PM
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.