Pular para o conteúdo principal
Knowledgebase
Home
Renesas Brasil - Knowledgebase

How do I Use Printf() with the Debug Console in the Synergy Software Package

Latest Updated:09/23/2016

Question:

How do I use the Printf function to write to the Virtual Debug Console with the Synergy Software Package?

 

Answer:

You can use the printf function in your SSP projects is you follow these simple steps, illustrated using the Threaded Blinky project.

1) Make sure you include these lines of code at the beginning of Threaded Blinky:

#include "blinky_thread.h"
#include "stdio.h" //Used for printf outputs

extern void initialise_monitor_handles(void);  //Used for printf outputs

/* Blinky example application

void blinky_thread_entry(void)
{
    initialise_monitor_handles(); //Used for printf outputs
    int countt;

  

2) You also need to initialize the countt variable here:

/* Get LED information for this board */

R_BSP_LedsGet(&leds);

countt = 0;

3) Put in the code to increment the counter, the printf function call and the edit to the sleep delay as shown below:

countt = countt + 1;

/* Delay */

printf(" Hello from Synergy %d\r\n", countt);

tx_thread_sleep (1);

4) You should also check that the linker script (a default selection in SSP projects, but you might need to set it if you are doing anything non-standard) is set to -spec=rdimon.specs as seen below.

5) You can now build and begin a debug session.  

5) Now select the Renesas Debug Virtual Console using the select box at the far right of the console window (the one with the yellow plus sign), as seen below, then restart the debug session.

6) The Printf output from Threaded Blinky will show up in the Virtual console window as illustrated in the screen capture given below (you may need to select the display console from the second to last selction box on the far right side of the console window, the one with the computer monitor icon) . Now try this procedure in one of your projects!