Class ID: Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Using Virtual EEPROM and Flash API for Renesas MCUs © 2012 Renesas Electronics America Inc. All rights reserved.2 Renesas Technology & Solution Portfolio © 2012 Renesas Electronics America Inc. All rights reserved.3 Microcontroller and Microprocessor Line-up Wide Format LCDs Industrial & Automotive, 130nm 350µA/MHz, 1µA standby 44 DMIPS, True Low Power Embedded Security, ASSP 165 DMIPS, FPU, DSC 1200 DMIPS, Performance 1200 DMIPS, Superscalar 500 DMIPS, Low Power 165 DMIPS, FPU, DSC 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 2010 2012 32-bit8/16-bit 32-Bit High Performance DSP, FPU with High Integration © 2012 Renesas Electronics America Inc. All rights reserved.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’ © 2012 Renesas Electronics America Inc. All rights reserved.5 Agenda Introduction to Virtual EEPROM Features How does it work? Configuration API Lab © 2012 Renesas Electronics America Inc. All rights reserved.6 Terminology Non-volatile Data Record EEPROM Erase and write sizes (or granularity) © 2012 Renesas Electronics America Inc. All rights reserved.7 MCU 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 © 2012 Renesas Electronics America Inc. All rights reserved.8 The Problem – Storing Non-Volatile Data Store in external EEPROM Advantages: Self-contained Easy to use Usually 1 byte writable Disadvantages: $$$ Uses HW No record management © 2012 Renesas Electronics America Inc. All rights reserved.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 Disadvantages: No record management Write granularity might not be 1-byte MCU ROM Data Flash MCU © 2012 Renesas Electronics America Inc. All rights reserved.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 [...]...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 Flash Block #0 Data #1 Data #2 EMPTY Data Flash Block #1 EMPTY 11 © 2012 Renesas Electronics America Inc All rights reserved What is the Virtual EEPROM Project? The Virtual EEPROM Project... use the Data Flash on your MCU as you would an EEPROM while adding other record management features MCU ROM Data Flash/ VEE Data Flash 12 © 2012 Renesas Electronics America Inc All rights reserved I2C Simple API User Application MCU R_VEE_Write(my_record) R_VEE_Read(my_record) 13 © 2012 Renesas Electronics America Inc All rights reserved ROM Data Flash Data Flash vs ROM Typically Data Flash has:... 2 VEE Record 2 © 2012 Renesas Electronics America Inc All rights reserved VEE Record 2 VEE Record 2 VEE Record 2 Defrag Finally! VEE Record 2 VEE Record 2 VEE Record 2 Virtual EEPROM API 33 © 2012 Renesas Electronics America Inc All rights reserved API Functions R_VEE_Read() R_VEE_Write() R_VEE_Defrag() R_VEE_Erase() R_VEE_GetState() R_VEE_ReleaseState() 34 © 2012 Renesas Electronics America... NOT VEE Record 2 VEE Record 1 25 © 2012 Renesas Electronics America Inc All rights reserved ENOUGH ROOM Virtual EEPROM Operational Overview VEE Sector 0 VEE Block 0 VEE Block 1 VEE Record 0 VEE Record 1 VEE Record 1 DEFRAG VEE Record 1 OCCURS VEE Record 0 VEE Record 2 VEE Record 2 VEE Record 1 26 © 2012 Renesas Electronics America Inc All rights reserved Virtual EEPROM Operational Overview VEE Sector... VEE Record 2 VEE Record 2 27 © 2012 Renesas Electronics America Inc All rights reserved Virtual EEPROM Operational Overview VEE Sector 0 VEE Block 0 DELETE OLD VEE Record 0 BLOCK VEE Record 1 VEE Record 1 VEE Record 0 VEE Record 2 VEE Record 2 28 © 2012 Renesas Electronics America Inc All rights reserved VEE Block 1 VEE Record 1 VEE Record 0 VEE Record 2 Virtual EEPROM Operational Overview VEE Sector... Record 1 VEE Record 0 VEE Record 2 VEE Record 2 23 © 2012 Renesas Electronics America Inc All rights reserved VEE Block 1 Virtual EEPROM Operational Overview VEE Sector 0 VEE Block 0 VEE Record 0 VEE Record 1 VEE Record 1 VEE Record 0 VEE Record 2 VEE Record 2 24 © 2012 Renesas Electronics America Inc All rights reserved VEE Block 1 Virtual EEPROM Operational Overview VEE Sector 0 VEE Block 0 VEE Block... Record 0 VEE Record 2 29 © 2012 Renesas Electronics America Inc All rights reserved Virtual EEPROM Configuration 30 © 2012 Renesas Electronics America Inc All rights reserved Why would I need more than 1 VEE Sector? Optimize (lower) the number of defrags 1 Sector VEE Sector #0 – Block #0 VEE Record 1 VEE Record 2 VEE Record 2 VEE Sector #0 – Block #1 VEE Record 1 31 © 2012 Renesas Electronics America... Size • Data • Check © 2012 Renesas Electronics America Inc All rights reserved Overhead 4 extra structure members per record Overhead depends on write granularity RX62N = 32 bytes per record RX63N = 8 bytes per record 21 © 2012 Renesas Electronics America Inc All rights reserved How does it work? 22 © 2012 Renesas Electronics America Inc All rights reserved Virtual EEPROM Terminology VEE Sector... Smaller write and erase sizes Shorter write times Larger number of rewrite/erase cycles MCU – Memory Area Erase Size Write Time Erase Time Erase/ Write Cycles RX62N - DF 8B 2KB 0.4ms 70ms 30,000 RX62N - ROM 256B 4KB 2.0ms 25ms 1,000 RX63N – DF 2B 32B 0.25ms 2ms 100,000 RX63N – ROM 14 Write Size 128B 4KB 1.0ms 25ms 1,000 © 2012 Renesas Electronics America Inc All rights reserved Virtual EEPROM Features... No seeking for records 1 cache entry per available record number VEE Record Cache Record 1 Address Address 0x100000 VEE Record 1 19 Record 2 Address Address 0x1007FF VEE Memory Area VEE Record 1 VEE Record 2 © 2012 Renesas Electronics America Inc All rights reserved Many More Records VEE Record 2 VEE Record 1 Error Detection Each record has its own error detection field Virtual EEPROM recovers . Class ID: Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Using Virtual EEPROM and Flash API for Renesas MCUs © 2012 Renesas Electronics. 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 © 2012 Renesas Electronics. faster Using advanced features of MCU Data #1 Data #2 EMPTY © 2012 Renesas Electronics America Inc. All rights reserved.12 MCU ROM Data Flash What is the Virtual EEPROM Project? The Virtual EEPROM