FLASH status register BSY1 vs. CFGBSY flag. Which one to watch for finished flash programming/erase operation?
During self flash programming (IAP - InApplicationProgramming) the STM32 reference manual states that a clear BSY1 flag indicates the end of erasing/programming cycle.
Carefully examining the HAL library: it uses FLASH_WaitForLastOperation function that contains waiting for both of BSY1 and CFGBSY flags to be clear.
Examining the behavior of both flags with scope (flag state copied to a portpin), it shows that both flags works the same.
SO, what is the real difference between the two flags, and which one to use to be sure flash erasing/programming done?
