AnsweredAssumed Answered

Unable to sprintf float value with redlib(semihost-nf)

Question asked by Grzegorz Mikitiuk on Jun 30, 2020
Latest reply on Jun 30, 2020 by Zhiqun Hu

Hi,

 

I'm struggling to sprintf a float value with redlib(semihost-nf). What i've done:

- set PRINTF_FLOAT_ENABLE=1

- set SCANF_FLOAT_ENABLE=1

- removed CR_INTEGER_PRINTF

 

 

Example code:

char text_buffer[64]

snprintf(text_buffer, sizeof(text_buffer), "declination: %.2f\r\n" , 5.25);

 

Any ideas what else might be wrong?

It's working on newlib(semihost) but semihosting on that lib is just too slow and i would rather to stay on redlib.

Outcomes