Hello, I am using e2 studio compiler and RL78 G13 MCU.
I have a program where I get a floating value. But at the moment of wanting to observe it via serial and use the expression
sprintf (temp_Buff, "% f", Spare_Power);
The program freezes and there is no way out of there.
Translated with Google translator hahaha
I did try to reproduce the raised issue but, as far as I've seen, sprintf() implementation does work as specified under the latest RL78's CC-RL compiler.
Yet so, I'd recommend for you to consider using snprintf() instead for such operations, as it helps to prevent buffer overflows.
I've also noticed a <blank_space> between % and f within your formatting string. It is actually %f (altogether).
Here is the minimal code snippet which I used when trying to reproduce the issue alongside its resulting buffer.
In reply to Felipe T :
In reply to Romeo Reyes Badillo:
Thanks for this clarification. I could not reproduce the issue in the latest GNURL78 toolchain as well (v18.104.22.168703).
The sprintf() function from the optimized library does work. The sprintf() from the newlib does work.
I am unable to reproduce this issue at this end. Feel free to share the minimal code snippet which reproduces the issue.
For issues specific to the GCC libraries function implementations for Renesas MCUs I'd also recommend this forum
from the maintainers of the Renesas GCC toolchains.