Viewing output of printf in Kinetis Design Studio's Console

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

Viewing output of printf in Kinetis Design Studio's Console

4,058 Views
pedrovalladares
Contributor II

I am using the Windows version 3.2.0 of Kinetis Design Studio with SDK2.0 and I want to be able to send my debug printf's to the IDE's console not the UART's. When I create a project, it always seems to assume the user wants to use the UART as output and I have not figured out how to change that. Is there a way to send my prints to the IDE's console window? I am using the KL82z dev kit. I tried commenting out the call to the debug console init, but that only stops my printf's showing in the UART terminal.

Thanks in advance!

Labels (1)
Tags (4)
4 Replies

1,917 Views
BlackNight
NXP Employee
NXP Employee

Hello,

semihosting (printing through interrupts and the debug connection) is different depending on which SDK version you are using. I assume you are using the SDK V2, then have a look how I managed it to get it working: Semihosting (again!) with NXP Kinetis SDK V2.0 | MCU on Eclipse 

If using a Segger probe, I recommend to use the Segger RTT instead: it is much faster, much less intrusive and it simply works with and without the SDK: Using Segger Real Time Terminal (RTT) with Eclipse | MCU on Eclipse 

You can use either the Segger viewer, or any telnet client.

I hope this helps,

Erich

1,917 Views
danieltruong
Contributor IV

Hi Erich,

I followed your recommendation using Segger RTT. It finally works for me with the telnet client.

However, I had to exclude the file "SEGGER_RTT_Syscalls_GCC.c" out of build otherwise the KDS builder gave me error. Don't know what I'd be missing out without that file. But so far it's been working with 2 commands I use the most (SEGGER_RTT_WriteString, SEGGER_RTT_printf).

Thank you so much for your valuable contribution to the community!

-Daniel

0 Kudos

1,917 Views
danieltruong
Contributor IV

Hi Pedro,

I'm just wondering whether or not you have found the solution. If you have, could you please kindly share it to me? I'm currently having same problem. I'm using FRDM-KL26Z4 board connected to a 3rd-party debug probe (Segger J-Link) via SWD. I choose not to use the default USB-OpenSDA via UART0 on this development board, because my eventual target board does not have this connection and I want to build a generic method of printing debug messages that apply to both the FRDM-KL26Z4 board and my target board.

BTW, I followed the app note "How to use printf() to print string to Console and UART in KDS2.0" but could never make it to work.

Thanks,

--Daniel

0 Kudos

1,917 Views
ivadorazinova
NXP Employee
NXP Employee

Hi Pedro.

Please, refer to How to use printf() to print string to Console and UART in KDS2.0

I hope it helps you.

Best Regards,

Iva

0 Kudos