**Content originally posted in LPCWare by ArriaLive on Sat Nov 08 17:05:17 MST 2014**

I'm trying to use some fairly basic math.h functions (including sinf() and cosf()) in a project that is running on an LPC4330. I am using the FPv4-SP (Soft ABI) floating point library as recommended by these forums. I can work with float numbers--add, subtract, multiply, divide, etc., but when I add the math.h functions (even in single-precision floating-point mode), I get a hardfault with a NoCP (no coprocessor) fault.

Here's my test code:

/* This one works */

float testfunction(void) {

float a,b;

a = 2.5F;

b = 2.0F*a;

return b;

}

/* This one gets a hard fault (NoCP) */

float testfunction(void) {

float a,b;

a = 2.5F;

b =sinf(a);

return b;

}

Any ideas what I'm doing wrong? Am I missing a parameter somewhere?

Thanks,

Content originally posted in LPCWare by ArriaLive on Sat Nov 08 17:20:42 MST 2014Update:

The first version of my test function above was apparently being optimized out since it always resolved the the same value. Changed the code to this:

float testfunction(float x) {

float a,b;

a = 1.0F + x;

b = 2.0F*a;

return b;

}

This version fails, with or without the math.h functions, with the same NoCP hard fault. Does that suggests that I genuinely don't have a math processor in the 4330--contrary to the documentation? Does that mean that I shouldn't be using the SoftABI floating point library at all--contrary to the documentation? What am I missing?

Thanks,