Hi,
I am playing around with an Qorriva MPC5643L and CW for MCU 10.6. I managed to get output from printf via uart. But theire is
a problem if I use %f in the format string of printf it seems to be ignored:
This works fine:
int val = 0x55; printf("val: %d %x\n", val, 0x55);
and prints out:
"val: 85 55"
but this
printf("Test float %f \n", (double) 128);
only prints out:
"Test float %f"
I stopped debugging printf at a call of:
extern int_t __pformatter(void *(_EWL_CDECL *WriteProc)(void *a, const char_t *b, size_t c), void * WriteProcArg, const char_t * _EWL_RESTRICT format_str, va_list arg, int_t is_secure); //... va_list args; va_start( args, format ); result = __pformatter(__FileWrite, (void *)stdout, format, args, 0);
format is no set, the debugger shows no value for it.
Is there an option I have to turn on or something like that?
Thanks for your help!
Best regards,
Solved! Go to Solution.
Hi
The libraries that I included in my project are:
libm_E200z446_VLE_SPFP_Only.a, and
librt_E200z446_VLE_SPFP_Only.a
Please set Floating Point as "SPFP only" in Project Properties, you can find this setting in <C/C++ Build | Settings | PowerPC CPU> panel. And also please set the Vector Support setting as "SPE", it is <C/C++ Build | Settings | PowerPC Compiler |Processsor> .
If the above does not work, could you please attach a simple example project to reproduce the problem? thank you very much!
Fiona Kuang
Technical Information & Commercial Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi
The libraries that I included in my project are:
libm_E200z446_VLE_SPFP_Only.a, and
librt_E200z446_VLE_SPFP_Only.a
Please set Floating Point as "SPFP only" in Project Properties, you can find this setting in <C/C++ Build | Settings | PowerPC CPU> panel. And also please set the Vector Support setting as "SPE", it is <C/C++ Build | Settings | PowerPC Compiler |Processsor> .
If the above does not work, could you please attach a simple example project to reproduce the problem? thank you very much!
Fiona Kuang
Technical Information & Commercial Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thank you very much for your help.
Sadly my mcu died some days ago (connected the jtag cable the wrong way :smileysad:) I have to replace it before I can try your suggestion. But when I
managed to do that I will report.
Regards
Hi, did you ever resolve this issue? I am facing a similar problem on the MPC5674 and have tried the answer above but still get %f displayed.