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 like the following way of measuring stack utilization. In your startup code, fill the stack space with a known pattern (like 0xDEADBEEF or whatever.) With the in-circuit debugger attached, run your application, try to induce maximum stack usage. After a while, stop the application and inspect stack space in the memory window of the debugger. This will give you the exact stack space requirement for this application run. The maximum theoretical stack space requirement will likely be greater, of course. Some compilers can estimate that, by the way. Nevertheless, it's a direct measurement.

Reply
  • I like the following way of measuring stack utilization. In your startup code, fill the stack space with a known pattern (like 0xDEADBEEF or whatever.) With the in-circuit debugger attached, run your application, try to induce maximum stack usage. After a while, stop the application and inspect stack space in the memory window of the debugger. This will give you the exact stack space requirement for this application run. The maximum theoretical stack space requirement will likely be greater, of course. Some compilers can estimate that, by the way. Nevertheless, it's a direct measurement.

Children
No data