打印

新手,求解决,访问个数组居然进了HardFault_Handler

[复制链接]
177|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
车水马龙|  楼主 | 2018-7-29 20:12 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
int main(void)
{
        unsigned char  Image[20000];
        int a=0,b=0,i=0,k=0,l=0,m=0;
        //u8  ShowBuf[]={"Image Show Test"};

        SystemInit();

        //RCC->APB2ENR|=(1<<0);  //使能AFIO时钟
        RCC->APB2ENR|=(1<<2);  //使能PORTA时钟
        RCC->APB2ENR|=(1<<3);  //使能PORTB时钟
        RCC->APB2ENR|=(1<<4);  //使能PORTC时钟
        RCC->APB2ENR|=(1<<5);  //使能PORTD时钟                    
        RCC->APB2ENR|=(1<<6);  //使能PORTE时钟
        RCC->APB2ENR|=(1<<7);  //使能PORTF时钟
        RCC->APB2ENR|=(1<<8);  //使能PORTG时钟

        GPIO_Init();
        LCD_Init();
        LCD_Clear(WHITE);

                while(1){
                        for(a=0;a<100;a++)
                                for(i=0;i<200;i++)
                                Image[200]=gImage_c1[200];//注释掉就可以运行,没注释掉就会进入HardFault_Handler,gImage_c1[]是一个图片解码数组,里面有20000
                        //                Show_BMP(0,0,100,100,(u8*)&Image[0]);//
               
                                delay(10000);
                }
               
                                
}

使用特权

评论回复

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

474

主题

476

帖子

0

粉丝