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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

ソリューションへジャンプ
1,765件の閲覧回数
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,309件の閲覧回数
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,310件の閲覧回数
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,309件の閲覧回数
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,309件の閲覧回数
saya
Contributor III

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

0 件の賞賛
1,309件の閲覧回数
BlackNight
NXP Employee
NXP Employee

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

0 件の賞賛