lpcware

LPC1114 hard fault issue

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by karthik.s on Mon Jul 26 04:16:12 MST 2010
I am running an application on LPC1114 device.On running the application code,the program is getting halted at HardFault_Handler() routine at the brace marked in red.
void HardFault_Handler(void)
[COLOR=Red][B]{[/B][/COLOR]
    //
    // Enter an infinite loop.
    //
    while(1)
    {
    }
}
After pushing "F5" to step into,the program halts at a user defined function(does dynamic memort allocation) at the line highlighted in red.The function is as follows.

void *RSI_user_malloc(uint32_t bytes) /* This function is registered by the user for allocating  the dynamic memory */
{
  void *dynamic_data;
  [COLOR=Red]dynamic_data[/COLOR] = (void *)malloc([COLOR=DarkOrchid]bytes[/COLOR]);
  return dynamic_data;

}

When i checked the content of "bytes" variable, it displays it to be 293.I am wondering if my heap memory is not sufficient to allocate memory equivalent to 293 bytes.

Any help is appreciated.

Outcomes