1. Trang chủ
  2. » Kỹ Thuật - Công Nghệ

Using Virtual EEPROM and Flash API for Renesas MCUs (1)

44 871 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 44
Dung lượng 0,95 MB

Nội dung

The Solution – Data Flash & Record Management  Use data flash and existing Flash API for low level  Add layer to handle record management Flash API ???. Data Flash Block #0Data Flash B

Trang 1

Using Virtual EEPROM and Flash API for Renesas MCUs

Trang 2

Renesas Technology & Solution Portfolio

Trang 3

Microcontroller and Microprocessor Line-up

44 DMIPS, True Low Power Embedded Security, ASSP

25 DMIPS, Low Power

10 DMIPS, Capacitive Touch

 Industrial & Automotive, 150nm

 190µA/MHz, 0.3µA standby

 Industrial, 90nm

 200µA/MHz, 1.6µA deep standby

 Automotive & Industrial, 90nm

 600µA/MHz, 1.5µA standby

 Automotive & Industrial, 65nm

 600µA/MHz, 1.5µA standby  Automotive, 40nm

 500µA/MHz, 35µA deep standby

 Industrial, 40nm

 200µA/MHz, 0.3µA deep standby

 Industrial, 90nm

 1mA/MHz, 100µA standby

 Industrial & Automotive, 130nm

 144µA/MHz, 0.2µA standby

Trang 4

 Devices in a smart society must efficiently use their available resources Eliminating the need for external components

when they can be incorporated inside the MCU is vital.

‘Enabling The Smart Society’

Trang 7

ROM

The Problem – Storing Non-Volatile Data

 Store in internal ROM

 Advantages:

 Stored internally to MCU; no extra cost

 Disadvantages:

 Must halt MCU or run from RAM

 Possibility of corrupting application

 Relatively large minimum write and erase sizes

 Complex to implement

Trang 8

The Problem – Storing Non-Volatile Data

 Store in external EEPROM

Trang 9

The Problem – Storing Non-Volatile Data

 Store in internal data flash

 Advantages:

 Stored internally to MCU; no extra cost

 Can continue to execute from ROM

 Relatively small minimum write and erase sizes

 No possibility of corrupting ROM

Trang 10

The Solution – Data Flash & Record

Management

 Use data flash and existing Flash API for low level

 Add layer to handle record management

Flash API

???

Virtual EEPROM

Trang 11

Data Flash Block #0

Data Flash Block #1

EMPTY

Why is Virtual EEPROM Needed?

 Many data flashes do not have 1-byte writes

 Maintaining multiple records

 Statically allocating addresses can wear out DF faster

 Using advanced features of MCU

Data #1 Data #2 EMPTY

Trang 12

ROM Data Flash

What is the Virtual EEPROM Project?

 The Virtual EEPROM Project allows you to use the Data Flash

on your MCU as you would an EEPROM while adding other record management features

MCU

ROM Data Flash/VEE

I2C

Trang 14

Data Flash vs ROM

 Typically Data Flash has:

 Smaller write and erase sizes

 Shorter write times

 Larger number of rewrite/erase cycles

Trang 15

Virtual EEPROM Features

Trang 16

Background Operations (BGO)

 With BGO, MCU can continue during DF erase or write

 Memory area being worked on cannot be accessed

Access Violation!

Trang 17

Wear Leveling

 Increases longevity of the Data Flash

 Records do not overwrite

 Old records are ignored

VEE Memory Area

Address

0x100000

Address 0x1007FF

VEE

Record

1

VEE Record 1

VEE Record 2

VEE Record 1

VEE Record 2

Trang 18

Ignore Duplicate Writes

 Increases longevity of the Data Flash

 Identical writes are ignored

VEE

VEE Record

1

VEE

VEE Record

VEE Record 2

Trang 19

Record Caching

 No seeking for records

 1 cache entry per available record number

VEE Memory Area

Address

0x100000

Address 0x1007FF

VEE Record Cache

Record 1 Address

Record 2 Address

VEE Record

VEE Record

VEE Record

VEE Record

VEE Record Many More

Trang 20

VEE Memory Area

VEE

Record

2

Error Detection

 Each record has its own error detection field

 Virtual EEPROM recovers automatically from errors

 Recovery measures are only taken on writes

VEE Record 1

• ID

• Size

• Data

Trang 21

 4 extra structure members per record

 Overhead depends on write granularity

 RX62N = 32 bytes per record

Trang 22

How does it work?

Trang 23

Virtual EEPROM Terminology

VEE Sector 0

VEE Record 0 VEE Record 1 VEE Record 1 VEE Record 0 VEE Record 2 VEE Record 2

Trang 24

Virtual EEPROM Operational Overview

VEE Sector 0

VEE Record 0 VEE Record 1 VEE Record 1 VEE Record 0 VEE Record 2 VEE Record 2

Trang 25

Virtual EEPROM Operational Overview

VEE Sector 0

VEE Record 0 VEE Record 1 VEE Record 1 VEE Record 0 VEE Record 2 VEE Record 2

NOT ENOUGH

ROOM

Trang 26

Virtual EEPROM Operational Overview

VEE Sector 0

VEE Record 0 VEE Record 1 VEE Record 1 VEE Record 0 VEE Record 2 VEE Record 2

DEFRAG OCCURS

VEE Record 1

Trang 27

Virtual EEPROM Operational Overview

VEE Sector 0

VEE Record 0 VEE Record 1 VEE Record 1 VEE Record 0 VEE Record 2 VEE Record 2

VEE Record 1 VEE Record 0 VEE Record 2

DEFRAG CONTINUES

Trang 28

Virtual EEPROM Operational Overview

VEE Sector 0

VEE Record 0 VEE Record 1 VEE Record 1 VEE Record 0 VEE Record 2 VEE Record 2

VEE Record 1 VEE Record 0 VEE Record 2

DELETE OLD

BLOCK

Trang 29

Virtual EEPROM Operational Overview

VEE Sector 0

VEE Record 1 VEE Record 0 VEE Record 2

Trang 30

Virtual EEPROM Configuration

Trang 31

Why would I need more than 1 VEE Sector?

 Optimize (lower) the number of defrags

VEE Sector #0 – Block #0

VEE Record 1

VEE Record 2

VEE Sector #0 – Block #1

VEE Record 2

VEE Record 2

VEE Record 2

VEE Record 1

VEE Record 2

VEE Record 2

VEE Record 2

VEE Record 2

Defrag Again!

1 Sector

Trang 32

Why would I need more than 1 VEE Sector?

 Optimize (lower) the number of defrags

VEE Sector #0 – Block #0

VEE Record 1

VEE Sector #1 – Block #0

VEE Record

VEE Record

VEE Record

VEE Record

VEE Record

VEE Record

VEE Record

VEE Record

VEE Record

VEE Record

Defrag Finally!

2 Sectors

Trang 33

Virtual EEPROM API

Trang 35

VEE Operation Completion

 Can use polling or interrupt driven

 Polling:

 Use R_VEE_GetState()

 Will return current state of VEE

 Interrupt Driven:

User defined callback in r_vee_config.h

Warning: Callback is called from interrupt

#define VEE_CALLBACK_FUNCTION VEE_OperationDone_Callback

Trang 36

Data Flash User Application

Why do we need R_VEE_ReleaseState()?

 Used to prevent data flash access violations

 R_VEE_Read(ID=0) to read VEE Record 0

 R_VEE_Write(ID=1) to write VEE Record 1

 User reads data from pointer in step 1 while write is still on-going

 Multiple reads are allowed

Pointer to Record 0 VEE Record 0

VEE Record 1 VEE Record 1

Trang 37

Why not have R_FlashRead() instead?

 User would call this function to read data

 Data would have to be copied every time

 No way to prevent user from directly accessing

Trang 38

Virtual EEPROM for RL78

Trang 39

RL78 – EEPROM Emulation Library

 Has similar features

 Uses ‘pools’

Trang 40

RL78 – EEL Modes

 Has 3 execution modes

Trang 42

Questions?

Trang 43

 Devices in a smart society must efficiently use their available resources Eliminating the need for external components

when they can be incorporated inside the MCU is vital

‘Enabling The Smart Society’

Ngày đăng: 22/06/2015, 14:17

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w