Renesas RL78 Application Note
Hide thumbs Also See for RL78:

Advertisement

Quick Links

RL78 Debugging Functions Using the Serial Port
Introduction
This application note describes how to use the RL78 debugging functions using the serial port.
Target Device
RL78
Contents
1.
Overview ................................................................................................................................. 4
1.1
Overview of COM Port debugging ........................................................................................................... 4
1.2
Applicable devices ................................................................................................................................... 4
2.
User system design ................................................................................................................. 5
2.1
2.1.1
General RL78 family connectivity .......................................................................................................... 5
2.2
Things to keep in mind when connecting ................................................................................................ 6
2.2.1
RESET# pin ........................................................................................................................................... 6
2.2.2
TOOL0/TOOLTxD/TOOLRxD pins ........................................................................................................ 8
2.2.3
GND ....................................................................................................................................................... 9
2.2.4
Power supply voltage ............................................................................................................................ 9
3.
Usage notes .......................................................................................................................... 10
3.1
Power on/off .......................................................................................................................................... 10
3.1.1
Power supply sequence ...................................................................................................................... 10
3.2
MCU resources that are used ............................................................................................................... 11
3.2.1
Securing the debug monitor area ........................................................................................................ 12
3.2.2
Securing the stack area for debugging ............................................................................................... 13
3.2.3
Setting the on-chip debug option byte area ........................................................................................ 14
3.2.4
Setting the security ID ......................................................................................................................... 15
3.3
Reset ..................................................................................................................................................... 16
3.3.1
Behavior after reset ............................................................................................................................. 16
3.3.2
Registers after reset ............................................................................................................................ 16
3.3.3
Pin reset during break ......................................................................................................................... 16
3.4
Flash memory ........................................................................................................................................ 16
3.4.1
Debugging notes for self-programming ............................................................................................... 16
3.4.2
3.5
GDIDIS function ..................................................................................................................................... 18
3.6
MCUs that are used in debugging ......................................................................................................... 18
3.6.1
Use in mass-production products ........................................................................................................ 18
R20AN0632EJ0100 Rev.1.00
Jul.20.21
Application Note
Page 1 of 23

Advertisement

Table of Contents
loading

Summary of Contents for Renesas RL78

  • Page 1: Table Of Contents

    Application Note RL78 Debugging Functions Using the Serial Port Introduction This application note describes how to use the RL78 debugging functions using the serial port. Target Device RL78 Contents Overview ..........................4 Overview of COM Port debugging ......................4 Applicable devices ........................... 4 User system design .........................
  • Page 2 RL78 RL78 Debugging Functions Using the Serial Port 3.6.2 Standalone operation check ........................ 18 Final evaluation of user program ......................18 Debugging functions ..........................19 “Go to Here” function ........................... 19 3.8.1 3.8.2 Debugging in standby mode ........................ 19 3.8.3 Pseudo RRM/DMM functions ......................
  • Page 3 The application program to be debugged. Flash writing software In this document, this term refers to the Renesas Flash Programmer. Meaning of “#” at the end of the pin name (signal name) The # at the end of a pin name (signal name) indicates that it is a “Low” active pin (signal) (example: RESET#).
  • Page 4: Overview

    It enables debugging of target devices using a commercially available USB-to-serial conversion adapter. 1.2 Applicable devices Devices in the RL78 family that support COM Port debugging. Check the device's manual to see if it is supported. Table 1-1 List of debugging functions...
  • Page 5: User System Design

    Things to keep in mind when connecting. 2.1.1 General RL78 family connectivity An example of connecting the USB-to-serial conversion adapter to the RL78 family is shown in Figure 2.1. CTS# is unused. Perform pin processing according to the specifications of the serial conversion adapter you are using.
  • Page 6: Things To Keep In Mind When Connecting

    RL78 RL78 Debugging Functions Using the Serial Port 2.2 Things to keep in mind when connecting The pattern length between the USB-to-serial conversion adapter and the MCU should be as short as possible (50 mm or less is recommended). Also, do not route signal lines on the board other than between the USB-to-serial conversion adapter and the MCU.
  • Page 7 RL78 RL78 Debugging Functions Using the Serial Port * The reference type name of the buffer connected to DTR# is “74LVC1G126”. OE control is as follows. H: Enable output L: Disable Figure 2.4 RESET# pin connection example (with buffer) The following notes pertain to Figure 2.2, Figure 2.3, and Figure 2.4.
  • Page 8: Tool0/Tooltxd/Toolrxd Pins

    RL78 RL78 Debugging Functions Using the Serial Port 2.2.2 TOOL0/TOOLTxD/TOOLRxD pins The TOOL0/TOOLTxD/TOOLRxD pins are occupied and used when COM Port debugging is used. Pin functions that are multiplexed to these pins cannot be used. In addition, COM Port debugging uses the TOOLTxD/TOOLRxD pins to send and receive data to and from the target device.
  • Page 9: Gnd

    RL78 RL78 Debugging Functions Using the Serial Port 2.2.3 GND The GND of the USB-to-serial conversion adapter must be the same GND as the VSS pin of the MCU. 2.2.4 Power supply voltage Use COM Port debugging at 1.8 V or higher, and stay within the operating voltage range of the USB-to- serial conversion adapter.
  • Page 10: Usage Notes

    RL78 RL78 Debugging Functions Using the Serial Port 3. Usage notes 3.1 Power on/off Follow the steps below to power the user system on and off. 3.1.1 Power supply sequence [At the start of use] (1) Confirm power is off Make sure the user system is powered off.
  • Page 11: Mcu Resources That Are Used

    RL78 RL78 Debugging Functions Using the Serial Port 3.2 MCU resources that are used Figure 3.1 shows the areas occupied during COM Port debugging. These areas (shaded sections) show the space used for debugging. Do not make changes to these areas, for example by placing user programs or data there.
  • Page 12: Securing The Debug Monitor Area

    RL78 RL78 Debugging Functions Using the Serial Port 3.2.1 Securing the debug monitor area The debug monitor area contains the debug monitor program. The monitor program performs initialization of the debugging communication interface, run/break processing of the CPU, etc. This area must not be overwritten by the user program.
  • Page 13: Securing The Stack Area For Debugging

    RL78 RL78 Debugging Functions Using the Serial Port 3.2.2 Securing the stack area for debugging Use 4 bytes as the stack area for debugging. Since this area is located directly under the stack area, the address of the debug stack area varies as the stack increases or decreases. In other words, it consumes 4 bytes extra for the stack area consumed by the user program.
  • Page 14: Setting The On-Chip Debug Option Byte Area

    RL78 RL78 Debugging Functions Using the Serial Port 3.2.3 Setting the on-chip debug option byte area This is a security setting that prevents a third party from reading the contents of the flash memory. Refer to the user's manual for your specific device to see the values that can be set.
  • Page 15: Setting The Security Id

    RL78 RL78 Debugging Functions Using the Serial Port 3.2.4 Setting the security ID This setting prevents the contents of memory from being read by a third party through the debug interface. The security ID is embedded in the internal flash memory at address 0xC4 to 0xCD.
  • Page 16: Reset

    RL78 RL78 Debugging Functions Using the Serial Port 3.3 Reset 3.3.1 Behavior after reset After an external pin reset or an internal reset, the monitor program performs debugging initialization processing. Therefore, the time from the reset occurrence to the execution of the user program differs from the actual device operation.
  • Page 17: Voltage At Which Flash Memory Cannot Be Written And Operation In Flash Operation Mode

    RL78 RL78 Debugging Functions Using the Serial Port 3.4.2 Voltage at which flash memory cannot be written and operation in flash operation mode If the following debugger operations, which involve rewriting the flash memory, are executed at a voltage at which flash memory cannot be written or erased, or when flash rewriting is disabled in the debugger properties, the debugger raises an error and the operation is ignored.
  • Page 18: Gdidis Function

    Before entering the mass production phase, be sure to perform a final evaluation of the program written to a flash ROM by the Renesas Flash Programmer flash writing software or other flash programmer on a standalone basis without using COM Port debugging.
  • Page 19: Debugging Functions

    RL78 RL78 Debugging Functions Using the Serial Port 3.8 Debugging functions Stepped execution function (1) SFR values during stepped execution The value of some SFRs (special function registers) might remain unchanged when stepping into code. If the value of the SFRs does not change while stepping in, operate the microcontroller by executing the instructions continuously instead of executing them in steps.
  • Page 20: Pseudo Rrm/Dmm Functions

    RL78 RL78 Debugging Functions Using the Serial Port 3.8.3 Pseudo RRM/DMM functions Note the following points when using the pseudo RRM function or the pseudo DMM function. • Standby mode (HALT or STOP) may be canceled during monitoring. • The pseudo RRM/DMM function does not work while the CPU operating clock is stopped.
  • Page 21: Notes On The Break Function

    256 bytes of the end address of internal ROM, but no trace data can be acquired for this area. 3.8.9 Precautions when using flash read protection Flash read protection has been added to the RL78. This feature allows the specified area to be set as read prohibited.
  • Page 22: How To Improve Debug Performance

    RL78 RL78 Debugging Functions Using the Serial Port 3.9 How to improve debug performance Performance of Com Port debugging system is slower than emulator debugging system. However performance of Com Port debugging system will be improved a little by changing setting below.
  • Page 23: Revision History

    RL78 RL78 Debugging Functions Using the Serial Port Revision History Description Rev. Date Page Summary 1.00 20 Jul 2021 First Edition issued R20AN0632EJ0100 Rev.1.00 Page 23 of 23 Jul.20.21...
  • Page 24 Unit Products The following usage notes are applicable to all Microprocessing unit and Microcontroller unit products from Renesas. For detailed usage notes on the products covered by this document, refer to the relevant sections of the document as well as any technical updates that have been issued for the products.
  • Page 25 Renesas Electronics disclaims any and all liability for any damages or losses incurred by you or any third parties arising from the use of any Renesas Electronics product that is inconsistent with any Renesas Electronics data sheet, user’s manual or other Renesas Electronics document.

Table of Contents