请教各位高手:我的S3C4510B的demo板下,vxworks已经下载成功,我在usrAppInit.c中加进去了点灯测试程序,出现Data abort, Exception address:0x0000c278的错误。
点灯部分程序如下:
#define IOPMOD (*(volatile unsigned *)0x3ff5000)
#define IOPDATA (*(volatile unsigned *)0x3ff5008)
unsigned char ledtab[]={0xfe,0xfd,0xfb,0xf7,
0xef,0xdf,0xbf,0x7f};
void out(unsigned int port,unsigned int val)
{
volatile unsigned *p=(volatile unsigned *)port;
printf("in function :out \n");
*p=val;
printf("leave function :out \n");
}
void ledshow()
{
int i;
struct timespec t;
t.tv_sec = 0;
t.tv_nsec = 500000000;
printf("in function :ledshow \n");
for(i=0;i<8;i++)
{
out(IOPDATA,ledtab[i]);
nanosleep(&t, NULL);
}
printf("leave function :ledshow \n");
}
void usrAppInit (void)
{
#ifdef USER_APPL_INIT
USER_APPL_INIT; /* for backwards compatibility */
#endif
int i=0;
struct timespec t;
t.tv_sec = 0;
t.tv_nsec = 500000000;
/* add application specific code here */
printf("hello!!now run ledshow!\n");
out(IOPMOD,0xff);
while(1)
{
ledshow();
}
}