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
Maybe an Unaligned error, so Please check the MPU configuration.
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
What is the pointer "data" assigned (pointing) to ?