Renesas RL78 User Manual

Application Note
RL78/G23
Unique ID Read Driver
Introduction
Each RL78/G2x chip is programmed with a unique ID. The unique ID can be used to prevent unauthorized use of software IP and is useful for managing products individually.
Target Device
RL78/G23
When using this application note with other Renesas MCUs, careful evaluation is recommended after making modifications to comply with the alternate MCU.
R20AN0615EJ0100 Rev.1.00 Page 1 of 14 Apr.13.21
RL78/G23 Unique ID Read Driver
Contents
1. Overview .................................................................................................................................... 3
1.1 About This Application Note .................................................................................................................... 3
1.2 Confirmed Operation Environment .......................................................................................................... 3
2. About the Unique ID .................................................................................................................. 5
2.1 Unique ID Specifications ......................................................................................................................... 5
2.2 Unique ID Usage Examples .................................................................................................................... 5
2.2.1 Preventing Piracy .................................................................................................................................. 5
2.2.2 Pseudorandom Number Seed ............................................................................................................... 5
2.2.3 Management of Shipped Products ........................................................................................................ 6
2.2.4 Program Branching by Product Name .................................................................................................. 6
3. Related Application Notes ......................................................................................................... 7
4. Software Configuration .............................................................................................................. 8
4.1 File Structure ........................................................................................................................................... 8
5. Data Configuration ..................................................................................................................... 9
5.1 Constants ................................................................................................................................................ 9
5.2 Enumerated Types .................................................................................................................................. 9
5.2.1 End Status of Read Function ................................................................................................................ 9
5.3 Structures ................................................................................................................................................ 9
5.3.1 Unique ID Information ........................................................................................................................... 9
5.3.2 Product Name ASCII Code Information ................................................................................................ 9
6. API Functions .......................................................................................................................... 10
6.1 R_UID_Read Function .......................................................................................................................... 10
6.2 R_PDCT_Read Function ....................................................................................................................... 10
7. Sample Project ........................................................................................................................ 11
7.1 Processing Sequence of Sample Project .............................................................................................. 12
7.2 Settings and Execution .......................................................................................................................... 12
7.3 Note on Debugging ............................................................................................................................... 12
8. Reference Documents ............................................................................................................. 13
Revision History .............................................................................................................................. 14
R20AN0615EJ0100 Rev.1.00 Page 2 of 14 Apr.13.21
RL78/G23 Unique ID Read Driver
Item
Description
MCU used
RL78/G23 (R7F100GLG2D)
Operating frequencies
High-speed on-chip oscillator clock: 32 MHz CPU/peripheral hardware clock: 32 MHz
Operating voltage
3.3 V
Integrated development
Renesas Electronics CS+ for CC V8.05.00
C compiler (CS+)
Renesas Electronics CC-RL V1.10
Integrated development
Renesas Electronics e2 studio 2021-04
C compiler (e2 studio)
Renesas Electronics CC-RL V1.10
Integrated development environment (IAR)
IAR Systems
C compiler (IAR)
Smart configurator
V.1.0.0
Board support package (r_bsp)
V.1.00 Emulator
E2 emulator Lite
Board used
RL78/G23-64p Fast Prototyping Board (RTK7RLG230CLG000BJ)

1. Overview

1.1 About This Application Note

1.2 Confirmed Operation Environment

The operation of the sample code accompanying this application note has been confirmed under the conditions listed below.
Table 1.1 Confirmed Operation Environment
environment (CS+)
environment (e2 studio)
LVD0 operation (V Rise (typ.): 1.670 V
Fall (typ.): 1.630 V
IAR Embedded Workbench for Renesas RL78 V4.21.1
): Reset mode
LVD0
R20AN0615EJ0100 Rev.1.00 Page 3 of 14 Apr.13.21
RL78/G23 Unique ID Read Driver
Item
Description
Clock
f
:32 MHz
f
: 32.768 kHz (low-speed on-chip oscillator clock)
UART0
Component: UART communication
Address
Setting Value
Description
000C0H/040C0H
1110 1111B (EFH)
Watchdog timer operation stop (after reset or count stop)
000C1H/040C1H
1111 1111B (FFH)
LVD0 reset mode
000C2H/040C2H
1110 1000B (E8H)
Flash operating mode: High-speed main mode High-speed on-chip oscillator frequency: 32 MHz
000C3H/040C3H
1000 0100B (84H)
On-chip debugging operation enabled
Table 1.2 Smart Configurator Settings
IHP
f
: 32,000 kHz (high-speed on-chip oscillator clock)
CLK
SXL
Operating mode: Transmission Resource: UART0 Operating clock: CK00 Clock source: f Transfer mode: Single transfer mode Number of data bits: 8 Data transfer report: LSB Parity: No parity Stop bits: 1 Transmit data level: Non-inverted (normal) Transfer rate: 115,200 (bps) Interrupts: Level 3 (low priority) Callback function: Transmit end
Table 1.3 Option Byte Settings
CLK
/2
Detection voltage: Rise 1.670 V, fall 1.630 V
R20AN0615EJ0100 Rev.1.00 Page 4 of 14 Apr.13.21
RL78/G23 Unique ID Read Driver
Third-party software IP
Software IP user
Read.
[1] Report unique ID.
Third-party software IP
Software IP provider
ID002
[2] Provide software IP.
Licensed unique ID (whitelist) ID001
ID002
ID003
Unique ID
[2] Registered in whitelist
[3] Launch using authorized ID.

2. About the Unique ID

2.1 Unique ID Specifications

For detailed information on the unique ID, refer to Chapter 28, Security Functions, in the following manual.
RL78 Family User’s Manual: Software (R01US0015E)

2.2 Unique ID Usage Examples

The RL78/G23 does not have a Trusted Secure IP module*1 like that incorporated into RX and RZ Family MCUs. Nevertheless, the unique ID can be used to implement security and product management as described below.
Note: 1. A secure hardware IP module exclusive to Renesas. It forms a hardware security layer that cannot
be breached by external attacks and comprises logic circuits that allow secure utilization of an encryption engine and encryption keys.

2.2.1 Preventing Piracy

By registering specific unique IDs within a software program, it is possible to limit the individuals who can run it.
In cases where the software license is dependent on the number of copies of the product, it is possible to maintain a list of licensed unique IDs within the software and thereby ensure that it can only be run on user products with licensed unique IDs.

2.2.2 Pseudorandom Number Seed

A unique ID can be used as a seed for generating pseudorandom numbers. Since the pseudorandom numbers that can be generated using the unique ID as the seed are fixed, values such as “unique ID + timestamp” can be used instead.
The pseudorandom numbers generated in this fashion can then be used as encryption keys, for challenge­response authentication, and so on.
R20AN0615EJ0100 Rev.1.00 Page 5 of 14 Apr.13.21
Loading...
+ 11 hidden pages