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

float struct works in debug, not in flash build..?

Using RTX, and a few simple tasks. I have a global data structure, with a few floating point elements. Can't figure out why it works great in debug but produces no results in the downloaded flash build. e.g. the conditional check in the code below will always work in debug, but NOT in the flash build:

//In the header:

typedef struct {
  float X,
  float Y
} POSITION

//=====================
//In the .c file:

POSITION pos;

void TaskfunctionName(void)
{
  while (1) {

    // Get some values, store to POSITION struct..
    getValues();

    // this check will always show pos.X is NaN, if NOT in debug!
    if (pos.X != NaN) doSomething();
    else screamForHelp();
  }
}

int getValues(void)
{
  pos.X = 0.1f;
  pos.Y = 0.2f;
}
//======================

So.. Anyone have any ideas? I have checked / increased the stack sizes, tried using software FP instead of HW FPU ARM support in the build, and tried aligning / manually packing the structure, to no avail..