当前位置: 代码迷 >> 驱动开发 >> MDK调试有关问题* error 65: access violation at 0x00000000 : no 'execute/read' permissi
  详细解决方案

MDK调试有关问题* error 65: access violation at 0x00000000 : no 'execute/read' permissi

热度:765   发布时间:2016-04-28 10:11:17.0
MDK调试问题*** error 65: access violation at 0x00000000 : no 'execute/read' permissi
今天使用mdk调试的时候发现这个bug,求帮忙
*** error 65: access violation at 0x00000000 : no 'execute/read' permission


这是代码
 main.c文件内容:


 

#include<s3c2440.h>
 #include"timer.h"
 #include"led.h"

int main()
 {    
      int flag=0;
      Led_Init();  
     Timer0_Init();  
      {
         if(SRCPND&(1<<10))   
         {                                     
              flag=!flag;                  
              SRCPND|=(1<<10);     
          }
          if(1==flag)                     

                                             
         {
             Led1_On();
         }  
         else
        {
            Led1_Off();
         }
        }
 }

 

    timer.c文件内容

 

            #include<s3c2440.h>  
             #include"timer.h"


 
 void Timer0_Init(void)
 {
  TCFG0&=~(0xff);        
  TCFG0|=99;

 TCFG1&=~(0xf);           
  TCFG1|=0x02;               

 TCNTB0=62500;          

 TCON|=(1<<1);                                              
  TCON=0x09;                                                                                 
 }

   timer.h文件内容:

       


#ifndef __TIMER_H__
 #define __TIMER_H__


 void Timer0_Init(void);

#endif

   led.c文件内容:


 

#include<s3c2440.h>  
 #include"led.h"
 void Led_Init(void)
 {
  GPBCON&=~((3<<10)|(3<<12)|(3<<14)|(3<<16));  
  GPBCON|=((1<<10)|(1<<12)|(1<<14)|(1<<16));     

 GPBUP&=~((1<<5)|(1<<6)|(1<<7)|(1<<8));       

 GPBDAT|=((1<<5)|(1<<6)|(1<<7)|(1<<8));    

    led.h文件内容:


#ifndef __LED_H__
 #define __LED_H__

#define Led1_On() {GPBDAT&=(~(1<<5));}     
 #define Led1_Off() {GPBDAT|=(1<<5);}        
 #define Led2_On() {GPBDAT&=(~(1<<6));}    
 #define Led2_Off() {GPBDAT|=(1<<6);}         
 #define Led3_On() {GPBDAT&=(~(1<<7));}
 #define Led3_Off() {GPBDAT|=(1<<7);}
 #define Led4_On() {GPBDAT&=(~(1<<8));}
 #define Led4_Off() {GPBDAT|=(1<<8);}
/***************************************************************
 * 函数名称:void Led_Init(void)
 * 参数说明:无
  相关解决方案