This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Error when using sin() function

I'm trying to use sine function such as: S = sin(0.8)

Fullscreen
1
2
3
4
5
6
7
8
#include <math.h>
#include <stdint.h>
float S=1;
void main (void)
{
S=sin(0.5);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


But variable S come to zero after this code. Go to Debug mode and add a break point to view the change of variable, i detected that the chip went to NRF_BREAKPOINT_COND; in app_error_weak.c after run S=sin(0.5); So i determined the error come from sin() function.

Fullscreen
1
2
NRF_BREAKPOINT_COND;
// On assert, the system can only recover with a reset.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Does anyone get the same problem?

I'm using NRF52832 with nRF5 SDK v15.0.0 on KeilC IDE, please help me. Thanks