Iar+st-link Debug STM32 occurs, Fatal error:the selected device does not match the target device error and cannot be debugged. This is a bug in IAR Embedded Workbench for ARM 7.80.3, which can be solved by downloading patches from IAR.
According to the Post
http://www.stmcu.org/module/forum/forum.php?mod=viewthread&tid=610247 in the form of finishing. Error screenshot
Patch Download
Http://supp.iar.com/Common/ProtectedDownload.asp?key=RMIUCC321D%2C7452494&protocol=HTTP (English version)
Http://supp.iar.com/Updates/?product=EWarm (Patch page, IAR Embedded Workbench for Arm-patch for ST device support in St-l INK, I-jet, and J-link ) patch installation
Close the IAR, unzip the downloaded patch file ewarm-7.80.4.12176-patch.zip , overwrite the 9 DLL files in the arm/bin/directory into the IAR installation directory X:\Program files (x86) \iar systems\embedded Workbench 7.5\arm\bin , re-open IAR, problem solved.