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

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

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

Jump to solution
1,752 Views
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 Kudos
1 Solution
1,296 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
4 Replies
1,297 Views
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 Kudos
1,296 Views
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 Kudos
1,296 Views
saya
Contributor III

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

0 Kudos
1,296 Views
BlackNight
NXP Employee
NXP Employee

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

0 Kudos