s32k printf("%.2X",0x12); nothing is ouput , other is ok.

cancel
Showing results for 
Search instead for 
Did you mean: 

s32k printf("%.2X",0x12); nothing is ouput , other is ok.

419 Views
wenhongkui
Contributor II

I change example "LPUART.zip" 

printf("Running LPUART example\r\n");
printf("This is printf formating example string %d\r\n",10);

printf("%.2X",10);
for(;;) {

}

but is result is 

Running LPUARunning LPUART example
This is printf formating example string 10

0 Kudos
2 Replies

189 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

for printing without \r\n at the end you need to use fflush(stdout); function like this:

printf("Running LPUART example\r\n");
printf("This is printf formating example string %d\r\n",10);

printf("%.2X",10);
fflush(stdout);

Here is output of your project in terminal: 
pastedImage_12.png

Without fflush or \r\n - the last line is not printed. 

Jiri

0 Kudos

189 Views
wenhongkui
Contributor II

thank you!

wenhk@ejlae.com

0 Kudos