I am using an Xmega256D3 using Atmel studio 6.2, AVR/GNU C compiler version 4.8.1 and FreeRTOS. I am running into some weird issue. I have the following code:
if (gas_select <= MAX_GAS_INDEX)
dns = 0;
for (b = 0; b <= 12; b++)
val1 = powf(temp_K, (float)b); //Calculate 12 order polynomial
dns += (prm[b] * val1);
When first entering the loop, temp_K is 273.16 . The result on the first pass should assign val1 to 1 (273.15^0 = 1.0) but I get zero.
When I setup a break point, I get a value of 0 for val1. If I take the statement with val1 and move it into a other task, it works properly. Also the for loop does not show b be incremented
on every loop when using the AVROne debugger.
The code size now is 110986 bytes. I checked all the tasks stack allocations and the total heap size and could not find anything wrong.
Is there anybody that ran into similar problem and figure out how to fix this issue?