error: "undefined reference to __pformatter" when using sprintf with CodeWarrior

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

error: "undefined reference to __pformatter" when using sprintf with CodeWarrior

跳至解决方案
3,192 次查看
lukaszpacyga
Contributor I

Hi,

I can not build c "Bareboard" project when using sprintf with additional parameters in code. For example:

sprintf(RadioTransmitBuff, "%d\n\r", temperature);

This line causes following error during build:

ARM_GCC_Support/ewl/EWL_C/src/stdio/vsnprintf.c:58: undefined reference to `__pformatter'

mingw32-make: *** [Testing_Sprintf.elf] Error 1

 

Project builds fine if there is no additional parameters:

sprintf(RadioTransmitBuff, "Hallo\n\r");

 

I used sprintf with Kinetis Design Studio without any problems therefore it must be something to do with CodeWarrior IDE.

Im using CodeWarrior for MCU Version: 10.6

 

I hope someone can advice?

 

Many thanks

Lukasz

标签 (1)
0 项奖励
回复
1 解答
2,226 次查看
lukaszpacyga
Contributor I

Thank you Alice for interest.

I have been using KL25Z128 with PE.

Experimentally I figured out the cause of the problem:

It was to do with "I/O support" option during new project setup.

For full support of stdio.h library a "I/O support: UART" option need to be selected.

I found more information on the various options during project setup here:

Tutorial: Printf() with (and without) Processor Expert | MCU on Eclipse

在原帖中查看解决方案

0 项奖励
回复
3 回复数
2,228 次查看
marceli1
Contributor III

It fix when change Settings/Librarian back to "ewl" from ewl-noio. I thelps with any printf type as sprintf.  

2,228 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Lukasz,

Please tell me which chip , and about your project information , for example , with PE or bare board project ?

And do  you sprinft show the result to UART or console window ?  Thank ! I will test it on my side .

BR

Alice

0 项奖励
回复
2,227 次查看
lukaszpacyga
Contributor I

Thank you Alice for interest.

I have been using KL25Z128 with PE.

Experimentally I figured out the cause of the problem:

It was to do with "I/O support" option during new project setup.

For full support of stdio.h library a "I/O support: UART" option need to be selected.

I found more information on the various options during project setup here:

Tutorial: Printf() with (and without) Processor Expert | MCU on Eclipse

0 项奖励
回复