1. 程式人生 > >keil5工程移植到IAR8.1過程(包含大量報錯處理)

keil5工程移植到IAR8.1過程(包含大量報錯處理)

移植過程可以參考上貼,過程比較容易,這裡不展開講。在自己移植完成 ,編譯後發現有大量錯誤,錯誤主要分為lian兩類:

一、啟動檔案錯誤,錯誤數量較多,使總error數達到了一百多個,下面貼出報錯資訊:


Building configuration: iSO-STM32 - 41908Demo 
Updating build tree... 
 
1  file(s) deleted. 
Updating build tree... 
startup_stm32f10x_ld.s 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 35 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 36 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 46 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 48 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 56 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 61 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 62 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 63 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 64 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 65 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 66 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 67 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 68 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 69 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 70 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 71 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 72 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 73 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 74 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 75 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 76 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 79 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 80 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 81 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 82 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 83 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 84 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 85 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 86 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 87 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 88 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 89 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 90 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 91 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 92 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 93 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 94 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 95 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 96 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 97 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 98 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 99 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 100 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 101 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 102 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 103 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 104 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 105 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 106 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 107 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 108 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 109 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 110 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 111 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 112 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 113 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 114 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 115 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 116 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 117 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 118 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 119 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 120 
Warning[410]: DC or DS directive while in CODE area. C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 121 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 126 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 129 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 130 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 137 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 141 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 142 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 144 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 146 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 147 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 149 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 151 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 152 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 154 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 156 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 157 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 159 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 161 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 162 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 164 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 165 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 166 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 168 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 170 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 171 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 173 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 174 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 175 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 177 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 178 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 179 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 181 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 183 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 185 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 186 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 187 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 188 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 189 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 190 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 191 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 192 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 193 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 194 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 195 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 196 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 197 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 198 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 199 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 200 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 201 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 202 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 203 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 204 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 205 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 206 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 207 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 208 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 209 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 210 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 211 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 212 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 213 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 214 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 215 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 216 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 217 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 218 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 219 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 220 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 221 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 222 
Error[40]: Bad instruction C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 265 
Error[413]: 'ALIGN' is illegal. Use directive ALIGNROM or ALIGNRAM (the first parameter is raised to the power of 2, the second is a 32-bit fill value). C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 267 
Error[0]: Invalid syntax C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 272 
Error[413]: 'ALIGN' is illegal. Use directive ALIGNROM or ALIGNRAM (the first parameter is raised to the power of 2, the second is a 32-bit fill value). C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\startup\startup_stm32f10x_ld.s 291 
Error while running Assembler 
bsp_TiMbase.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
bsp_SPI.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
bsp_41908.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
bsp_exti.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
bsp_usart1.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
main.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
misc.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_adc.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
core_cm3.c  
Warning[Og014]: Warning in inline assembly: "Unpredictable register combination" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\core_cm3.c 395 
Warning[Og014]: Warning in inline assembly: "Unpredictable register combination" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\core_cm3.c 410 
Warning[Og014]: Warning in inline assembly: "Unpredictable register combination" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\core_cm3.c 425 
stm32f10x_cec.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_can.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_bkp.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_crc.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_dac.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_dbgmcu.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_dma.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_exti.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_flash.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_fsmc.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_gpio.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_i2c.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_it.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_iwdg.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_pwr.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_rcc.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_rtc.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_spi.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_sdio.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_tim.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_usart.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_wwdg.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
system_stm32f10x.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
 
Total number of errors: 110 
Total number of warnings: 62 

以上是所有報錯資訊,可看到error達到110,Error[40] 所涉及到的就是qi'd啟動檔案錯誤問題(在keil5和IAR中用的不是同一個啟動檔案,需要改成IAR適用的啟動檔案,如下圖,即 .S檔案)。再修改完成後錯誤數量大幅減少。

二、晶片型號問題,該類問題達到30+,下列下列時修改完啟動檔案後的bao'報錯資訊:

Building configuration: iSO-STM32 - 41908Demo 
Updating build tree... 
 
2  file(s) deleted. 
Updating build tree... 
startup_stm32f103xb.s 
bsp_TiMbase.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
bsp_41908.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
bsp_exti.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
bsp_SPI.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
bsp_usart1.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
misc.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
main.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
core_cm3.c  
Warning[Og014]: Warning in inline assembly: "Unpredictable register combination" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\core_cm3.c 395 
Warning[Og014]: Warning in inline assembly: "Unpredictable register combination" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\core_cm3.c 410 
Warning[Og014]: Warning in inline assembly: "Unpredictable register combination" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\core_cm3.c 425 
stm32f10x_adc.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_can.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_bkp.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_cec.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_crc.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_dac.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_dma.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_dbgmcu.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_exti.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_flash.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_fsmc.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_gpio.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_i2c.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_it.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_iwdg.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_rcc.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_pwr.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_rtc.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_sdio.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_tim.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_spi.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_usart.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
system_stm32f10x.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
stm32f10x_wwdg.c  
Fatal Error[Pe035]: #error directive: "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)" C:\Users\user\Desktop\MS41908 OR 41909 Demo(Speed2)\Libraries\CMSIS\stm32f10x.h 96 
Error while running C/C++ Compiler 
 
Total number of errors: 31 
Total number of warnings: 3 
 

可以發現這類錯誤程式碼為 Fatal Error[Pe035]: #error directive:  ,根據網上解決辦法:

右鍵點選工程名,選擇第一個options for target ,下面選擇C/C++,在define文字框中輸入:
USE_STDPERIPH_DRIVER,STM32F10X_MD。MD根據你選擇的機種更換為LD或HD

設定完成後編譯又出現大量core_cm3.c相關錯誤,達300+個,這是因為老舊的core_cm3.h和IAR不適配的原因。我自己的解決辦法是找自己之前的IAR下stm32f103c8t6的工程,將裡面的core_cm3.h拷貝到當前工程覆蓋老舊的M3核心檔案,在工程中也要remove老舊的core_cm3.h檔案,換成新的。最後編譯,只剩下一個_nop();未定義的錯誤,直接將_nop()改成__ASM("NOP");就可以了。