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

Problem with atof function

Hello,

I am writing a program with using RTX. I want to convert ascii buffer into a float using atof in a task. But this function works unreliable, program hang. If I try to debug this situation with jtag, problem never happen.
I have replaced atof to atoi and then program start working, but I need some solution for converting string to float.

microcontroller - ARM7, LPC2368
Keil - 3.80

May someone give me an idea?

Parents
  • I have replaced atof to atoi and then program start working, but I need some solution for converting string to float.

    Just wanted to clarify. Most likely, abandoning atof() will not eliminate the bug. It will just remove this particular trigger of the underlying bug. The bug could still be triggered by something else, like a rare, hard to reproduce event. That would make it far more difficult to debug.
    You are lucky to have an easily reproducible bug. As Tamir suggested, you should spend some time collecting information about the problem. Debugging, basically...
    So far, the problem description is too vague to give much useful advice.

Reply
  • I have replaced atof to atoi and then program start working, but I need some solution for converting string to float.

    Just wanted to clarify. Most likely, abandoning atof() will not eliminate the bug. It will just remove this particular trigger of the underlying bug. The bug could still be triggered by something else, like a rare, hard to reproduce event. That would make it far more difficult to debug.
    You are lucky to have an easily reproducible bug. As Tamir suggested, you should spend some time collecting information about the problem. Debugging, basically...
    So far, the problem description is too vague to give much useful advice.

Children
No data