K60 PE Micro debugging not working console using printf

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

K60 PE Micro debugging not working console using printf

Jump to solution
2,177 Views
lijofrancis
Contributor III

Dear Sir

    when i was using K40 using jlink segger i can monitor using console using printf. now i am using TWR K60F120M .But using printf in K60 i get only one character

for example printf("hello"); it print only h

in for loop it print like that

h

h

h

h

please tell me the reason

semi hosting console print only one character.it  not takes other character

please reply its urgent thank you

Labels (1)
1 Solution
1,285 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Lijo,

Please take a look to the following post, it is related to your problem:

KDS printf issues with -nanolibc

As Erich Styger mentions, the parameter count for the character count to send out the UART is set to 1 when -nanolibc, no matter what the length of the printf string is.  If you remove the linker option -nanolibc and debug, the character count is passed correctly as expected. The reason is that the newlib-nano is optimized for size/space to fit better smaller embedded devices. So the library implementation avoids buffering if possible. Instead, it writes characters by characters.

Hope it helps!

Best Regards,

Carlos Mendoza

Technical Support Engineer

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
9 Replies
1,285 Views
yasuhikokoumoto
Senior Contributor I

Hello Lijo,

I think the same binaries would be used because the pin assignments of K40 and K60 would be different.

If you will  use the K60 sample code  http://cache.freescale.com/files/microcontrollers/software/app_software/code_examples/KINETIS_120MHZ...

from the freescale, you could use a printf function.

Doesn't  this match to your purpose?

Best regards,

Yasuhiko Koumoto.

0 Kudos
1,285 Views
lijofrancis
Contributor III

dear sir,

printf is using semihosting console.is it dependent firmware/sample code.i  enable  this  by debugger settings

then how it will get using sample code please tell me its urgent.

0 Kudos
1,285 Views
yasuhikokoumoto
Senior Contributor I

Hello Lijo,

I'm very sorry but I have not used KDS_2.0.0. I cannot reproduce your situation. Also, I cannot guess the cause of it.

By the way, was the K40 case also done with KDS_2.0.0?

Best regards.

Yasuhiko Koumoto.

0 Kudos
1,285 Views
lijofrancis
Contributor III

hello sir,

  k40 board have no problem with printf .it prints all the character that puts on.but k60 tower board(on board OSJTAG)  prints only one character and it goes to new line automatically.

i think for KDS this problem may be common with K60 (twr k60f120m) tower board .if you have K60 tower board you can check it .its common .you dont have to create the situation .please sir i am not using uart debugg port .for our project we utilize that semihosting facility thats the one of the reason we choose k60 for our project.and KDS 2.0.0. is free to download from freescale site

0 Kudos
1,286 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Lijo,

Please take a look to the following post, it is related to your problem:

KDS printf issues with -nanolibc

As Erich Styger mentions, the parameter count for the character count to send out the UART is set to 1 when -nanolibc, no matter what the length of the printf string is.  If you remove the linker option -nanolibc and debug, the character count is passed correctly as expected. The reason is that the newlib-nano is optimized for size/space to fit better smaller embedded devices. So the library implementation avoids buffering if possible. Instead, it writes characters by characters.

Hope it helps!

Best Regards,

Carlos Mendoza

Technical Support Engineer

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,285 Views
lijofrancis
Contributor III

Dear sir

I am not using any sample code .i am using simple code by choosing controller of tower board.

The problem not pin assignment. The problem may be kinetics Design studio with PE micro programmer(on board).

Please tell me when using PE Micro debugger with semihosting console what happens .It is the problem

0 Kudos
1,285 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Lijo,

Could you tell us which IDE are you using?

Best Regards,

Carlos Mendoza

Technical Support Engineer

0 Kudos
1,285 Views
lijofrancis
Contributor III

dear sir,

please reply its urgent thank you

0 Kudos
1,285 Views
lijofrancis
Contributor III

Hai Sir,

i am using kinetic design studio (KDS-v2.0.0) using TWR-KF120M tower board.with on-board OSJTAG(P&E Micro) circuit .i enabled semi hosting using telnet on debugg setting to monitor register value using semihosting console.

when i was using K40 with segger jlink i able to use it.

But when i am using TWR-KF120M OSJTAG P&E Micro it print only one character

for example printf("value=%d",100);

the result it print only     v

if i am using printf("\nhai");

it prints    \

please tell me how to solve this

0 Kudos