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

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

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

Jump to solution
2,966 Views
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

Labels (1)
0 Kudos
1 Solution
2,000 Views
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

View solution in original post

0 Kudos
3 Replies
2,002 Views
marceli1
Contributor III

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

2,002 Views
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 Kudos
2,001 Views
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 Kudos