printf() doesn't print any thing on COM port terminal.

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

printf() doesn't print any thing on COM port terminal.

跳至解决方案
2,308 次查看
saya
Contributor III

Hello, everyone,

 

I am trying to get the printf() function working (I am using the MSCAN driver example as a start point, since will need CAN communication later.)

I have followed couple tutorials, such as Tutorial: Printf() with (and without) Processor Expert | MCU on Eclipse, but I got no luck.

I have used PE to configure ConsoleIO, compiled the program, no error. Flashed into the KEA128, open putty, baud rate 38400. nothing shows on screen.

 

I have attached my project here, any help is appreciated!

 

Alan

Original Attachment has been moved to: MSCAN_KEA128.zip

0 项奖励
回复
1 解答
1,852 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello Alan,

I ever made console printf demo with TRK-KEA board. it works fine on my side.

there is two points we need to pay attention:

1. to have accurate serial baud rate: if  clock ICS mode is FEI, I trim slow internal reference clock to 37.44k. this will get accurate SCI baud clock:

bus clock= 37.44k*1280/2=47.932M 

SCI baud rate = bus clock/39/16=38400

you needn't set baud rate as accurate as above, but if the result deviates more,  the output to screenshot through SCI is messy code per my test.

2. choose right UART port for consolveIO based on the board design.

for example, I use TRK-KEA board, according to schematic, Open SDA CDC uses KEA128 UART2. if you use other UART, CDC can't work.

I attached my testing code. ConsoleIO functions works well with my TRK-KEA board, baud rate is 384000.


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,853 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello Alan,

I ever made console printf demo with TRK-KEA board. it works fine on my side.

there is two points we need to pay attention:

1. to have accurate serial baud rate: if  clock ICS mode is FEI, I trim slow internal reference clock to 37.44k. this will get accurate SCI baud clock:

bus clock= 37.44k*1280/2=47.932M 

SCI baud rate = bus clock/39/16=38400

you needn't set baud rate as accurate as above, but if the result deviates more,  the output to screenshot through SCI is messy code per my test.

2. choose right UART port for consolveIO based on the board design.

for example, I use TRK-KEA board, according to schematic, Open SDA CDC uses KEA128 UART2. if you use other UART, CDC can't work.

I attached my testing code. ConsoleIO functions works well with my TRK-KEA board, baud rate is 384000.


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
1,852 次查看
saya
Contributor III

Hi, Jennie,

Thanks for explaining, I found I was using the wrong UART port. I am trying to trim the Slow internal reference clock to 37.44k in my project, but it won't let me, every time I input the value, it just goes back to its original which is 32.768k. How could I change this setting?

0 项奖励
回复
1,852 次查看
saya
Contributor III

Interesting, now I can change it. And it is working! Thanks again!

0 项奖励
回复
1,852 次查看
BlackNight
NXP Employee
NXP Employee

Can you write directly to the ConsoleIO functions from your application to see if the basics are working?

0 项奖励
回复