Hi,
I'm using S32K144 and want to use printf/scanf functions for testing purpose. I want to print some data on UART terminal (Teraterm).
To use printf function EWL library is used but while creating new S32DS project there is no option to select library. Also there is no option to select EWL library in project properties->settings->Target Processor.
Can I use printf/scanf without EWL library? Is there any other way to print data on UART terminal.
I'm using,
S32DS v3.5
Toolchain - NXP GCC 10.2 for Arm 32-bit bare metal
Hi @jiri_kral
I don't want to use semihosting console, I want to print data on debugger console. But there is no option for ewl_c Debugger console library in project settings (properties->settings->Target Processor->Libraries Support).
Please guide me with this.
Hi,
EWL C Library is not supported by S32DS v3.5. But both STD C libraries are using the same Debug output to Semihosting Console (which is different name for Debugger Console).
Or what you mean by Debugger Console?
The right NewLib version is this one:
Hi,
okay, I see. For this you need to use NewLib with no I/O support and implement _read and _write functions as described in post bellow - https://community.nxp.com/t5/S32K/Not-able-to-use-printf-scanf-functionality-in-S32DS/m-p/1875490/hi...
Hi @jiri_kral
It will be helpful if you can share example project in which NewLib with no I/O support library is used for printf (to print on UART).
Hi,
I don't have such example project. You can simply use some existing UART example and implement _write and _read functions by the same way as it is in Example shared with the previous link.
Hi,
for printf/scanf via UART you need to implement
int _write(int handle, char * buffer, int * count)
int _read(int handle, char * buffer, int * count)
Functions and use NewLib no I/O std C library. Here is example for EWL library - the difference is only in read/write function name - https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/EXAMPLE-S32k144-UART-printf-scanf-unde...
If you are okay with Semihosting Console, you can link to your project NewLib_Semihosting: