Find the following code in the Stm32f1xx.h file:
/* Uncomment the line below according to the target stm32l device used in your
Application
*/
#if!defined (STM32F100XB) &&!defined (stm32f100xe) &&!defined (stm32f101x6) && \
!defined (STM32F101XB) &&!defined (stm32f101xe) &&!defined (STM32F101XG) &&!defined ( stm32f102x6) &&!defined (STM32F102XB) &&!defined (stm32f103x6) && \
!defined (STM32F103XB) &&!defined (stm32f103xe) &&!defined (STM32F103XG) &&!defined ( STM32F105XC) &&!defined (STM32F107XC)
/* #define STM32F100XB *//*!< stm32f100c4, stm32f100r4, Stm32f100c6, STM32F100R6, Stm32f100c8, STM32F100R8, STM32F1 00V8, STM32F100CB, STM32F100RB and STM32F100VB * *
/* #define STM32F100XE *//*!< STM32F100RC, STM32F100VC, Stm32f100zc, Stm32f100rd, STM32F100VD, Stm32f100zd, STM32F1 00RE, Stm32f100ve and Stm32f100ze */
/* #define STM32F101X6 *//*!< stm32f101c4, STM32F101R4, Stm32f101t4, Stm32f101c6, STM32F101R6 and Stm32f101t6 Devic ES */
/* #define STM32F101XB *//*!< Stm32f101c8, Stm32f101r8, Stm32f101t8, Stm32f101v8, STM32F101CB, STM32F101RB, STM32F1 01TB and STM32F101VB */
/* #define STM32F101XE *//*!< STM32F101RC, STM32F101VC, Stm32f101zc, Stm32f101rd, STM32F101VD, Stm32f101zd, STM32F1 01RE, Stm32f101ve and Stm32f101ze */
/* #define STM32F101XG *//*!< STM32F101RF, STM32F101VF, Stm32f101zf, Stm32f101rg, STM32F101VG and STM32F101ZG * *
/* #define STM32F102X6 *//*!< stm32f102c4, STM32F102R4, STM32F102C6 and STM32F102R6 * *
/* #define STM32F102XB *//*!< Stm32f102c8, Stm32f102r8, STM32F102CB and STM32F102RB * *
/* #define STM32F103X6 *//*!< stm32f103c4, STM32F103R4, Stm32f103t4, Stm32f103c6, STM32F103R6 and STM32F103T6 * *
/* #define STM32F103XB *//*!< Stm32f103c8, Stm32f103r8, Stm32f103t8, Stm32f103v8, STM32F103CB, STM32F103RB, STM32F1 03TB and STM32F103VB */
/* #define STM32F103XE *//*!< STM32F103RC, STM32F103VC, Stm32f103zc, stm32f103rd, STM32F103VD, Stm32f103zd, STM32F1 03RE, Stm32f103ve and Stm32f103ze */
/* #define STM32F103XG *//*!< STM32F103RF, STM32F103VF, Stm32f103zf, Stm32f103rg, STM32F103VG and STM32F103ZG * *
/* #define STM32F105XC *//*!< stm32f105r8, Stm32f105v8, STM32F105RB, Stm32f105vb, STM32F105RC and STM32F105VC * *
/* #define STM32F107XC *//*!< STM32F107RB, Stm32f107vb, STM32F107RC and STM32F107VC * *
#endif
Then find the MCU you used to remove the comments before and after it!
Stm32 Hall Library new template compilation error: #error "Please select first the target stm32f1xx device used in your application (in Stm32f1xx.h file ) "is handled