Download - Technical Product Support Renesas Electronics Europe 00000-A Rev. 0.00 RL78 Code & Dataflash
Technical Product SupportRenesas Electronics Europe
00000-A
Rev. 0.00
RL78 Code & Dataflash
2
Purpose This course provides an introduction to the RL78 flash features
and architecture. These include the security features, code and data flash organization as well as self- and external programming and the related libraries.
Objective Learn about the RL78 flash capabilities. Understand self and external programming methods Understand different libraries and their usage.
Content 32 pages (including this page) x questions
Learning Time 40 minutes
Introduction
3
RL78 Flash Hardware
4
MF3 - Technology Single voltage self-programming Supply voltage: 1.6V ~ 5.5V
– Prog. Voltage: 1.8V ~ 5.5V
0.13µm process density TA, prog: -40°C ~ +125°C
TA, read: -40°C ~ +150°C
Max. 32MHz Operation speed Block size
– 1K blocks Write unit
– 4 byte (for the Code Flash)– 1 byte (for the Data Flash)
Technology overview
5
Code flash 1K blocks 4 byte write unit two boot clusters Access via
– External programmer – Flash Selfprogramming library (FSL)
Data flash Independent second flash macro
for data storage 1K blocks 1 byte write unit Access via:
– External programmer– Simple access (FDL) library– EEPROM emulation (EEL) library
Code flash
Firm-ware
RL78 Data flash Note1
0x00000
0xyyyyy
0xF1000
0xF1FFF
Note1: available as an option
Hardware architecture
ProgrammingInterface
6
Code flash offer two boot blocks each 4k Swap by self programming
command Allow secure boot loader update
Old boot loader must not be erased before new completely written
Allow simple boot loader design Temporary swap activate
application until next reset
Data flash Note1
0x00000
0xyyyyy
0xF1000
0xF1FFF
Boot Swap
Boot cluster 0
0x01000
0x02000
Boot cluster1 codeflash
7
Block erase protection flag Single blocks cannot be erased anymore
Write protection flag Disables the external write command
All flags set No on-board programming possible anymore Only Self-programming possible
Flags can be set By external programmer (set security) selfprogramming
Protection Flags are stored in the extra area Not part of the normal CPU address space
Security level
low
high
Security Features
8
Boot cluster protection flag Boot cluster 0 cannot be erased or written anymore
Flash shield window function support Self-programming mode only
Security Features (cont.)
9
Data bits
32 1
ECC Encryption Logic
ECC bits
ECC Encryption Logic
ECC bits
6 132 1
ECC Decryption Logic
ECC Decryption Logic
32 1
Original data
Flash cellswith maximum 1 bitfailure over lifetime
Flash Write
Flash Read
During the Flash Write the data are encrypted in the ECC Encryption Logic and the resulting bits are stored in the ECC part of the flash
During Flash Read these bits are used by the ECC Decryption Logic to correct single bit failures on the fly
Error Correction Code (ECC)
10
RL78 On board programming
11
Programming methodes
Serial Programming E1 on chip debug emulator
/programmer PG-FP5 mass production
programmer third party tool
– Ertec, Data IO, … Flash Programming app note
Selfmade programmers can be approved by a flashprogrammer audit
12
Full support of programming on dedicated programming adapter or directly in the user system
Target Application Hardware
Flash-Programming Adapter
USB
USB
E1
Stand alone
PG-FP5-EEPG-FP5-EEPG-FP5-EE
Flash Programmer
13
Programming with dedicated programmer TOOL0 Communication Interface Internal “high speed” on-chip oscillator is used
Secure protocol used Checksum command included
On-board Programming Interface
14
Serial Programming
Supported Commands Status command Reset command Baud Rate Set command Erase command Programming Command Verify command Block Blank Check command Silicon Signature command Version Get command Checksum command Set Security command
For security reasons there is no read command available
15
RL78 Flash Self-Programming Code Flash
16
Ability to reprogram the code flash contents without a dedicated programming tool.
The internal firmware of the RL78 products allows to rewrite the flash memory.
Renesas supports self-programming by providing appropriate libraries free of charge available These Self-programming libraries offer an
easy-to-use interface to the internal firmware functionality.
User Application
Self-Programming Library
Firmware
Flash Memory
Self-programming in General
17
User defined programming interface Interface type (I.e. CAN, LIN, CSI, UART,
other)
Block swapping is supported for secure self-programming Even if the boot loader has to be updated, it
is ensured, that always a valid boot loader (two boot blocks) is available during self-programming
Virgin programming with dedicated programmer is mandatory Contains at least self programming
functionality
User Application
Self-Programming Library
Firmware
Flash Memory
Self-programming in General
18
Self-programming operation modes
Internal status check mode
FSL (Flash Self-programming Library) is located in the User ROM (flash)
Call the FSL function directly from the ROM
get feed back after execution No interrupt handling
Advantages Easy to handle
19
Self-programming operation modes
2)User status check mode
Copy the FSL functionality into the RAM
Execute the FSL from RAM
Advantages No lengthened interrupt
response Full control of software
20
Self-programming interrupt handling
Selfprogramming execution from RAM
Fast interrupt handling Common RAM interrupt used
full control on user side
21
Self-Programming - Ways Of Use
The device is never rendered useless – because the boot block is not affected!
22
Self-Programming - Ways Of Use
The device is never rendered useless – because the boot block is not affected!
23
The device is never rendered useless – even if a failure occurs during writing the new boot block!
Self-Programming - Ways Of Use
24
RL78 FlashSelf-Programming Data Flash
25
Data Flash 1.000.000 W/E cycles @ 5 year data retention (typ.) 100.000 W/E cycles @ 5 year data retention
Minimum data (write) size 1 byte (Data Flash)
Flash (erase) block size 1KB
Access with library (FDL) only
Full temperature range during programming
Data Flash Specification
26
Data Flash
Background operation on devices with separate Data Flash
CPUcore
OS + Drivers +Application(s)
EEPROM Data
EEPROM EmulationLayer (EEL)
Code F
lash
Data
Fla
sh
Bootloader
Data Flash AccessLayer (FDL)
Managing R/W accessesto the EEPROM data-Optional-Interface to user application-Includes
-Data structures-Calling convention-Error handling-…
-Basic Flash accesses-E.g. Erase, Write
-Interface to EEPROM emulation layer
Independent Flash macros fordual operation on Code execution and Data Flash operations
27
Operation Flow
Data flash operation timing The application code runs simultaneously when the EEPROM
data is accessed. Data Flash behavior is like an external EEPROM
application
eepromaccess
eeprom access
CPU
Request to read /write data
Request finished
28
Data flash access
Possible scenario of data flash access Via FDL
– Simple access to data flash Via EEL and FDL
– Supports a EEPROM emulation in the data flash
Data flashFDL
EEPROM lib
Application
Parameter saving
EEPROM emulation
29
RL78 FlashSelf-Programming Libraries
30
Data Flash Memory
FSL(Flash Self programming Library)
FDL(Flash Data Library)
User Application ( User Program )
WriteWrite
orRead
Read
Writeor
Read
The RL78 device does not have afunction of EEPROM Emulations
Code Flash Memory
Write
Sequencer and Firmware
EEL(EEPROM Emulation Library)
Writeor
Read
Device(Firmware)
Software(Program Area)
Write
Write Write
Example : The flow of writing and reading
RL78 use a flash library when rewriting the code or data flash memory.
The basic configuration of the flash libraries for RL78
31
RL78EEPROM -Emulation
32
EEPROM emulation is the ability to use a part of the flash as a kind of EEPROM memory.
Main difference to a real EEPROM is the ability to erase only a complete block
This requires a special algorithm to handle the data sets inside the EEPROM area.
Renesas provide the corresponding access libraries free of charge
EEPROM Emulation
Data A
Data B
Data C
Real EEPROM
Updating Data B1. Erase old Data B2. Write new Data B’ Data B’
Data A
Data B
Data C
EEPROM EmulationUpdating Data B1. Write new Data B’2. Old Data B still
available as historyData B’
EEPROM Emulation
33
Key functionalities of the Renesas EEPROM emulation library are:
READ and WRITE at any time provided by:
Automatic suspend/resume of ERASE commandAutomatic preparation of write-space in the idle phaseLarge amout of data can be managed (configurable > 1 block) bBock redundancy managed automatically RESET resistant algorithmsData consistency checks
EEL Features
Summary
In this course, we covered:
Self and external programming methodsRL78 Flash features and architectureSecurity featuresCode and DataFlash organizationSelf and external programming methodsUnderstand different libraries and their usage
Thank You for viewing
For more information on RL78 products, please view the RL78 Family Overview course or visit www.renesas.com
34
Renesas Electronics Europe
Thank You