Help understanding example project for CK-RA6M5 

I am following this example for my board. I need help with RTT Viewer. I am connected to e2studio debug perspective and running the example. 

Then I open the RTT viewer with below settings:


The viewer displays below details:

What's the next step now?

I typed 100 in the line and hit enter. LED1 turns RED. But It says WARNING: Sent 0 of 4 bytes. What does that mean? I type different values nothing happens to LED.

I do not see any banner info being printed. How does Tera Term works with this?

Am I missing something? This is my first day with the board.

In my end application, I want to print lots of data on serial console with printf.

Thank you for the help.

  • Hello,

    Thanks for reaching out Renesas Engineering Community!

    This project in e2studio includes two stacks. One stack for UART communication and one other stack which is a general PWM Timer.

    The red led ,which turns on is configured as the output of the timer.

    So, when the timer starts the led turns on. For this project the hardware requirements are a USB-TTL connector in order to implement the communication through UART between your pc and the MCU (RA6M5). You will also need the JLinkRTTViewer and the Tera Term.

    In your case (CK-RA6M5 ) you should connect

    • MCU RXD MISO P410 ---->TXD Pin of USB-UART
    • MCU TXD MOSI P411 -----> RXD Pin of USB-UART.
    • Common GND

    ATTENTION:  You should set the same baud rate to your Serial Terminal as the configured in UART stack properties. In your case it is the default 115200 bps.

    1)You connect your MCU board with the PC through USB Debug.

    2)You open JLinkRTTViewer and connect your device. Check from the terminal logs it is connected.

    3)Upload from e2studio your code to the MCU.

    After this process you should see all the printed messages in your JLinkRTTViewer:

    On your MCU board you will see the red led turned ON.

    Later, we should configure Tera Term in order to implement communication between your pc and MCU.

    Open Tera Term choose your Port in my case COM4.

    Go to Setup->Terminal end set your terminal settings you could enable local echo.

    Later go to Setup->Serial port and set your serial communication settings:

    When everything is configured you  could  type a value on the Tera Term terminal in order to set the intensity of red LED.

    By typing different values you will see the led's intensity changing . In case it is invalid it will print back a message as shown in the picture.

    In case  you  want  to print more Data in your application in JLinkRTTViewer use the APP_PRINT macro. If you want your values to be shown in Tera Term you should use the UART API :

    fsp_err_t 	R_SCI_UART_Write (uart_ctrl_t *const p_api_ctrl, uint8_t const *const p_src, uint32_t const bytes)

    Kind Regards,


  • When using RTT to input data, type the data in the input box indicated by arrow, and then press ENTER.

  • Thank you for clarifying this example for me. For JLinkRTTViewer, is the USB-TTL connector necessary? I am still waiting on my cable to be delivered and wondering without any external HW if I can see the printed output somewhere.

  • Thank you, Yes I tried that as well, nothing in the terminal window.

  • Hello Bins10,

    I assume you are confused with UART and RTT. The example you re referring to uses the UART to communicate with the PC and receive the command to control the brightness of the LED. RTT in this example is only used to send the service information about what's happening in the program to the RTT viewer.

    You can replace the UART interface with the RTT commands if you want to test at least something. You can find more information about the RTT in the SEGGER page

    When you download the J-Link Software and Documentation pack from here you can also find there the "Examples" folder in which there are code samples which can be used in your program.

    For example this code will echo the characters received from the RTT viewer:

    static char r;

      SEGGER_RTT_WriteString(0, "SEGGER Real-Time-Terminal Sample\r\n");
      while (1) {
        r = SEGGER_RTT_WaitKey();
        SEGGER_RTT_Write(0, &r, 1);

    Kind regards,


    If this response, or one provided by another user, answers your question, please verify the answer. Thank you!

    Renesas Engineering Community Moderator

  • Hello,

    No the USB-TTL connector is not necessary if you replace the UART interface with the RTT commands as Sergey told you. The USB-TTL connector is only needed if you want to implement UART communication  with your PC and Tera Term is needed as a Serial Terminal in this case only.  If you run the  specific example you will  see that any message which is  printed with APP_PRINT() is printed in JLinkRTTViewer and any message which is in 

    R_SCI_UART_Write (uart_ctrl_t *const p_api_ctrl, uint8_t const *const p_src, uint32_t const bytes)

    API will be printed in Tera Term (Serial Terminal). 

    Kind Regards,


  • Thank you for clarifying the UART and RTT for me, indeed I was confused in the beginning.