Hey All,
I came across this issue too and found a couple of solutions that worked for me. Not sure if this topic is still open. But anyway, here's my input.
The traditional solution to this issue in the past has been to define the low-level UART functions *before* the standard library functions. I.e., __read_console, __write_console, and __close_console (see [ewl]/sys/console_io.h) would overwrite the functions of the same name found in the EWL_C library. This also required an "Initialize UART" function to set up the UART settings; i.e., baud, pins, etc. While this solution worked perfectly fine in a *C* project, I discovered some nuances and annoyances when transferring the same working code from a *C* project to a *C++* project.
To overcome this, I discovered a MUCH easier solution, that requires *no* UART set up at all. With the latest release of Codewarrior (version 10.4...must be the one with *out* code size restriction), there's a feature that let's users specify the Console window/tab for I/O! When a creating a new project, all the user has to do is specify the "Developer Console" option instead of the "UART" one under the I/O options. For existing projects, the I/O options can always be changed after the fact by going to the Project Properties (Alt+Enter) --> C/C++ Build --> Librarian:
* ewl_c / ewl_c++ --> this requires the UART code to be defined.
* ewl_c_hosted / ewl_c++_hosted --> no UART code required. stdio will route to the developer's console. no need to open some third-party terminal window and enter COM port settings. (really cool!)
* ewl_c_no_io / ewl_c++_no_io --> disable console I/O altogether? Well, kind of...stdio functions won't be compiled, so all calls to stdio functions will have to be omitted; i.e., #define DBG_PRINT 0 or similar.
I realize that this feature (semihosting) might have been available before, but the latest version of codewarrior (10.4) makes it much more noticeable and easier to use. Some users may have an issue with the slightly slower baud rate, but I don't think this is a huge deal.
Lastly, as a word of caution...be careful with those scanf's and printf's...
I hope this helps,
Rich