Solved! Go to Solution.
Crasycat, I have a similar question. I'm using:
CodeWarrior 10.0 Beta 3
DEMOQE128 board
and am building to the MCF51QE128 internal flash target. I've written a simple C++ application that sends some output using "cout", e.g. cout << variable.
First of all, I'd like to be able to to use cout to write to the CW console window, even if there's no DEMOQE128 board connected, but I haven't found yet how to invoke the full chip simulation in the debugger (something that was present in CW 5 and 6). Do you know if CW 10.0 Beta 3 supports simulation?
Second, I haven't found yet how to get a successful build with "cout" in the source. I do have -define CONSOLE_IO_SUPPORT=1 in the compile flags. Here's what goes wrong:
1. If I use #include <iostream> in my source, I get a failure, with "undefined identifier cout" in the compile.
2. If I use <iostream.h> instead, I get these 3 symbols undefined in the link: InitializeUART, ReadUARTN, WriteUARTN
There are 3 files in C:\Program Files\Freescale\CW MCU v10.0\MCU_10.0\ColdFire_Support\ewl\EWL_C\src\coldfire: console_io_cf.c, sci_console_io_cf.c, and uart_console_io_cf.c, but I don't see how they would help.
Am I missing additional includes in my build? Additional sources? Help would be appreciated. Thanks!
Follow-up: If I use #include <iostream> but add the statement using namespace std; "cout" is recognized by the compiler, but then I get the same 3 symbols undefined in the link: InitializeUART, ReadUARTN, and WriteUARTN.
Again, my objective is to get "cout" output to the console window in the debugger, not to the actual UART hardware.
2nd follow-up: Adding a copy of
C:\Program Files\Freescale\CW MCU v10.0\MCU_10.0\ColdFire_Support\ewl\EWL_C\src\coldfire: console_io_cf.c
to my build fixed the message about the 3 underined symbols, and got me a good build. Whether it will succeed in sending "cout" output to the console remains to be seen; I'm working on another unrelated problem now, which I'll post under a different heading elsewhere.
Ok. I've got console_io_cf.c included in my build, and it issues a Trap 14 when it wants to perform console output. However, immediately after it does so, CW 10.0 beta 3 reports that the USB interface reports "Not ready", and the debug session halts. What do I need to change in Processor Expert and/or the Debug Configuration to handle the Trap 14?
1. Processor Expert's Trap 14 is currently disabled; if enabled, it would generate an exception vector entry for that trap... but where should that vector point? Is there an exception handler for Trap 14 that I'm not including in my build?
2. Debug Environment currently has both "Terminate on Trap 14" and "User Application Handles Trap 14" checked. Making changes in either of both of those doesn't currently help.
Wayne