The following methods are two ways of establishing console debugging in the e² studio environment.
Method 1: printf output via "Renesas Virtual Console" (only for RX family devices)
Standard I/O library features such as printf require implementation of low level functions.
For more details about the library, please refer to Section 8.4 – Coding Example of CC-RX Help contents in the compiler package.
A sample project is show below using an output string to debug console via printf.
"RX Family Debug Console Function Using E1" (R01AN0252ET)
This sample project enables virtual console output via low level I/O functions which accesses emulator interface registers rather than device serial ports.
This sample project works with all Renesas emulators (E1/E20/E2 Lite) as well as RX simulator.
Here's how to build this sample code project in e² studio:
Step 1. Download the sample code project from the site stated above and extract the archive.
Step 2. Import the project via menu of File -> New -> Import -> "C project" and choose "HEW project".
Step 3. In the Property dialog of the project, go to "C/C++" -> Linker -> Section, then add a section named "L" in ROM area.
(Press "Add Section" button and a section will be added such as "NEW_SECTION_1". Then rename it as "L".)
Step 4. Build the project.
Step 5. Launch the debugger and you will see debug messages appear in "Renesas Debug Virtual Console" view.
Note: "Renesas Debug Virtual Console" is hidden by default.
To view it, please click "Open Console" menu button in the Console view, then choose "Renesas Debug Virtual Console".
Method 2: Using Dynamic printf
In e² studio, as CDT debugger, "Dynamic printf" is also available to perform console output with printf-like format.
This feature enables debug console (not the Virtual Console) string output, variable and expressions without writing printf calls in source codes.
To use "Dynamic printf", launch the debugger and right click the left gutter in the editor window of source code, similar to placing break points. Then choose "Add Dynamic Printf..." from the context menu. "Properties for C/C++ Line Dynamic Printf" dialog will appear.
Enter a printf-like format string in the textbox of "printf(".
Dynamic printf events can be set at more than one address where necessary.
You don't need to describe printf calls in source codes using this feature.
Note: Using Dynamic printf will disrupt real time execution as it will stop-and-resume the debugger for each console output.
Note: Dynamic printf configurations are not portable between projects, similar to breakpoint configurations.