Imxrt1064 hardfault handler error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Imxrt1064 hardfault handler error

1,549 Views
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

Labels (1)
Tags (1)
0 Kudos
Reply
3 Replies

1,362 Views
crist_xu
NXP Employee
NXP Employee

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

0 Kudos
Reply

1,439 Views
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 Kudos
Reply

1,439 Views
carstengroen
Senior Contributor II

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

0 Kudos
Reply