你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

STM32F103的keil工程如何创建

[复制链接]
ty521wgl 提问时间:2011-6-8 22:12 /
本人用的软件为keil uvision4,外设驱动库为3.5版,最经在网上搜了许多关于工程创建的方法(从零开始创建工程),但最终自己编译时仍是不能成功。创建工程时应注意什么,有没有成功的案例,拜求高人指点
收藏 评论8 发布时间:2011-6-8 22:12

举报

8个回答
k10k10k10-19309 回答时间:2011-6-9 08:30:55

RE:STM32F103的keil工程如何创建

你把错误信息贴出来我才能帮你!
或者直接把工程打包。
废鱼 回答时间:2011-6-9 09:07:25

RE:STM32F103的keil工程如何创建

我的博客里面有如何建立工程及一些注意事项,你可以按照建立一次,如果有错误信息,希望把内容贴出来,我们帮你解决。
ty521wgl 回答时间:2011-6-9 22:16:48

回复:STM32F103的keil工程如何创建

回复第 2 楼 k10k10k10于2011-06-09 00:30:55发表:
你把错误信息贴出来我才能帮你!
或者直接把工程打包。 

 word文档内为工程文件截图

新建 Microsoft Word 文档.doc

下载

27 KB, 下载次数: 57

ty521wgl 回答时间:2011-6-9 22:18:28

回复:STM32F103的keil工程如何创建

回复第 2 楼 k10k10k10于2011-06-09 00:30:55发表:
你把错误信息贴出来我才能帮你!
或者直接把工程打包。 

错误信息:
Build target 'NO1'
compiling core_cm3.c...
compiling system_stm32f10x.c...
Lib\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(96): error:  #35: #error directive: &quotlease select first the target STM32F10x device used in your application (in stm32f10x.h file)"
compiling main.c...
User\main.c(42): warning:  #188-D: enumerated type mixed with another type
User\main.c(43): warning:  #188-D: enumerated type mixed with another type
User\main.c(44): warning:  #188-D: enumerated type mixed with another type
User\main.c(45): warning:  #188-D: enumerated type mixed with another type
User\main.c(30): warning:  #177-D: variable "key" was declared but never referenced
User\main.c(31): warning:  #177-D: variable "flag" was declared but never referenced
compiling stm32f10x_it.c...
compiling misc.c...
Lib\STM32F10x_StdPeriph_Driver\src\misc.c(99): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\misc.c(117): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\misc.c(159): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\misc.c(178): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\misc.c(202): warning:  #223-D: function "assert_param" declared implicitly
compiling stm32f10x_gpio.c...
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(111): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(178): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(286): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(308): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(324): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(346): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(361): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(377): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(397): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(420): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(437): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(466): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(486): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(554): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(559): error:  #136: struct "" has no field "MAPR2"
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(593): error:  #136: struct "" has no field "MAPR2"
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(613): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(632): warning:  #223-D: function "assert_param" declared implicitly
compiling stm32f10x_rcc.c...
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(273): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(315): error:  #20: identifier "HSE_STARTUP_TIMEOUT" is undefined
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(338): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(357): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(383): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(404): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(431): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(459): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(484): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(508): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(528): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(550): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(568): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(612): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(638): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(664): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(703): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(749): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(770): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(795): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(814): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(832): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(865): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(882): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(896): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(926): error:  #20: identifier "HSI_VALUE" is undefined
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(929): error:  #20: identifier "HSE_VALUE" is undefined
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1067): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1098): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1129): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1156): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1188): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1219): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1240): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1253): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1285): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1332): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1406): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1451): warning:  #223-D: function "assert_param" declared implicitly
assembling startup_stm32f10x_hd.s...
assembling startup_stm32f10x_cl.s...
Target not created
ty521wgl 回答时间:2011-6-9 22:33:08

回复:STM32F103的keil工程如何创建

回复第 3 楼 安于2011-06-09 01:07:25发表:
我的博客里面有如何建立工程及一些注意事项,你可以按照建立一次,如果有错误信息,希望把内容贴出来,我们帮你解决。 

错误信息:
Build target 'NO1'
compiling core_cm3.c...
compiling system_stm32f10x.c...
Lib\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h(96): error:  #35: #error directive: &quotlease select first the target STM32F10x device used in your application (in stm32f10x.h file)"
compiling main.c...
User\main.c(42): warning:  #188-D: enumerated type mixed with another type
User\main.c(43): warning:  #188-D: enumerated type mixed with another type
User\main.c(44): warning:  #188-D: enumerated type mixed with another type
User\main.c(45): warning:  #188-D: enumerated type mixed with another type
User\main.c(30): warning:  #177-D: variable "key" was declared but never referenced
User\main.c(31): warning:  #177-D: variable "flag" was declared but never referenced
compiling stm32f10x_it.c...
compiling misc.c...
Lib\STM32F10x_StdPeriph_Driver\src\misc.c(99): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\misc.c(117): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\misc.c(159): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\misc.c(178): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\misc.c(202): warning:  #223-D: function "assert_param" declared implicitly
compiling stm32f10x_gpio.c...
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(111): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(178): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(286): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(308): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(324): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(346): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(361): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(377): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(397): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(420): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(437): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(466): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(486): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(554): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(559): error:  #136: struct "" has no field "MAPR2"
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(593): error:  #136: struct "" has no field "MAPR2"
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(613): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c(632): warning:  #223-D: function "assert_param" declared implicitly
compiling stm32f10x_rcc.c...
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(273): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(315): error:  #20: identifier "HSE_STARTUP_TIMEOUT" is undefined
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(338): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(357): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(383): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(404): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(431): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(459): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(484): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(508): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(528): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(550): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(568): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(612): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(638): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(664): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(703): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(749): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(770): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(795): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(814): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(832): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(865): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(882): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(896): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(926): error:  #20: identifier "HSI_VALUE" is undefined
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(929): error:  #20: identifier "HSE_VALUE" is undefined
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1067): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1098): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1129): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1156): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1188): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1219): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1240): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1253): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1285): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1332): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1406): warning:  #223-D: function "assert_param" declared implicitly
Lib\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c(1451): warning:  #223-D: function "assert_param" declared implicitly
assembling startup_stm32f10x_hd.s...
assembling startup_stm32f10x_cl.s...
Target not created
bubangzhichuan 回答时间:2011-8-1 16:01:19

回复:STM32F103的keil工程如何创建

我也跟楼主类似的情况呀,非常着急,已经弄两天了。
我用的是3.1.2的库,keil的版本是4.
错误是:
main.c(23): error:  #5: cannot open source input file "stm32_eval.h": No such file or directory
main.c:   #include "stm32_eval.h"
main.c:                          ^
main.c: main.c: 0 warnings, 1 error
main()函数是直接从固件库的Template中复制的,希望大侠解答。
 
非常感谢!!
 
stmXhuan 回答时间:2011-10-15 08:59:29

RE:STM32F103的keil工程如何创建

我也是这样的错误,一个编译环境搞了好几天老是错误
kaka123-253974 回答时间:2013-11-10 23:40:49

RE:STM32F103的keil工程如何创建

建议随便下载一款STM32神舟系列开发板的用户手册,2013年后出版的手册版本,里面有详细的步骤,以及实际代码模板都有提供

所属标签

相似问题

官网相关资源

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32Cube扩展软件包
意法半导体边缘AI套件
ST - 理想汽车豪华SUV案例
ST意法半导体智能家居案例
STM32 ARM Cortex 32位微控制器
关注我们
st-img 微信公众号
st-img 手机版