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

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

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

1,391 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
Reply
2 Replies

1,161 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
Reply

1,161 Views
wenhongkui
Contributor II

thank you!

wenhk@ejlae.com

0 Kudos
Reply