User`s manual
Copyright © Quantum Leaps, LLC. All Rights Reserved.
QDK™
Renesas RX with HEW
state-machine.com/rx
2.5 Running the Examples
You program the code into the flash memory of the MCU through the HEW Session. First, you must
select the debugger session SesstionRX600_Segger_JLink (see Figure 6) and you need to connect to
the target by selecting the Debug | Connect menu. Next, in HEW you must always make sure that the
image is actually loaded into the target. You download the code into the target by selecting the Debug |
Download Modules menu.
After you download the code, the HEW debugger will stop the program at
PowerON_Reset-PC()
. Please
press the Go toolbar button in the HEW to let the program continue. The User LEDs of the YRDKRX63N
board should start blinking (see Figure 1). The LEDs are assigned as follows: LED4, LED5, LED6, LED7,
and LED8 show the status of Dining Philosophers 0-4, respectively. These LEDs are on when the
corresponding Philosopher is in the “eating” state, otherwise the LEDs are off.
The User LED12 is used to visualize the idle loop activity. The brightness of the LED12 is proportional to
the frequency of invcations of the idle loop. The LED12 is always toggled with interrupts disabled, so no
interrupt execution time contributes to the brightness of the User LED12.
This version of the DPP application also demonstrates the user input to the system. By pressing and
holding down the SWITCH1 of the YRDKRX63N board, you can pause the philosophers, so that they
will not get permissions to eat. This means that after a while all philosophers will end in the “hungry” state
(so that LED4-LED8 will turn off). After releasing the SWITCH1, the philosophers get the permissions to
eat, so the application resumes as normal. The PAUSED state of the application is visualized by the
LED11.
The LCD display is not used in the DPP example, even though the backlight of the LCD is on. On the
YRDKRX63N board the LCD backlight is hard-wired and is not controlled by the MCU, so it cannot be
turned off.
2.5.1 Q-SPY Software Tracing
QS is a software tracing facility built into all QP components and also available to the Application code.
QS allows you to gain unprecedented visibility into your application by selectively logging almost all
interesting events occurring within state machines, the framework, the kernel, and your application code.
QS software tracing is minimally intrusive, offers precise time-stamping, sophisticated runtime filtering of
events, and good data compression (see Chapter 11 in [PSiCC2]).
To see the QS software trace output, you need to connect the RS-232 Port of the YRDKRX62N board
(see Figure 1) to the COM port of your PC with a straight-through RS-232 cable. Alternatively, you can
use an RS-232-to-USB converter connected directly to the RS-232 Port of the YRDKRX62N board.
In the HEW IDE you need to switch to the Spy configuration and download it to the target board. Next you
need to launch the QSPY host utility in the Windows console to observe the output in the human-readable
format.
NOTE:The QSPY host utility is part of the Qtools collection, available for download from
http://www.state-machine.com/downloads/index.php#QTools. After installing Qtools, you should add
the installation directory to the PATH environment variable.
You launch the QSPY utility on a Windows PC :
qspy –c COM9
This will start the QSPY host application to listen on COM2 serial port with the standard baud rate
115200. (Please use the actual virtual COM port number on your PC.) The screen shot in Figure 7 shows
the QSPY output from the DPP run:
11 of 32










