Tool/software: Code Composer Studio
Hello all,
I am using CCSv8 for CC3200 controller. In my firmware I am doing floating point calculations. I changed the floating point options from Vfplib to FPv4SPD16, after doing this my program is going into FAULT ISR routine where it stucks into while() loop. So, I tried to debug the issue whether there is something in my firmware, I found it is going into fault ISR while executing particular function call.
As VFPLIB is deprecated, so I changed it to supporting one. Here is my code snippet in which fault is generating,
int32_t phCoeffCalc(int32_t AEcnt, int32_t REcnt) { double w, frac_num, pherr, sinres, cosres, taninvres; int32_t res; w = (2.0 * 3.141592654 * FUND_FREQUENCY)/SAMP_FREQUENCY; sinres = sin((PH_CALIB_ANGLE * 3.141592654) / 180.00); cosres = cos((PH_CALIB_ANGLE * 3.141592654) / 180.00); taninvres = ((((double)AEcnt * sinres ) - ((double)REcnt * cosres))/(((double)REcnt * sinres) + ((double)AEcnt * cosres))); pherr = (atan(taninvres) * 180.0) / 3.141592654; frac_num = (sin(((pherr * 3.141592654)/180.00) + 3.00 * w) - sin(w))/(sin(((pherr * 3.141592654)/180.00)) + 4 * w); // UART_PRINT("W: %f B: %f PHErr: %f\r\n", w, frac_num, pherr); UART_PRINT("PHErr: %f\t", pherr); if(frac_num >= 0) { res = (int32_t) 8388608.00 * frac_num; } else { res = (int32_t) 8388608.00 + 268435456.00 * frac_num; } return res; }
So please suggest me where I have to look into to resolve that issue. Your early suggestions will be appreciated :)
Thank you & reagrds
Shubham