Ie² studio projects utilizing the CC-RX compiler can leverage the "printf" feature to perform console output with printf-like formatting via the Renesas Debug Virtual Console. This capability allows for string output without the need to write low-level printf call functions in the source code. When generating a project using the Smart Configurator, the low-level I/O functions for printf are automatically added as part of the startup files. These files are located in the Project folder at /src/smc_gen/r_bsp/mcu/all. The files with low level functions are:
lowlvl.c
lowlvl.h
lowsrc.c
lowsrc.h
The above functions can be enabled by configuring the BSP file r_bsp_config.h by enabling the I/O library initialization switch as below:
#define BSP_CFG_IO_LIB_ENABLE (1)
The printf function can now be used by using puts() function as below example:
If the project is not using code generator, the printf feature can be added by copying the files mentioned above directly into the src folder of the project.