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

floating point in cortex m0, always reset.

hi,I write an algorithm running in cortex M0. It has some floating point multiplication.But the program always resets when encounter a floating point multiplication.And the code showed below:

    for (k = 0; k < 4; k++) {
                        tmpx =   dbuffer[0] * a[k + 1];
                        dbuffer[k + 1] = dbuffer[k + 1] - tmpx;
    }


dbuffer[] and a[] are float array. tmpx is a float variable. When I debug the program, the M0 resets at line "tmpx = dbuffer[0] * a[k + 1];" .And the value of dbuffer[0] is 1429983,a[k+1] is 0.00974910986.
I have tested this multiplication in a new project.And the code goes well and result is right.The test code is like below:

            float a = 1429983;
            float b = 0.00974910986;
            float c;
            c = a* b;


So, I know M0 use softVFP. I have seen asm code such as __aeabi_fmul corresponding to my code.
Could anybody tell me what's wrong with my code?
Thank you very much.

Parents
  • I suggest that you single step through the assembly instructions of the source line and post these assembly instructions along with the instruction causes the reset to this forum.

    Information like the register values of the related registers would help too.

Reply
  • I suggest that you single step through the assembly instructions of the source line and post these assembly instructions along with the instruction causes the reset to this forum.

    Information like the register values of the related registers would help too.

Children