OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 5479|回复: 6

stm32f103ze 求救

[复制链接]

1

主题

6

帖子

0

精华

新手上路

积分
40
金钱
40
注册时间
2016-4-24
在线时间
5 小时
发表于 2016-4-27 19:11:28 | 显示全部楼层 |阅读模式
5金钱
萌新求救。
我按照视频上的方法建立工程,但是到最后一步在魔术棒下设置完include paths之后,进行编译但是告诉我没有core_cm3.hD:\mdk5.14\ARM\PACK\Keil\STM32F1xx_DFP\1.0.5\Device\Include\stm32f10x.h(478): error:  #5: cannot open source input file "core_cm3.h": No such file or directory
  #include "core_cm3.h"
之后我在魔术棒下添加了core_cm3.h文件。
但是之后如下错误。
Rebuild target 'Target 1'
assembling startup_stm32f10x_hd.s...
compiling DDD.C...
DDD.C(7): warning:  #223-D: function "Stm32_CLOCK_Init" declared implicitly
        Stm32_CLOCK_Init(9);
DDD.C(8): warning:  #223-D: function "DElay_init" declared implicitly
        DElay_init(72);
DDD.C(9): error:  #140: too many arguments in function call
        uart_init(72,115200);
DDD.C: 2 warnings, 1 error
compiling delay.c...
SYSTEM\delay\delay.c(129): warning:  #223-D: function "SysTick_CLKSourceConfig" declared implicitly
        SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK_Div8);   //选择外部时钟  HCLK/8
SYSTEM\delay\delay.c(129): error:  #20: identifier "SysTick_CLKSource_HCLK_Div8" is undefined
        SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK_Div8);   //选择外部时钟  HCLK/8
SYSTEM\delay\delay.c: 1 warning, 1 error
compiling sys.c...
compiling usart.c...
SYSTEM\usart\usart.c(91): error:  #20: identifier "GPIO_InitTypeDef" is undefined
    GPIO_InitTypeDef GPIO_InitStructure;
SYSTEM\usart\usart.c(92): error:  #20: identifier "USART_InitTypeDef" is undefined
        USART_InitTypeDef USART_InitStructure;
SYSTEM\usart\usart.c(93): error:  #20: identifier "NVIC_InitTypeDef" is undefined
        NVIC_InitTypeDef NVIC_InitStructure;
SYSTEM\usart\usart.c(95): warning:  #223-D: function "RCC_APB2PeriphClockCmd" declared implicitly
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1|RCC_APB2Periph_GPIOA, ENABLE);     //使能USART1,GPIOA时钟
SYSTEM\usart\usart.c(95): error:  #20: identifier "RCC_APB2Periph_USART1" is undefined
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1|RCC_APB2Periph_GPIOA, ENABLE);     //使能USART1,GPIOA时钟
SYSTEM\usart\usart.c(95): error:  #20: identifier "RCC_APB2Periph_GPIOA" is undefined
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1|RCC_APB2Periph_GPIOA, ENABLE);     //使能USART1,GPIOA时钟
SYSTEM\usart\usart.c(98): error:  #20: identifier "GPIO_Pin_9" is undefined
    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; //PA.9
SYSTEM\usart\usart.c(99): error:  #20: identifier "GPIO_Speed_50MHz" is undefined
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
SYSTEM\usart\usart.c(100): error:  #20: identifier "GPIO_Mode_AF_PP" is undefined
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;     //复用推挽输出
SYSTEM\usart\usart.c(101): warning:  #223-D: function "GPIO_Init" declared implicitly
    GPIO_Init(GPIOA, &GPIO_InitStructure);//初始化GPIOA.9
SYSTEM\usart\usart.c(104): error:  #20: identifier "GPIO_Pin_10" is undefined
    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;//PA10
SYSTEM\usart\usart.c(105): error:  #20: identifier "GPIO_Mode_IN_FLOATING" is undefined
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;//浮空输入
SYSTEM\usart\usart.c(113): warning:  #223-D: function "NVIC_Init" declared implicitly
        NVIC_Init(&NVIC_InitStructure); //根据指定的参数初始化VIC寄存器
SYSTEM\usart\usart.c(118): error:  #20: identifier "USART_WordLength_8b" is undefined
        USART_InitStructure.USART_WordLength = USART_WordLength_8b;//字长为8位数据格式
SYSTEM\usart\usart.c(119): error:  #20: identifier "USART_StopBits_1" is undefined
        USART_InitStructure.USART_StopBits = USART_StopBits_1;//一个停止位
SYSTEM\usart\usart.c(120): error:  #20: identifier "USART_Parity_No" is undefined
        USART_InitStructure.USART_Parity = USART_Parity_No;//无奇偶校验位
SYSTEM\usart\usart.c(121): error:  #20: identifier "USART_HardwareFlowControl_None" is undefined
        USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;//无硬件数据流控制
SYSTEM\usart\usart.c(122): error:  #20: identifier "USART_Mode_Rx" is undefined
        USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; //收发模式
SYSTEM\usart\usart.c(122): error:  #20: identifier "USART_Mode_Tx" is undefined
        USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; //收发模式
SYSTEM\usart\usart.c(124): warning:  #223-D: function "USART_Init" declared implicitly
    USART_Init(USART1, &USART_InitStructure); //初始化串口1
SYSTEM\usart\usart.c(125): warning:  #223-D: function "USART_ITConfig" declared implicitly
    USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);//开启串口接受中断
SYSTEM\usart\usart.c(125): error:  #20: identifier "USART_IT_RXNE" is undefined
    USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);//开启串口接受中断
SYSTEM\usart\usart.c(126): warning:  #223-D: function "USART_Cmd" declared implicitly
    USART_Cmd(USART1, ENABLE);                    //使能串口1
SYSTEM\usart\usart.c(136): warning:  #223-D: function "USART_GetITStatus" declared implicitly
        if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)  //接收中断(接收到的数据必须是0x0d 0x0a结尾)
SYSTEM\usart\usart.c(136): error:  #20: identifier "USART_IT_RXNE" is undefined
        if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)  //接收中断(接收到的数据必须是0x0d 0x0a结尾)
SYSTEM\usart\usart.c(138): warning:  #223-D: function "USART_ReceiveData" declared implicitly
                Res =USART_ReceiveData(USART1); //读取接收到的数据
SYSTEM\usart\usart.c: 8 warnings, 18 errors
compiling core_cm3.c...
assembling startup_stm32f10x_hd.s...
".\Objects\AAA.axf" - 20 Error(s), 11 Warning(s).
Target not created.
Build Time Elapsed:  00:00:04

我已经彻底懵逼了。
我该怎么建立这个简单的工程啊,救命!!!

正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

1

主题

6

帖子

0

精华

新手上路

积分
40
金钱
40
注册时间
2016-4-24
在线时间
5 小时
 楼主| 发表于 2016-4-27 21:49:50 | 显示全部楼层
回复

使用道具 举报

354

主题

1475

帖子

12

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
8093
金钱
8093
注册时间
2015-10-15
在线时间
2918 小时
发表于 2016-4-28 14:30:12 | 显示全部楼层
1.请问是库函数还是寄存器?
2.请问你的函数你自己输入的么?
DDD.C(7): warning:  #223-D: function "Stm32_CLOCK_Init" declared implicitly
        Stm32_CLOCK_Init(9);
DDD.C(8): warning:  #223-D: function "DElay_init" declared implicitly
跟明显这两个函数大小写都不对。
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复

使用道具 举报

1

主题

6

帖子

0

精华

新手上路

积分
40
金钱
40
注册时间
2016-4-24
在线时间
5 小时
 楼主| 发表于 2016-4-28 20:14:05 | 显示全部楼层
openedvadmin 发表于 2016-4-28 14:30
1.请问是库函数还是寄存器?
2.请问你的函数你自己输入的么?
DDD.C(7): warning:  #223-D: function "St ...

寄存器的,函数是我照着书上的模板写的
回复

使用道具 举报

1

主题

6

帖子

0

精华

新手上路

积分
40
金钱
40
注册时间
2016-4-24
在线时间
5 小时
 楼主| 发表于 2016-4-28 20:40:41 | 显示全部楼层
kappo 发表于 2016-4-28 20:14
寄存器的,函数是我照着书上的模板写的

大小写改回去了也没用,还是那些错误
回复

使用道具 举报

32

主题

883

帖子

0

精华

论坛元老

Rank: 8Rank: 8

积分
4036
金钱
4036
注册时间
2015-11-14
在线时间
545 小时
发表于 2016-4-28 21:47:10 来自手机 | 显示全部楼层
system文件夹复制对了没?
回复

使用道具 举报

1

主题

6

帖子

0

精华

新手上路

积分
40
金钱
40
注册时间
2016-4-24
在线时间
5 小时
 楼主| 发表于 2016-4-29 10:26:29 | 显示全部楼层
Electronic 发表于 2016-4-28 21:47
system文件夹复制对了没?

复制的是原子提供的光盘里走马灯寄存器版本的system文件夹
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-6-17 16:08

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表