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

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

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

1,392 次查看
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 项奖励
回复
2 回复数

1,162 次查看
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 项奖励
回复

1,162 次查看
wenhongkui
Contributor II

thank you!

wenhk@ejlae.com

0 项奖励
回复