向LM3S615debug程序时需要将里边的原有程序擦除吗?debug上的程序出现cannot load from non-primitive location
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "gpio.h"
#include "sysctl.h"
#define PINS GPIO_PIN_5
void delay(int d)
{
for(;d;--d);
}
//void SysCtlClockSet(unsigned long ulConfig)
//{}
//void SysCtlPeripheralEnable (unsigned long ulPeripheral)
//{}
//void GPIODirModeSet(unsigned long ulPort,unsigned char ucPins,unsigned long ulPinIO)
//{}
//void GPIOPinWrite(unsigned long ulPort, unsigned char ucPins, unsigned char ucVal)
//{}
int main(void)
{
unsigned int i;
SysCtlClockSet(SYSCTL_SYSDIV_1|SYSCTL_USE_OSC|SYSCTL_OSC_MAIN|SYSCTL_XTAL_6MHZ);//直接使用外部晶振
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);//使能GPIO的PA模块
GPIODirModeSet(GPIO_PORTA_BASE,PINS,GPIO_DIR_MODE_OUT);//设置PA5输出
for(i=0;i<10;i++);
{
GPIOPinWrite(GPIO_PORTA_BASE,PINS,0x0);//置PA5低电平
delay(20000);
GPIOPinWrite(GPIO_PORTA_BASE,PINS,0x1);//置PA5高电平
delay(20000);
}
SysCtlClockSet(SYSCTL_SYSDIV_1|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_6MHZ);//使用PLL
for(i=0;i<10;i++)
{GPIOPinWrite(GPIO_PORTA_BASE,PINS,PINS);
delay(20000);
GPIOPinWrite(GPIO_PORTA_BASE,PINS,PINS);
delay(20000);
}
return 0;
}
ccs v5编译环境 |