I am using the combination listed in subject. When running my hardware connected to E2-Lite, strtof(pRxD,&pEnd) works fine. After disconnecting the emulator (reset), it still works. After making a reset pulling down the reset-pin, it still works. After disconnecting power, my programm runs except strtof() an delivers pEnd == pRxD. I replaced strtof() by strtod(), this works in any case. Measuring the time used by the functions, strtod() takes about 2ms, strtof() about 40us if it works, after power on reset 10us.
Since that I would prefer strtof(), but I have no idea why it does not work.
Thanks for the help, if you can help.
Hello Chris,
Do you use your customized board or a Renesas board with RX140?
Also, after disconnecting power and connecting it again, did you implement a reset condition and observe the strtof behavior after the reset?
Finally, can you please attach your project to check it in detail?
Regards,
AL_Renesas
I started with a Renesas board (RTK5RX1400C...) and transfered the program to a customized board with a R5F51405A. I am using the Smart Configurator and did not implement a reset condition. Programming is done actually over the 3 wire interface (mode and reset pin).
What I have seen so far is that strtof does not appear in the CFI Table List, in contrast to strtod or strtol.
Regards
Chris
Hi Chris,
Thanks for the information. Can you share your project to speed up the support?
I played with this a little bit, and found some strange behavior depending on the compiler options ("-lang" & "-dbl_size" in particular).
The "stdlib.h" header file is very difficult to interpret with all of the various conditional options, but it appears that for the "float" version the "strtof" is implemented via an inline function that calls some lib function "__Stof()" that is unresolved in my link without some special mechanism to include the right lib.
But "strtod()" is implemented directly as a lib function, and it seems to always work as far as I can tell.
I believe that as far as the standard C-lib goes, "strtod()" is a supported function while "strtof()" is an extension and not part of the standard lib. I'm not sure why these implementations would be different, especially when doubles are treated as floats and would essentially have identical behavior..
Without having a project from you to demonstrate the issue, or knowing all of your project build options and a particular test case to demonstrate this issue, it is difficult to determine what might be the problem for your use case.
Thank you for your investigations so far. The behavior is strange, but I would like to use strtof() instead of strtod(). Which files of the project do you need for more investigations.
Christian
I would need your compiler / build options to ensure we are testing under the same environment. A sample of a string that causes the issue would be helpful.