This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

HardFault after calling math function

Hi all,

I use µVision 4.73 evaluation version. My target device is LPC4357 (cortex M4).
All works fine, except when I use floating poit math.

volatile float F;

#include <math.h>

int main(void)
{
  SystemInit();
  F = 16.0;
  F = sqrt(F);
}

above is only a snippet of the program.
As soon I call the sqrt() I get a HardFault exception. The compiler uses microlib and no FPU is used. (defining F as double or calling sqrtf() same error).

When I enable the FPU, I get the same error before I reach main...
stack- and heap size are both 0x4000.

Any idea ?

0