买了一块万利的EK-STM32F开发板,运行了几个DEMO程序.想自己些个完整的程序运行一下,可是已经摆弄IAR ARM好几天了,反复看了万利开发光盘里带的<IAR EWARM快速入门>(针对ARM7TDMI-S的)和周立功的<IAR使用指南>(是针对LM3X9XX的),也看了例程可.无论我怎么设置IAR也编译不过去我的程序,愁死我了!请用过IAR的大侠出手指点.
我的程序;
#include "stm32f10x_lib.h"
vu32 count = GPIO_Pin_4;
void delay()
{
vu32 i,j;
for (i=0; i<0xfff; i++)
{
for (j=0; j<0xff; j++);
}
}
void SysTick_Config(void)
{
SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK);
SysTick_SetReload(720000);
SysTick_ITConfig(ENABLE);
SysTick_CounterCmd(SysTick_Counter_Enable);
}
void Led_Config(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7 | GPIO_Pin_4 | GPIO_Pin_5;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOC, &GPIO_InitStructure);
}
void Led_RW_ON(void)
{
switch(count)
{
case GPIO_Pin_4:
{
GPIO_SetBits(GPIOC,GPIO_Pin_4 );
count = GPIO_Pin_5;
}break;
case GPIO_Pin_5:
{
GPIO_SetBits(GPIOC,GPIO_Pin_5 );
count = GPIO_Pin_6;
}break;
case GPIO_Pin_6:
{
GPIO_SetBits(GPIOC,GPIO_Pin_6 );
count = GPIO_Pin_7;
}break;
case GPIO_Pin_7:
{
GPIO_SetBits(GPIOC,GPIO_Pin_7 );
count = GPIO_Pin_4;
}break;
default :
{
count = GPIO_Pin_4;
}break;
}
}
int main(void)
{
SysTick_Config();
Led_Config();
while(1)
{
Led_RW_ON();
delay();
}
}
编译提示:
Building configuration: project - Debug
Updating build tree...
main.c
Linking
Error[e46]: Undefined external "GPIOC" referred in main ( E:SUNKE estiar estDebugObjmain.r79 )
Error[e46]: Undefined external "assert_param" referred in stm32f10x_gpio ( E:SUNKE estiar estDebugObj
stm32f10x_gpio.r79 )
Error[e46]: Undefined external "RCC" referred in stm32f10x_rcc ( E:SUNKE estiar estDebugObjstm32f10x_rcc.r79
)
Error[e46]: Undefined external "SysTick" referred in stm32f10x_systick ( E:SUNKE estiar estDebugObj
stm32f10x_systick.r79 )
Total number of errors: 4
Total number of warnings: 0