MPC5643L: printf (EWL C) seems to ignore %f in format string

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC5643L: printf (EWL C) seems to ignore %f in format string

Jump to solution
1,244 Views
dnnsrmrs
Contributor I

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,

Labels (1)
1 Solution
739 Views
TICS_Fiona
NXP Employee
NXP Employee

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!

-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
740 Views
TICS_Fiona
NXP Employee
NXP Employee

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!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
739 Views
dnnsrmrs
Contributor I

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

0 Kudos
739 Views
mobiusembeddeds
Contributor II

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.