keil5工程移植到IAR8.1过程(包含大量报错处理)

移植过程引用:https://blog.csdn.net/weixin_39871788/article/details/78780187

移植过程可以参考上贴,过程比较容易,这里不展开讲。在自己移植完成 ,编译后发现有大量错误,错误主要分为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文件)。再修改完成后错误数量大幅减少。

keil5工程移植到IAR8.1过程(包含大量报错处理)_第1张图片

二、芯片型号问题,该类问题达到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");就可以了。

 

 

 

你可能感兴趣的:(STM32)