Cut and paste this URL to share the unmodified register and value:
https://regviz.com/r/Keil/AT32F407xx_v2/FLASH/CTRL3#0x0
Control 3 register
Flash program
Sector erase
Chip erase
Erasing start
Operation lock
Error interrupt enable
Operation done flag interrupt enable
https://github.com/cmsis-svd/cmsis-svd-data