请教各位高手:我的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();
 }
 
    }

 
					
				
 
			
			
			
						
			 
					
				

 谢谢你啊    果然是这里出错了   真的很感谢  现在我成功了
谢谢你啊    果然是这里出错了   真的很感谢  现在我成功了 我要赚赏金
 我要赚赏金 STM32
STM32 MCU
MCU 通讯及无线技术
通讯及无线技术 物联网技术
物联网技术 电子DIY
电子DIY 板卡试用
板卡试用 基础知识
基础知识 软件与操作系统
软件与操作系统 我爱生活
我爱生活 小e食堂
小e食堂

