已经在工程里包含了全部STM32F10x文件夹下的头文件了。正在跟着视频学,现在只是软件仿真。
程序:
#include <stm32f10x_lib.h>
int main()
{
u8 i,data;
FlagStatus Status;
//初始化
USART_InitTypeDef USART_InitStructure;
USART_InitStructure.USART_BaudRate=9600;
USART_InitStructure.USART_WordLength=USART_WordLength_8b;
USART_InitStructure.USART_StopBits=USART_StopBits_1;
USART_InitStructure.USART_Parity=USART_Parity_No;
USART_InitStructure.USART_HardwareFlowControl=USART_HardwareFlowControl_None;
USART_InitStructure.USART_Mode=USART_Mode_Tx|USART_Mode_Rx;
USART_Init(USART1,&USART_InitStructure);
USART_Cmd(USART1,ENABLE);
//发送
data='A';
for(i=0;i<23;i++)
{
USART_SendData(USART1,data);
data++;
Status=USART_GetFlagStatus(USART1,USART_FLAG_TC);
while(Status==RESET);
}
return(1);
}
错误:
Build target 'Target 1'
assembling STM32F10x.s...
compiling 1.c...
linking...
t.axf: Error: L6218E: Undefined symbol USART_Cmd (referred from 1.o).
t.axf: Error: L6218E: Undefined symbol USART_GetFlagStatus (referred from 1.o).
t.axf: Error: L6218E: Undefined symbol USART_Init (referred from 1.o).
t.axf: Error: L6218E: Undefined symbol USART_SendData (referred from 1.o).
t.axf: Not enough information to list image symbols.
t.axf: Finished: 1 information, 0 warning and 4 error messages.
Target not created
刚刚从51转到32求大神帮个忙啊谢谢
程序:
#include <stm32f10x_lib.h>
int main()
{
u8 i,data;
FlagStatus Status;
//初始化
USART_InitTypeDef USART_InitStructure;
USART_InitStructure.USART_BaudRate=9600;
USART_InitStructure.USART_WordLength=USART_WordLength_8b;
USART_InitStructure.USART_StopBits=USART_StopBits_1;
USART_InitStructure.USART_Parity=USART_Parity_No;
USART_InitStructure.USART_HardwareFlowControl=USART_HardwareFlowControl_None;
USART_InitStructure.USART_Mode=USART_Mode_Tx|USART_Mode_Rx;
USART_Init(USART1,&USART_InitStructure);
USART_Cmd(USART1,ENABLE);
//发送
data='A';
for(i=0;i<23;i++)
{
USART_SendData(USART1,data);
data++;
Status=USART_GetFlagStatus(USART1,USART_FLAG_TC);
while(Status==RESET);
}
return(1);
}
错误:
Build target 'Target 1'
assembling STM32F10x.s...
compiling 1.c...
linking...
t.axf: Error: L6218E: Undefined symbol USART_Cmd (referred from 1.o).
t.axf: Error: L6218E: Undefined symbol USART_GetFlagStatus (referred from 1.o).
t.axf: Error: L6218E: Undefined symbol USART_Init (referred from 1.o).
t.axf: Error: L6218E: Undefined symbol USART_SendData (referred from 1.o).
t.axf: Not enough information to list image symbols.
t.axf: Finished: 1 information, 0 warning and 4 error messages.
Target not created
刚刚从51转到32求大神帮个忙啊谢谢
Endman
只能七个字
