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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

ソリューションへジャンプ
2,239件の閲覧回数
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,

ラベル(1)
1 解決策
1,734件の閲覧回数
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 件の賞賛
返信
3 返答(返信)
1,735件の閲覧回数
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 件の賞賛
返信
1,734件の閲覧回数
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 件の賞賛
返信
1,734件の閲覧回数
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.