Imxrt1064 hardfault handler error

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Imxrt1064 hardfault handler error

2,838 次查看
vasudhevan
Contributor V

Hi,

     Board = IMXRT1064 evk

     RAM = OCRAM

     Disabled:

           SCB_DisableICache();

           SCB_DisableDCache();

     When we trying to access structure that time hard fault error occurring.

   Example :

      

typedef struct test_stat_t
{
    uint8_t ip_status;
    uint8_t test_data1;
    uint8_t test_data2;
}test_stat;



void *test_thread(void *arg)
{
   test_stat *data;

   data->ip_status = 1;          // Occurs hardfault handler error 
   data->test_data1 = 10;        // Occurs hardfault handler error 
   data->test_data2 = 20;        // Occurs hardfault handler error 



}

     This thread stack size increased upto 5k but still this error occurs.

     This code syntactically correct but why hard fault error occurs ?

     If we run application on OCRAM (or) SDRAM what are memory configuration we have to change including lwip ?

     How to solve this issue ?

Thanks & Regards,

        Vasu

标签 (1)
标记 (1)
0 项奖励
回复
3 回复数

2,651 次查看
crist_xu
NXP Employee
NXP Employee

Maybe an Unaligned error, so Please check the MPU configuration.

0 项奖励
回复

2,728 次查看
mjbcswitzerland
Specialist V

Hi

The code

   test_stat *data;

   data->ip_status = 1;          // Occurs hardfault handler error 

may not give a compiler "error" but I'm certain that there is a compiler "warning" about using an uninitialised pointer that is almost certainly going to cause a hard fault (or random undefined behavior) when executed. Or is the "example" not accurate???

Regards

Mark

0 项奖励
回复

2,728 次查看
carstengroen
Senior Contributor II

What is the pointer "data" assigned (pointing) to ?

0 项奖励
回复