when i download kinetis sdk (via sdk generator), there is demo apps.
and default printf function in demo app's output is directed to UART1.
i want to redirect printf function to SWO output (j-link). but i can't find it.
MCUXpresso configtool has no SWO feature (peripherals)
and also SDK generator does not have it.
so, for redirect printf output to SWO,
That very much depends on your standard I/O library implementation.
I'm using MCUXpresso IDE 10.3.1 and it has an option to redirect printf() to SWO, see section "SWO (Single Wire Output" in New NXP MCUXpresso IDE V10.3.0 Release | MCU on Eclipse.
For IAR you could copy that code or you might use the code snippets from Tutorial: Using Single Wire Output SWO with ARM Cortex-M and Eclipse | MCU on Eclipse .
I hope this helps,
Erich
thanks Erich Styger.
i try build project on MCUXpresso IDE.
as you mentioned, check redirect option and create new project.
(but, there is no "SWO" related options)
and printf still not work.
i think the macro defined in "serial_manager.h" is wrong.
"SERIAL_PORT_TYPE_SWO" should be "1".
but if i change this value to "1" (and "SERIAL_PORT_TYPE_UART" are "0" ), build error occurs.
fatal error: serial_port_swo.h: No such file or directory
i can't find "serial_port_swo.h" anywhere.
it seems to be generated by MCUXpresso IDE.