Home
        Data Flash Access Library
         Contents
1.                                                                                          Data Flash  USER FDL hardware   background    rive    FAL BUSY Blank    lt    Check     FAL_Handler AE    FAL_BUSY  4 j            FAL Handler     Write   FAL BUSY  x            FAL Handler au   FAL BUSY Verity  s                 FAL Handler     FAL_OK  E    24    NE   S AS 15    Data Flash Access Library       2 5 3    Figure 2 7 Background operation  blank check verify     2 5 4    Figure 2 8 No background operation for read command    R01USO0005ED01 02  User Manual    Background operation  blank check verify     Same procedure as for erase the verify or blank check will be performed in    background                                                                 Data Flash  USER FDL hardware   background   sew d  FAL BUSY  NN    Blank      FAL_Handler    Check   Verify  FAL_BUSY  p    NE NE  FAL OK  D         No background operation for read command    The read command doesn t use the background operation  It s directly finished    after the request acceptance     USER    FDL    oe                FAL OK          24    NE   S AS    Data Flash  hardware   background        16    Data Flash Access Library       2 6 Suspension of block oriented commands  erase     In cases of systems working under critical real time conditions  immediately  read write access to the data is a must  In such cases  separate request  variables must be defined for word command accesses and block command  access
2.                10ms time slize  potential FAL requester      MyTask D 10      while  true                        R01US0005ED0102   ENESAS 28  User Manual    Data Flash Access Library       3 3 2 6 FAL_GetVersionString    Description  This function provides the internal version information of the used library     Interface  REC version        __far fal u08  far FAL GetVersionString  void      Interface  IAR version            af func fal ule     far  FAL GetVersionString  void         Pre condition  None    Post condition  None    Argument    Argument Type Description  None                Return types values                Argument Type Description  fal u08  far  Pointer to the first character of a zero  terminated version string        Usage  REC version        far const fal ong  my version string        my version string   FAL GertVersiconstringi      Usage  IAR version        fal ugg   far  my version string     my version string   FAL GerVersionStringi         R01US0005ED0102   ENESAS 29  User Manual    Data Flash Access Library       Chapter 4 Operation    4 1 Blank check    The blank check operation can be used to check if all bits within the addressed  pool word are still    erased     The user can use blank check command freely   The blank check command is initiated by FAL_Execute   and must be  continued by FAL_Handler   as long as command is not finished  request   status updated      Table 2 Status of FAL_CMD_BLANKCHECK_WORD command             Status Class   Backgr
3.             Return types values       Argument Type Description   FAL ERR  CONFIGURATION   when descriptor data are not plausible   FAL OK when descriptor correct and  initialization successful        fal status fal status t             Usage       fal status t my status   my status   FAL Init  amp fal descriptor str      if my Status    FAL OK          FDL can be used         else         error handler                  R01US0005ED0102 RENESAS 24  User Manual    Data Flash Access Library       3 3 2 2 FAL_Open    Description  This function must be used by the application to activate the data flash     Interface  REC version        void _ f  r FAL Open  void      Interface  IAR version        _ far func void FAL Open void         Pre condition    FAL Open   does not check any precondition  but FAL Init      has to be  executed successfully already     Post condition  Data flash clock is switched on     Argument    Argument Type Description  None                Return types values                   Argument Type Description  None  Usage  FAL Open     R01US0005ED0102   ENESAS 25    User Manual    Data Flash Access Library       3 3 2 3 FAL Close    Description  This function deactivates the data flash     Interface  REC version        void _ far FAL Close void      Interface  IAR version        _ far func void FAL Open void         Pre condition  None    Post condition    Data flash clock is switched off  In case of FAL and EEL usage both  FAL Close and EEL Close must be called 
4.  ERASE    0x10   0x04       configuration error related status         FAL ERR PARAMETER    0x20   Ox00    FAL ERR CONFIGURATION    0x20 0x01    FAL ERR INITIALIZATION    0x20   0x02    FAL ERR COMMAND    0x20   0x03    FAL ERR REJECTED    0x20   0x04                                        fal status t                                   Status value Description   FAL OK default value  ready  no error detected   FAL BUSY request is accepted and is being processed  FAL ERR PROTECTION access outside permitted pool area   FAL ERR BLANKCHECK specified flash word is not blank   FAL ERR VERIFY specified flash word could not be verified  FAL ERR WRITE write is failed   FAL ERR ERASE block erase is failed       FAL ERR  PARAMETER not relevant for the FDL  defined for future  improvements     FAL ERR CONFIGURATION   Wrong values configured in descriptor  FAL ERR INITIALIZATION FDL not initialized or not opened  FAL ERR COMMAND wrong command code used                   FAL ERR REJECTED when FDL busy with another request       3 2 4 Structured type  tal request t     This type is used for definition of request variables and used for information  exchange between the application and the FDL  A request variable is passed  to the FDL to initiate a command and can be used by the requester  EEL   application     to check the status of its execution           FAL request type  base type for any FAL access      typedef struct         fal u32 data u32   fal ul    index ul   fal command t command 
5.  certain rate and malfunctions under certain use  conditions  Further  Renesas Electronics products are not subject to radiation resistance design  Please be sure to  implement safety measures to guard them against the possibility of physical injury  and injury or damage caused by fire  in the event of the failure of a Renesas Electronics product  such as safety design for hardware and software including  but not limited to redundancy  fire control and malfunction prevention  appropriate treatment for aging degradation or  any other appropriate measures  Because the evaluation of microcomputer software alone is very difficult  please  evaluate the safety of the final products or system manufactured by you     10  Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental  compatibility of each Renesas Electronics product  Please use Renesas Electronics products in compliance with all    R01US0005ED0102   ENESAS 2  User Manual    applicable laws and regulations that regulate the inclusion or use of controlled substances  including without limitation   the EU RoHS Directive  Renesas Electronics assumes no liability for damages or losses occurring as a result of your  noncompliance with applicable laws and regulations     11  This document may not be reproduced or duplicated  in any form  in whole or in part  without prior written consent of  Renesas Electronics     12  Please contact a Renesas Electronics sales office if 
6.  etc      Standard   Computers  office equipment  communications equipment  test and measurement equipment  audio  and visual equipment  home electronic appliances  machine tools  personal electronic equipment  and  industrial robots      High Quality   Transportation equipment  automobiles  trains  ships  etc    traffic control systems  anti disaster  systems  anti crime systems  safety equipment  and medical equipment not specifically designed for  life support      Specific   Aircraft  aerospace equipment  submersible repeaters  nuclear reactor control systems  medical  equipment or systems for life support  e g  artificial life support devices or systems   surgical  implantations  or healthcare intervention  e g  excision  etc    and any other applications or purposes  that pose a direct threat to human life     8  You should use the Renesas Electronics products described in this document within the range specified by Renesas  Electronics  especially with respect to the maximum rating  operating supply voltage range  movement power voltage  range  heat radiation characteristics  installation and other product characteristics  Renesas Electronics shall have no  liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified  ranges     9  Although Renesas Electronics endeavors to improve the quality and reliability of its products  semiconductor products  have specific characteristics such as the occurrence of failure at a
7.  function the  whole flash access is concentrated to two functions only  FAL_Execute       and FAL_Handler      3 3 4 Basic functional workflow    To be able to use the FDL  execute pool related commands  in a proper way  the requester has to follow a specific startup and shutdown procedure     Figure 3 1 Basic workflow flow       eegen Mat  ON  Power OFF 3    ee E    FAL_Init    OFF    og e    FAL Open FAL Close       FAL_Execute CMD     where CMD       READ_WORD  status   NOT busy  WRITE_WORD   BLANKCHECK_WORD   IVERIFY_WORD   ERASE BLOCK       FAL Handler      3 3 2 Interface functions    The interface functions create the functional software interface of the library   They are prototyped in the header file fdl h     R01US0005ED0102 RENESAS 23  User Manual    Data Flash Access Library       3 3 2 1 FAL Init    Description  Initialization of all internal data     Interface  REC version        fal status t _ fer FAL Initiconst __ far tal O6scoriptor E  descriptor pstr      Interface  IAR version         f  r func fal status t FAL Init const far fal descriptor t  fart descriptor pstrt            Pre condition  None    Post condition  Initialization is done     Argument    Argument Type Description   Pointer to the descriptor  describing the  FDL configuration   The virtualization of  the data flash address room is done  descriptor pstr fal descriptor based on that descriptor  The user can  use different descriptors to switch  between different FDL pool  configurations        
8.  inside the same 64 KByte page     Descriptor configuration  partitioning of the data flash     Before the FDL can be used the FDL pool and it s partitioning has to be  configured first  The descriptor is defining the physical virtual addresses and  parameter of the pool which will be automatically calculated by using the  FAL POOL SIZE and EEL POOL SIZE definition     Because the physical starting address of the data flash is fixed by the  hardware the user can only determine the total size of the pool expressed in  blocks  Also the physical size of the pool is limited by the hardware and must  not be defined by the user  Also the physical size of a flash block is a  predefined constant determined by the used hardware     The first configuration parameter is FAL POOL SIZE  The minimum value is 0  and means any access to the FDL pool is closed  The maximum value in case  of 78KOR Fx3 is 8  means 8 blocks   16 Kbytes      The other configuration parameter is EEL POOL SIZE  the size of the EEL   pool within the FDL pool used exclusively for Renesas EEPROM emulation  library only  The minimum size of the EEL pool is 0  This means the complete  FDL pool is occupied by the user for storing data  But also when a proprietary  EEPROM emulation is implemented by the user the complete pool has to be  reserved for it by specifying EEL POOL SIZEzO  The maximum size of the  EEL pool is FAL POOL SIZE     Notes       The USER pool and EEL pool are complementary  This means  the USER  pool i
9.  to write again into this  block   after writing the data  meaning   the flash word could  FAL ERR VERIFY normal not be verified   reason flash problems       remedy       meaning       FAL ERR PROTECTION heavy reason       remedy       meaning       FAL ERR REJECTED normal                                           remedy erase the block and try       R01US0005ED0102 3    NE   SAS 33  User Manual    Data Flash Access Library       to write again into this  block   request is being  processed   request checked and  FAL_BUSY normal  EZ accepted   nothing  call   remedy FAL_Handler until  status changes  request was finished  regular   no problems during  reason command execution  happens   remedy nothing       meaning             meaning       normal                   R01US0005ED0102   ENESAS 34  User Manual    Data Flash Access Library       4 5 Erase    The erase operation can be used to erase one block of the related pool  After  starting the erase command the hardware is checking if the addressed block is  already blank to avoid unnecessary erase cycles  After that the erase   command is initiated  The max  number of erase retries is 19     Table 6 Status of FAL CMD ERASE BLOCK command                Status Class   Background and Handling    FDL not initialized or  meaning  not opened  wrong handling on user    FAL ERR INITIALIZATION heavy   reason side    Initialize and open FDL  before using it   request cannot be  accepted   block number outside  the corresponding pool  
10. 0102   ENESAS    User Manual    Table of Contents    Background operation  Erasel  see  Background operation  wrttel   seen  Background operation  blank check verify                                    sssss    No background operation for read commande    Library specific simple type definitions                                   eeseeesssss  Enumeration type  fal command TN  Enumeration type     fal status t      Structured type  fal request t        Structured type  fal descriptor t        Basic functional worktflow  Interface e Lee EE    Operation WEEN    Chapter5 FDL usage by user application                       sssssessseeeeee enne 36    5 1 aieo                                                                36  5 2 Special consideration S entente trennen nnns nnne nenas 36  5 2 1 Reset CONSISTOMGCY isc  T m 36  5 2 2 EEL FDL or FDL On vies  toii cetera tine Do p rre DERE aae ANA 36  5 3     ET 37  5 3 1 Library for IAR Compiler enne nnne nnne nsns nnne 37  5 3 2 Library for REG Comnpller      eet anbaan aa abaa ae pae 37  5 4   edel DEE 38  5 4 1 Einker Sectiols   etos o uenenum EMI IM 38  5 4 2 Descriptor configuration  partitioning of the data flash           eeeeseesesrneesrrssrernsenns 38  5 4 3 IS LEE 38  5 5    General E 39  5 5 1 General flow  Initialization                       sssessssessese eene 39  5 5 2 General flow  commands except read    40  5 5 3 General flow  read commande 41  5 6 Example of FDL used in operating systems                       sse nenne
11. 05ED0102   ENESAS 31  User Manual    Data Flash Access Library       4 3 Read    The read operation can be used to read the content of the addressed pool   word  It is initiated and finished directly by FAL_Execute    FAL Handler  is    not needed in that case     Table 4 Status of FAL CMD READ WORD command       Status Class    Background and Handling       FAL ERR INITIALIZATION heavy    meaning    FDL not initialized or  not opened       reason    wrong handling on user  side       remedy    Initialize and open FDL  before using it       FAL ERR  PROTECTION heavy    meaning    FDL driver cannot  accept the request       reason    FDL driver is busy with  an other word  command or block  command  in case of  same block         remedy    Call FAL Handler as  long as request isn t  accepted        FAL OK normal          Caution     meaning    request was finished  regular       reason    no problems during  command execution  happens          remedy       nothing    During the execution of a read command the DMAs  via the SFR  DMCALL DWAITALL  and interrupts are disabled for a short period  see    Section 6 2 4      The reason for this originates from the following situation  In case a Data  Flash Read access is performed exactly at the same time while any DMA  transfer is triggered  there is a possibility for an internal bus conflict  between CPU bus and Data Flash bus  Such kind of bus conflict can  cause a wrong data to be read from the Data Flash   See also Customer    No
12. 1 Run time configuration    During runtime the configuration of the FDL can be changed dynamically  To  be able to do it more than one descriptor constant has to be defined by the  user in advance  Depends on the application mode different descriptors can be  chosen for the FAL_Init      function        o Mr TET mf    T some code   r  VW oe eee ee eae Was aed       load standard descriptor     my status FAL Init  amp fal descriptor str                                             J  Baha eee e S    ZS some code ard  PR aaah Rhee gue deme SE  FAL Close       close USER part of the FAL pool     1 Close       close EEL part of the FAL pool          but only if necessary  means     ye if EEL used in system ui     load alternative descriptor      my status FAL Init  amp fal descr 2 str      fe           uasa 43d RR AR REG at    Ca some code  7          Note  Before changing FAL pool configuration by using of different FAL pool   descriptor the user has to close the FAL  USER part of the pool  in any case    In case that the EEL is active in the system  the EEL part of the FAL pool has  to be closed by using EEL_Close   too     R01US0005ED0102   ENESAS 18  User Manual    Data Flash Access Library       3 2    3 2 1    3 2 2    R01USO0005ED01 02  User Manual    Data types  This chapter describes all data definitions used by the FDL     Library specific simple type definitions    This type defines simple numerical type used by the library       typedef unsigned char fal u08   typedef 
13. 424    NE   SAS    C  T  D          D  5          Data Flash Access Library    Type T01  European Release       16 Bit Single chip Microcontroller  78KOR Fx3 Series    Installer  RENESAS FDL 78KOR TO1E Vx xxx       All information contained in these materials  including products and product specifications   represents information on the product at the time of publication and is subject to change by  Renesas Electronics Corp  without notice  Please review the latest information published by  Renesas Electronics Corp  through various means  including the Renesas Technology Corp   website  http  Awww renesas com            Renesas Electronics R01USO0005ED0102  June 25  2013  www renesas com    Notice    1  All information included in this document is current as of the date this document is issued  Such information  however   is subject to change without any prior notice  Before purchasing or using any Renesas Electronics products listed  herein  please confirm the latest product information with a Renesas Electronics sales office  Also  please pay regular  and careful attention to additional and different information to be disclosed by Renesas Electronics such as that  disclosed through our website     2  Renesas Electronics does not assume any liability for infringement of patents  copyrights  or other intellectual property  rights of third parties by or arising from the use of Renesas Electronics products or technical information described in  this document  No license  expres
14. 7us    339us    171us    105us    70us       Write  1 word     2372us    1595us    1210us    1067us    987yus       Verify  1 word     684us    342us    173us    105us    82us       Erase  1 block        285473us       285194us    24    NE   S AS       285020yus       284932yus       284915us       46    Data Flash Access Library       6 2 3    Command    Typical command execution times    Typical command execution times       2 MHz    4 MHz    8 MHz    16 MHz    24 MHz       Read  1 word     191us    96us    48us    24us    16us       Blank check   1 word     564us    282us    142us    87us    58ys       Write  1 word     1295us    705us    38a3us    250ys    196us       Verify  1 word     570us    285yus    144us    87us    68yus       Erase  1 block     6 2 4       12695yus          12408us    Interrupt and DMA disable period    12262us       12190uUs          12176us    The following table shows the interrupt and DMA disable period for each FAL  function command     Function command    Max  interrupt disable  period  cycles     Max  DMA disable  period  cycles        FAL_Init    27       FAL Open    0       FAL Close    27       Blank check command     1 word     27       Verify command  1 word  27       Read command  1 word  30       Write command  1 word  27                Erase command  1 block  27    R01USO0005ED01 02  User Manual    24    NE   S AS 47    Data Flash Access Library       6 3 Cautions    Following cautions must be considered before developing of an appl
15. AS 9    Data Flash Access Library       R01USO0005ED01 02  User Manual    EEL pool    EEL pool is a part of the FDL pool and is assigned exclusively to Renesas  EEPROM Emulation Library  EEL  only  In case the EEL is not used the whole  FDL pool will be reserved for USER pool     USER pool    The USER pool is a part of the FDL pool  It can be used exclusively by the  application in a free way  In case of proprietary EEPROM emulation  implementation  user specific  the completely FDL pool has to be configured  as USER pool     24    NE   S AS 10    Data Flash Access Library       2 2 Address virtualization    To facilitate the access to the USER pool the physical addresses were  virtualized  The virtualized pool looks like a simple one dimensional array of  flash words  4 bytes      Figure 2 2 Relationship between physical and virtual pool addresses    OxEC800  OxEC7FF    OxECOO00  OxEBFFF    OxEB800  OxEB7FF    OxEBOO0  OxEAFFF    OxEAB800  OxEA7FF    Physical    address    R01USO0005ED01 02  User Manual    Data Flash    l       USER EEL     Pool      MEM OxO7FF N  Block 3  0x0600    Ox05FF  Block 2   0x0400   OxO3FF   0x0200    0x01FF    Flash block  and address  transformation Block 0  0x0000  lt      gt  USER pool     gt  EEL pool       EE p      I   virtual      l i word  index    24    NE   SAS    11    Data Flash Access Library       2 3 Access right supervision    As mentioned before the complete FDL pool is divided into two parts shared  between user and the EEL  The 
16. MD request    FAL Handler       proceed background process       while  my fal WCMD request status enu    FAL ERR REJECTED                        command execution       do    FAL Handler       while  my fal WCMD request status enu    FAL BUSY    if my fal WCMD request status enu    FAL OK  error handler             34   NE   S AS 27    Data Flash Access Library       3 3 2 5 FAL Handler    Description    This function is used by the application to proceed the execution of a  command running in the background  In case of the FDL the functionality of  the Handler is reduce to simple status polling of the sequencer  In case any  background command was suspended in the past  the FAL Handler takes  care for the resume process     Interface  REC version        void   far FAL Handler  void      Interface  IAR version           _ far func void FAL Handler  void      Pre condition  FAL Init   executed successfully with status FAL OK   FAL Open   executed already     Post condition  In case of finished command the status is written to the request structure     Argument    Argument Type Description  None                Return types values    Argument Type Description  None                Usage          infinite scheduler loop      de 4     proceed potential command execution     FAL Handler          20ms time slize  potential FAL requester      yTask A 20         10ms time slize  potential FAL requester      yTask B 10         40ms time slize  potential FAL requester      yTask C 40   
17. The user  can uses verify freely to check the quality of user data  The verify command is  initiated by FAL_Execute   and must be continued by FAL_Handler   as long  as command is not finished  request status updated      Table 3 Status of FAL_CMD_IVERIFY_WORD command             Status Class   Background and Handling  FDL not initialized or  meaning  not opened  wrong handling on user    FAL ERR INITIALIZATION heavy reason   cide    Initialize and open FDL  before using it   request cannot be  accepted   word index is outside  the corresponding pool  set correct word index  and try again   FDL driver cannot  accept the request  FDL driver is busy with  an other word   reason   command or block  command  in case of  same block     Call FAL_Handler as  remedy   long as request isn t  accepted    specified flash word in  meaning   pool could not be  verified   any bit in the  FAL_ERR_VERIFY normal reason addressed flash word  isn t electrically correct  nothing  free   remedy   interpretation at  requester side   request is being  processed   request checked and  accepted   nothing  call   remedy   FAL Handler until  status changes  request was finished  regular   no problems during  reason   command execution  happens       remedy       meaning       FAL ERR PROTECTION heavy reason       remedy       meaning       FAL ERR REJECTED normal                   meaning       FAL BUSY normal       850n          meaning       FAL OK normal                remedy   nothing       R01US00
18. ables for same data and so on  In other words please consider such reset  scenarios to avoid invalid data  The EEL provided by Renesas Electronics is  designed to avoid read of invalid data cause by such reset scenarios  The  following chapter describes the applications where the EEL should be used     5 2 20  EEL  FDL or FDL only    Depending on the security level of the application  write frequency of variables  and variables count it should be considered whether to uses the EEL FDL or  the FDL only     5 2 2 1 FDL only    By using the FDL only the application has to take care about all reset  scenarios and writing flow of different variables with different sizes     Application scenarios      Programming of initial or calibration data    user specific EEPROM emulation    5 2 2 2 EEL FDL    The duo of EEL and FDL allows the user to uses the EEL for high write  frequency of different variables with different sizes in a secure way and  additionally the USER pool is available for free usage     Application scenarios      Programming of initial or calibration data    Large count of variables and high write frequency by using the EEL    Secure data handling completely handled by EEL    R01US0005ED0102 RENESAS 36  User Manual    Data Flash Access Library       5 3    5 3 1    5 3 2    R01USO0005EDO0102    File structure    Library for IAR Compiler     root   TO info txt     root   lib   fdl h   fdl types h  fdl r26     root smp  C   fdl descriptor c  fdl descriptor h  fd  sample 
19. construction of the FDL does not allow user  access to the EEL pool and vice versa     Figure 2 3 FDL pool access supervision    FDL pool            N 1       USER l    USER pool access    N flash words MS    FDL            0x0000                      R01US0005ED0102   ENESAS 12  User Manual    Data Flash Access Library       2 4  Request Response architecture    The communication between the requester  user  and the executor  here the  FDL  is a common structured request variable  The requester can specify the  request and pass it to the FDL  After acceptance the progress of the execution  can be checked by polling the request status     From execution time point of view the commands of the FDL are divided into  two groups      suspendable block oriented command like block erase taking relatively long  time for its execution     not suspedable word oriented commands like write  read     taking very short  time for its execution    Depending on the real time requirements the user can decide if independent   quasi parallel execution of block and word commands is required or not  In  such a case two separate request variables have to be defined and managed  by the application  Please refer to chapter  Operation  for details     Following figure shows the access from requester and FDL point of view     Figure 2 4 Request oriented communication between FDL and its requester    E       R01US0005ED0102   ENESAS 13  User Manual    Data Flash Access Library       2 5 Background opera
20. correct block number  and try again   FDL driver cannot  accept the request  FDL driver is busy with  an other word   reason   command or block  command  in case of  same block     Call FAL_Handler as  remedy   long as request isn t  accepted    specified flash block  could not be erased  FAL_ERR_ERASE fatal   reason internal flash problems  do not use this block  anymore   request is being  processed   request checked and  accepted   nothing  call   remedy   FAL_Handler until  status changes  request was finished  regular   no problems during  reason command execution  happens       remedy       meaning       FAL_ERR_PROTECTION heavy   reason       remedy       meaning       FAL_ERR_REJECTED normal          meaning          remedy       meaning       FAL BUSY normal   TE          meaning       FAL_OK normal                remedy   nothing       R01US0005ED0102 RENESAS 35  User Manual    Data Flash Access Library       Chapter 5 FDL usage by user application    5 1 First steps    It is very important to have theoretic background about the Data Flash and the  FDL in order to successfully implement the library into the user application   Therefore it is important to read this user manual in advance especially  subchapter    Cautions    of chapter    Characteristics        5 2 Special considerations    5 2 1 Reset consistency    During the execution of FDL commands a reset could occur and the data could  be damaged  In such cases it should be considered whether to uses two  vari
21. e operating system where the FDL is  used for Data Flash access     Figure 5 4 FDL used in an operating system    operating system    Task 1  each 50ms   if reg1 status    FAL BUSY   FAL Execute req1     Task 2  each 100ms   if req2 status    FAL BUSY   FAL Execute req2     IDLE Task  each 2ms   FAL Handler      Task 3  emergency task   do   FAL_Execute req_et   FAL_Handler       while req_et status    rejected    while req_et status    FAL_BUSY   FAL_Handler         This sample operating system shows three different task types which are  described below     Task 1 and Task 2    This task type is a requesting task like Task 1 and 2  Such tasks just start any  FDL command via the FAL_Execute function and assume that it will be  finished in the background via the IDLE task     IDLE task  The IDLE task will be used by the application for continuing any running FAL  command  That means the FAL_Handler must be called inside of such a task     Emergency task  The difference between this task type and the requesting type  Task 1 and    R01US0005ED0102   ENESAS 42  User Manual    Data Flash Access Library       Task 2  is that this task performs any FAL commands completely without  waiting in the background  Such task can be used in case of voltage drop  where important data must be saved before the device is off                                                                                         5 7 Example  Simple application  The following sample shows how to use each command i
22. enesas  In case of devices incorporating data flash the FDL is  representing this layer  It offers all atomic functionality to access the FDL pool   To isolate the data flash access from the used flash media this layer  the FDL   is transforming thy physical addresses into a virtual  linear address room     EEPROM access layer    The EEPROM layer allows read write access to the Data Flash at abstract  level  It is represented by Renesas EEL or alternatively any other  user  specific implementation     Application layer    The application layer is user s application software that can use freely all  visible  specified by the API definition  commandos of upper layers  The  EEPROM layer and the flash access layer can be used asynchronously  The  FDL manages the access rights to it in a proper way     24    NE   S AS 7    Data Flash Access Library       1 2    R01USO0005ED01 02  User Manual    Naming Conventions    Certain terms  required for the description of the Data Flash Access and  EEPROM emulation library are long and too complicated for good readability  of the document  Therefore  special names and abbreviations will be used in  the course of this document to improve the readability     These abbreviations shall be explained here        Abbreviations               Acronyms Description  Block Smallest erasable unit of a flash macro  Embedded Flash where the application code is stored   Code Flash For devices without Data Flash EEPROM emulation  might be implemented on tha
23. enu   fol Stot  us t status enu       fal request tr          R01US0005ED0102   ENESAS 20  User Manual    Data Flash Access Library          Struct member    Description       data_u32    32 bit buffer for data exchange during read write  access       index_u16    virtual word index within the targeted pool       command_enu    command code       status_enu       request status code  feedback        3 2 5 Structured type    fal_descriptor_t       This type defines the structure of the FDL descriptor  It contains all  characteristics of the FDL  It is used in the fdl descriptor c file for definition of  the ROM constant fal descriptor str     Based on configuration data inside the fdl descriptor h the initialization data of  descriptor constant is generated automatically in the fdl descriptor c        typedef struc       R01USO0005ED01 02  User Manual    S 3    fal  fa  fal  fal  fal  fal  fal  fal  fel  fa  fal  ral  fal  fal  fal  tel  fal  fal  fal  fal  fal  fal  fal  fal  fal  fal  fal          FAL descriptor type       UHR  ES  merece   712032     u32  Mae    E EE SE EE ee ee EE E    ul    ul    OY OY Ov OY Oy OY OS Oy Oy OY OY OY Oy Os OS       6    6      u08    u08    u08    u08    fal pool first addr u32   eel pool first addr u32   user pool first addr u32   fal pool last addr u32   eel pool last addr u32   user pool last addr u32   fal pool first block ulg   eel pool first block ul16   user pool first block ul6   fal pool last block ul   eel pool last block u16   us
24. eq status enu    FAL ERR REJECTED   next state   erase stare err                block erase is running in background here      void erase state 1  void          if read during erase needed  read immediately     if emergency read  TRUE                 do    my WCMD req index ul6   234   my WCMD req command enu   FAL CMD READ WORD   FAL Execute   amp my WCMD req                  FAL Handler       enforce eventually blocking command                           while   my WCMD req status enu  FAL ERR REJECTED           read request accepted   gt  read the data directly     if  my WCMD req status enu  FAL OK    my data u32   my WCMD req data u32   else                  in case of error  goto error state     next state   erase state err                              dE EE EHE NEXT PAGE        gt  dPHETETETETETETE          24    NE   S AS 44    Data Flash Access Library       R01USO0005ED01 02  User Manual          if write during erase needed  read immediately     if emergency write  TRUE   i  do    my data_u32   0x12345678   my WCMD req data u32   my data u32   my WCMD req index ul6   234   my WCMD req command enu   FAL CMD WRITE WORD   FAL Execute  amp my WCMD reg               T             FAL Handler       enforce eventually blocking command                     while   my WCMD req status enu  FAL ERR REJECTED                 enforce execution of the write request     do       FAL Handler        while  my WCMD req status enu  FAL BUSY          if error during write     goto error 
25. er pool last block ul6   fal first widx ul6    eel first widz ul       user first widx ul6    fal last widx ul6    eel last widx ul6    user last widx ul6    fal pool wsize ul6    eel pool wsize ul6    user pool wsize ulg   block size ul6    block wsize ul6    fal pool size u08    eel pool size u08    user pool size u08    fx MHz u08                                                 fal descriptor t        24    NE   S AS 21    Data Flash Access Library          Struct member    Description          fal_pool_first_addr_u32    first physical address of the FAL pool       eel_pool_first_addr_u32       first physical address of the EEL pool       user pool first addr u32       first physical address of the USER pool       fal pool last addr  u32       last physical address of the FAL pool       eel pool last addr u32       last physical address of the EEL pool       user pool last addr u32       last physical address of the USER pool       fal pool first block u16       first virtual block of the FAL pool       eel pool first block u16       first virtual block of the EEL pool       user pool first block u16       first virtual block of the USER pool       fal pool last block u16       last virtual block of the FAL pool       eel pool last block u16       last virtual block of the EEL pool          user pool last block u16    last virtual block of the USER pool       fal first widx u16    first virtual word index inside the FAL pool       eel first widx u16    first virtual word i
26. es  Both types of access are managed separately on FDL and  requester side     The suspension and resumption of the running block command  erase  is  managed automatically according to the following rules      word commands cannot be suspended     each block command can be suspended by any word command     User requested block command does always suspend running block  commands of the EEL     EEL requested block commands cannot suspend running user block  command    In other words       word commands have always higher priority than block commands    user access have always higher priority than EEL  running in background     The following table shows dependencies between running and requested  commands of EEL or user     Table 1 Block command suspension rules    running command  command acceptance WCMD BCMD        user   eel   WCMD suspend  suspend     RK     eel  rejected   rejected resume resume  WCMD suspend  suspend   requested  user  rejected   rejected resume resume     command BCMD    eel  rejected   rejected rejected rejected  BCMD suspend    user  rejected   rejected resume rejected                            Agenda    WCMD   word command   BCMD   block command    rejected   requested command is rejected  suspend   running block command is suspended        when the address of the WCMD refers to the block addressed by BCMD  the WCMD will be rejected too     R01US0005ED0102   ENESAS 17  User Manual    Data Flash Access Library       Chapter 3 User interface  API     3 
27. for switching off the Data Flash     Argument    Argument Type Description  None                Return types values                   Argument Type Description  None  Usage  FAL Closet    R01US0005ED0102 RENESAS 26    User Manual    Data Flash Access Library       3 3 2 4 FAL Execute    R01USO0005ED01 02  User Manual    Description    This is the main function of the FDL the application can use to initiate  execution of any command  Please refer to the chapter  Operation  for  detailed explanation of each command     Interface  REC version           woud _ far FAL Execute  near fal request t  request pstr         Interface  IAR version           _ far func void FAL Execute  near fal request t   near     request pstr         Pre condition  FAL Init   executed successfully with status FAL OK   FAL Open   executed already     Post condition          None   Argument  Argument Type Description  request pstr fal request t This argument defines the command  which should be executed by FDL  It is a  request variable which is used for bi   directional information exchange before  and during execution between FDL and  the application              Return types values                   Argument Type Description  None  Usage  _ heer fal request t my fal WCMD request str     my fal WCMD request data u32   0x12345678   my fal WCMD request index ul6   0x0123   my fal WCMD request command enu   FAL CMD WRITE WORD           command initiation                   doe 1  FAL Execute  amp my fal WC
28. ication     R01USO0005ED01 02  User Manual    Library code and constants must be located completely in the same 64k  flash page     Initialization by FAL Init must be performed before execution  FAL Handler FAL Execute functions     Do not read data flash directly  means without FAL  during command  execution of FAL    Each request variable must be located from an even address    All functions are not re entrant  That means don t call FAL functions inside  the ISRs while any FAL function is already running     Task switches  context changes and synchronization between FDL  functions    All FDL functions depend on FDL global available information and are  able to modify this  In order to avoid synchronization problems  it is  necessary that at any time only one FDL function is executed  So  it is not  allowed to start an FDL function  then switch to another task context and  execute another FDL function while the last one has not finished     Example of not allowed sequence      Task 1  Start an FDL operation with FDL_Execute     Interrupt the function execution and switch to task 2  executing  FDL_Handler function      Return to task 1 and finish FDL_Execute function    After execution of FAL_Close or FAL_Init function all requested running  commands will be aborted and cannot be resumed  Please take care that  all running commands are finished before calling this functions     It is not possible to modify the Data Flash parallel to modification of the  Code Flash    Suspensi
29. led by the library     Figure 1 1 Components of the EEPROM emulation system    R01USO0005ED01 02  User Manual          FDL POOL  data flash  physical data flash                            FDL flash access layer  FAL                                               EEPROM layer  EEL  EEL API  User application application layer             To boost the flexibility and the real time characteristics of the library it offers  only fast atomic functionality to read  write and erase the Data Flash memory  at smallest possible granularity  Beside the pure access commands some  maintenance functionality to check the quality of the flash content is also  provided by the library    24    NE   S AS 6    Data Flash Access Library       1 1    R01USO0005EDO0102    User Manual    Components of the EEPROM Emulation System    To achieve a high degree of encapsulation the EEPROM emulation system is  divided into several layers with narrow functional interfaces     Physical flash layer    The FDL is accessing the Data Flash as a physical media for storing data in  the EEPROM emulation system  The Data Flash is a separate memory that  can be accessed independent of the Code Flash memory  This allows  background access to data stored in the Data Flash during program execution  located in the code flash  The physical Data Flash is mapped by the FDL into a  virtual pool called FDL Pool below     Flash access layer    The Data Flash access layer is represented by the flash access library  provided by R
30. linker file xcl       Library for REC Compiler     root   fdl_info txt     root   lib   fdl h  fdl inc    fdl_types h  fdl lib     root   smp  C   fdl_descriptor c  fdl descriptor h  fd  sample linker file dr        root   smp  asm    fdl descriptor asm   fdl descriptor inc   fd  sample linker file dr       FDL library  Library release notes    FDL interface definition  FDL types definition  Pre compiled library    Descriptor calculation part  Pool configuration part  Sample Linker file    Library release notes    FDL library    FDL interface definition  Compiler   FDL interface definition  Assembler     FDL types definition  Pre compiled library    Sample folder for C Compiler projects  Descriptor calculation part   Pool configuration part   Sample Linker file    Sample folder for Assembler projects  Descriptor calculation part   Pool configuration part   Sample Linker file    24    NE   S AS 37    Data Flash Access Library       5 4    5 4 1    5 4 2    5 4 3    R01USO0005ED01 02  User Manual    Configuration    Linker sections    Following segments are defined by the library and must be configured via the  linker description file     FAL CODE Segment for library code   Can be located anywhere in the code flash     FAL CNST Segment for library constants like descriptor   Can be located anywhere in the code flash     FAL DATA Segment for library data   Must be located inside the SADDR RAM    NOTE  FAL CODE and FAL CNST segments must be located anywhere in  the Code Flash but
31. n 42  5 7 Example  Simple application  43  5 8 Example  Read Write during background erase                         sse 44  Chapter 6   Characteristics                 ssessssssssssssessseeeeeeeee enne enne nn tenens tris en tete enne s inris intret tenen 46  6 1 Hesource consutmbptLlOn serrera an rures estatura ten ceeded uen ape RAES reet uu ET 46  I FTT E                                46  6 2 1 Maximum function execution times                    sseesseeeneeenn enne 46  6 2 2 Maximum command execution mes enne 46  6 2 3 Typical command execution MeS nennen nnne 47  6 2 4 Interrupt and DMA disable Dertod AA 47  MEE pn c  TEE 48  R01US0005ED0102 RENESAS 5    User Manual    Data Flash Access Library       Chapter 1 Introduction    This user s manual describes the overall structure  functionality and software  interfaces  API  of the Data Flash Library  FDL  accessing the physical Data  Flash separated and independent from the Code Flash  This library supports  dual operation mode where the content of the Data Flash is accessible  read   write  erase  during instruction code execution     The FAL  flash access layer  is a layer of EEPROM emulation system and  encapsulates the low level access to the physically flash in secure way  In  case of Data Flash this layer is using the FDL  It provides a functional socket  for Renesas EEPROM emulation software  but beside this it offers also direct  access to the user at witch the access priority and access separation is fully  control
32. n a simple way   extern far const fal descriptor t fal descriptor str   fal Status t my fal status enu   _ Near fal request t request      initialization     my fal status enu     FAL Init     far fal descriptor C   amp fal descriptor str ij  if my fal status enu    FAL OK  ErrorHandler     FAL Open        erase block 0     request index ul6   0x0000   request command enu   FAL CMD ERASE BLOCK   FAL Execute   amp request     while request status enu    FAL BUSY  FAL Handler      ifirequest status enu T  FAL OK  ErrorHandler        write patter 0x12345678 into the widx   0     request index ulg   0x0000   request data u32   0x12345678   request command enu   FAL CMD WRITE WORD   FAL Execute  amp request    while request status enu    FAL BUSY  FAL Handler     ifirequest status enu t  FAL OK  ErrorHandler        read value of widx   0     request index ulg   0x0000   request command enu   FAL CMD READ WORD   FAL Execute  amp request    if request status enu l  FAL OK  ErrorHandler        check whether the written pattern is correct     if requ  st data u32 l  0x12345678  ErrorHandler        blank check widx   0     request index ul6   0x0000   request command enu   FAL CMD BLANKCHECK WORD   FAL Execute  amp request    while request status enu    FAL BUSY  FAL Handler     if request status enu    FAL ERR BLANKCHECK  ErrorHandler        verify widx   0     request index ulg   0x0000   request command enu   FAL CMD IVERIFY WORD   FAL Execute  amp request    while request status en
33. ndex inside the EEL pool       user first widx u16    first virtual word index inside the USER pool       fal last widx u16    last virtual word index inside the FAL pool       eel last widx u16    last virtual word index inside the EEL pool       user last widx u16    last virtual word index inside the USER pool       fal pool wsize u16    size of the FAL pool expressed in words       eel pool wsize u16    size of the EEL pool expressed in words       user pool wsize u16    size of the USER pool expressed in words       block size u16    size of one Data Flash block expressed in bytes       block wsize u16    size of one Data Flash block expressed in  words       fal pool size u08    size of the FAL pool expressed in blocks   Note 1        eel pool size u08    size of the EEL pool expressed in blocks   Note 2  3        user pool size u08    size of the USER pool expressed in blocks   Note 2  3        fx MHz u08       not relevant for the FDL       Note 1  the maximal number of fal pool size u08 is 0x08  fixed to  78KOR Fx3  8x2KByte blocks    Note 2  the sum of eel pool size u08 and user pool size u08 must not  exceed fal pool size u08    Note 3  both descriptor configuration conditions will be checked by    FAL Init         R01USO0005ED01 02  User Manual    24    NE   S AS 22    Data Flash Access Library       3 3 Functions    Due to the request oriented interface of the FDL the functional interface is very  narrow  Beside the initialization function and some administrative
34. on of word commands like read  write  verify  and blank check is  not possible    During the execution of any FAL function  the interrupts may be disabled  for a short period of time  see also Section 6 2 4      During the execution of the read command the DMA operation will be  disabled for short period  see also Section 6 2 4      24    NE   S AS 48    Data Flash Access Library       R01USO0005ED01 02  User Manual    Revision history    This is a first release of the user s manual              Chapter Page Description  Rev  1 01    all Initial document  Rev  1 02    4 3 32 Caution added   6 1 46 Resource consumption updated   6 2 46 47 Timing measurements updated   6 3 48 Cautions regarding interrupt and DMA disable  times added                24    NE   S AS 49    Data Flash Access Library       Data Flash Access Library       R01US0005ED0102   ENESAS 50  User Manual    
35. ory    nonvolatile memory  The content    of that memory can not be changed        Serial programming    The onboard programming mode is used to program the  device with an external programmer tool        Single Voltage       For the reprogramming of single voltage flashes the  voltage needed for erasing and programming are  generated onboard of the microcontroller  No external  voltage needed like for dual  voltage flash types        24    NE   S AS 8    Data Flash Access Library       Chapter 2 Architecture    2 1    This chapter describes the overall architecture of the FDL library     Data Flash fragmentation    The physical Data Flash location is fixed to a physical address assigned by the  hardware  e g  for 78KOR Fx3  0xE9800     OxED7FF   Just the logical  fragmentation of the Data Flash can be configured within the given range     Following figure shows the logical fragmentation of physical Data Flash     Figure 2 1 Logical fragmentation of physical Data Flash    R01USO0005ED01 02  User Manual    OxED7FF       USER pool  Access by  application only    EEL pool    OxE9800    Access by  EEL only       FDL pool    The FDL pool defines the maximum usage of physical Data Flash used by the  FDL  In case of physical Data Flash size of 16KByte it is possible to define the  following sizes for FDL pool configuration  2KByte  4KByte  6KByte  8KByte   10KByte  12KByte  14KByte  16KByte  This pool is divided into the EEL and  USER pool which are described below     24    NE   S 
36. ound and Handling  FDL not initialized or  meaning  not opened  wrong handling on user    FAL ERR INITIALIZATION heavy reason   Side    Initialize and open FDL  before using it   request cannot be  accepted   word index is outside  the corresponding pool  set correct word index  and try again   FDL driver cannot  accept the request  FDL driver is busy with  an other word   reason   command or block  command  in case of  same block     Call FAL Handler as  remedy long as request isn t  accepted    specified flash word is  not blank   any bit in the flash  reason   word addressed by  word index isn t erased  nothing  free   remedy   interpretation at  requester side   request is being  processed   request checked and  accepted   nothing  call   remedy   FAL Handler until  status changes  request was finished  regular   no problems during  reason   command execution  happens       remedy       meaning       FAL ERR PROTECTION heavy reason       remedy       meaning       FAL ERR REJECTED normal          meaning       FAL ERR BLANKCHECK normal          meaning       FAL BUSY normal       850n          meaning       FAL OK normal                remedy   nothing       R01US0005ED0102   ENESAS 30  User Manual    Data Flash Access Library       4 2 Internal verify    The internal verify operation can be used to check if all bits  0   s and 1   s  are  electronically correct written  Inconsistent and weak data caused by  asynchronous RESET can be detected by using the verify command  
37. s  implied or otherwise  is granted hereby under any patents  copyrights or other  intellectual property rights of Renesas Electronics or others     3  You should not alter  modify  copy  or otherwise misappropriate any Renesas Electronics product  whether in whole or  in part   4  Descriptions of circuits  software and other related information in this document are provided only to illustrate the    operation of semiconductor products and application examples  You are fully responsible for the incorporation of  these circuits  software  and information in the design of your equipment  Renesas Electronics assumes no  responsibility for any losses incurred by you or third parties arising from the use of these circuits  software  or  information     5  When exporting the products or technology described in this document  you should comply with the applicable export  control laws and regulations and follow the procedures required by such laws and regulations  You should not use  Renesas Electronics products or the technology described in this document for any purpose relating to military  applications or use by the military  including but not limited to the development of weapons of mass destruction   Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose  manufacture  use  or sale is prohibited under any applicable domestic or foreign laws or regulations     6  Renesas Electronics has used reasonable care in preparing 
38. s always the remaining none EEL pool  in other words  USER POOL SIZE   FAL POOL SIZE     EEL POOL SIZE        The virtual address 0 of the user pool corresponds with the successor of the  last EEL pool word     Request structure    Depending on the user application architecture more than one request variable  could be necessary  For example if an immediate write is necessary during  running erase  In such a case two request variables  one for write and one for    24    NE   S AS 38    Data Flash Access Library       erase  are necessary  Please take care that each request variable is located  on an even address     5 5 General flow    5 5 1 General flow  Initialization    The following figure illustrates the initialization flow     Figure 5 1 Initialization flow       FAL Init             FAL ERR CONFIGURATION       status     FAL OK       FAL Open         Execute any FAL  commands                          Y  FAL Close Error handler                            R01US0005ED0102   ENESAS 39  User Manual    Data Flash Access Library       5 5 2 General flow  commands except read    After initialization of the environment the application can uses the commands  provided by the library  The following figure illustrates the general flow of  command  except read command  execution     Figure 5 2 FAL command execution  except read command     Y  fill request  CMD    Y      FAL Execute CMD                                FAL Handler    A                       FAL_ERR_REJECTED            s
39. state     if  my WCMD req status enu  FAL OK   next state   erase state err                   proceed the BCMD execution     FAL Handler           erase request finished   gt  goto state 2     if my BCMD req status enu  FAL OK     next state   erase state 2   else          in case of error  goto error state             next state   erase state err      24    NE   S AS 45       Data Flash Access Library       Chapter 6 Characteristics    6 1    6 2    6 2 1    6 2 2    R01USO0005EDO0102    User Manual    Resource consumption    Resource consumption       REC Compiler    IAR Compiler       Max  code size   code flash     1715 bytes    1749 bytes       Constants  code f    lash     62 bytes    62 bytes       Internal data   SADDR RAM     2 bytes    2 bytes       Max  stack  RAM     All values are based on FDL version V1 10     Timings       40 bytes       40 bytes       The following timings have been measured on the uPD78F1845 device and  FDL version V1 10     Maximum function execution times    Function    Maximum function execution time       FAL Init    1476 fclk   14us       FAL Open    28 fclk   89us       FAL Close    270 fclk   13us       FAL Execute    1172 fclk   14us       FAL Handler    864 fclk   3us       FAL_GetVersionString       Maximum command execution times    Maximum command execution time    14 fclk          Command    2 MHz    4 MHz    8 MHz    16 MHz    24 MHz       Read  1 word     230yus    116us    58ys    29us    20us       Blank check   1 word     67
40. t flash in the so called data  area   Embedded Flash where mainly the data of the EEPROM  Data Flash emulation are stored  Beside that also code operation    might be possible        Dual Operation    Dual operation is the capability to fetch code during  reprogramming of the flash memory  Current limitation is  that dual operation is only available between different  flash macros  Within the same flash macro it is not  possible                                      EEL EEPROM Emulation Library  In distinction to a real EEPROM the EEPROM emulation  EEPROM uses some portion of the flash memory to emulate the  emulation EEPROM behavior  To gain a similar behavior some  side parameters have to be taken in account   FAL Flash Access Library  Flash access layer   FCL Code Flash Library  Code Flash access layer   FDL Data Flash Library  Data Flash access layer    Flash EPROM      Electrically erasable and  Flash programmable nonvolatile memory  The difference to  ROM is  that this type of memory can be re programmed  several times   A flash block is the smallest erasable unit of the flash  Flash Block  memory   A flash comprises of the cell array  the sense amplifier  Flash Macro and the charge pump  CP   For address decoding and  access some additional logic is needed   Non volatile memory  All memories that hold the value   NVM even when the power is cut off  E g  Flash memory   EEPROM  MRAM     RAM    Random access memory    volatile memory with  random access  ROM  Read only mem
41. tatus     FAL_BUSY          FAL Handler                 FAL_BUSY  E status              Y    Error handler    In case the requested command is rejected the application has to call the  FAL Handler   for finishing suspend the background command and try to  execute the command again                 R01US0005ED0102 RENESAS 40  User Manual    Data Flash Access Library       5 5 3 General flow  read command    The difference between the read command and other commands   erase write verify blank check  is that the read command will be completed  directly during FAL_Execute   function  That means no additionally   FAL Handler  calls are required     y  fill request  CMD read     Y  si FAL Execute CMD     Figure 5 3 FAL read command execution                               FAL Handler                      l FAL_ERR_REJECTED  status                    es  Error handler    In case the requested command is rejected the application has to call the  FAL Handler  for finishing suspend the background command and try to  execute the command again     R01US0005ED0102 RENESAS 41  User Manual    Data Flash Access Library       5 6 Example of FDL used in operating systems    The possibility of background operation and request response structure of the  FDL allows the user to uses the FDL in an efficient way in operating systems     Note  Please read the chapter    Characteristics  gt Cautions    carefully  before using the FDL in such operating systems     The following figure illustrates a sampl
42. the information included in this document  but Renesas  Electronics does not warrant that such information is error free  Renesas Electronics assumes no liability whatsoever  for any damages incurred by you resulting from errors in or omissions from the information included herein     7  Renesas Electronics products are classified according to the following three quality grades     Standard        High  Quality   and    Specific     The recommended applications for each Renesas Electronics product depends on the  product s quality grade  as indicated below  You must check the quality grade of each Renesas Electronics product  before using it in a particular application  You may not use any Renesas Electronics product for any application  categorized as    Specific    without the prior written consent of Renesas Electronics  Further  you may not use any  Renesas Electronics product for any application for which it is not intended without the prior written consent of  Renesas Electronics  Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or  third parties arising from the use of any Renesas Electronics product for an application categorized as  Specific  or for  which the product is not intended where you have failed to obtain the prior written consent of Renesas Electronics   The quality grade of each Renesas Electronics product is    Standard    unless otherwise expressly specified in a Renesas  Electronics data sheets or data books 
43. tification RO1TU0003ED0103      R01US0005ED0102   ENESAS  User Manual    32    Data Flash Access Library       4 4 Write    The write operation writes 32 bit data into passed word index  To protect  existing flash data against accidental overwrite 1 word blank check is  executed in advance  After that the write command is initiated  In case of  successfully finished writing the quality of data will be checked via internal  verify     Table 5 Status of FAL CMD WRITE WORD command             Status Class   Background and Handling  FDL not initialized or  meaning  not opened  wrong handling on user    FAL ERR INITIALIZATION heavy reason   Side    Initialize and open FDL  before using it   request cannot be  accepted   word index is outside  the corresponding pool  set correct word index  and try again   FDL driver cannot  accept the request  FDL driver is busy with  an other word   reason   command or block  command  in case of  same block     Call FAL Handler as  remedy long as request isn t  accepted    specified flash word in  pool is not blank  write  meaning   was not performed  the  content of flash word  remains untouched  FAL ERR BLANKCHECK normal overwriting of non   reason erased flash words is  not allowed   erase the block before  remedy writing again into this  block   flash word addressed  by word index couldn t  meaning   be written correctly  after performing the  FAL ERR WRITE normal max  number of retries  reason flash problems   erase the block and try  remedy
44. tion    Due to the fact that the Data Flash operates in the background it is possible to  do something else in the meantime  For example the application could prepare  next data for writing into the Data Flash or handle different ISRs  Background  operation is a powerful feature especially in operation systems were each task  could start FAL commands which will be executed in the background during  task switching     2 5 4 Background operation  Erase     The erase command is from timing point of view the longest command  As  shown in the figure below  the application has the possibility to execute other  user code during the background operation     Figure 2 5 Background operation  Erase        Data Flash  USER FDL hardware     background        FAL_Execute ERASE     P                FAL BUSY                    FAL Handler         E             FAL BUSY                    FAL Handler         J    Erase             FAL_BUSY  d                FAL Handler         M             FAL_BUSY  E                FAL Handler                  8                FAL_OK             R01US0005ED0102 RENESAS 14  User Manual    Data Flash Access Library       2 5 2    Background operation  write     During the running write command blank check write verify will be performed  in background  As shown in the figure below  the application has the possibility  to execute other user code during the background operation     Figure 2 6 Background operation  write     R01USO0005ED01 02  User Manual        
45. u    FAL BUSY  FAL Handler     if request status enu    FAL OK  ErrorHandler     FAL Close     R01US0005ED0102 RENESAS 43    User Manual    Data Flash Access Library       5 8    R01USO0005ED01 02  User Manual    Example  Read Write during background erase    The FDL allows background erase operation  therefore during that time read   and write access to data located in another block of the addressed pool is  possible  To be able to use foreground read write operation a separate request  variable has to be declared for that purpose  Read and write commands do  always suspend the erase process running in the background  Exception is  when the word command tries to access the same block as the running erase  in background  In such a case the FAL Handler   has to be called until the  running erase command is finished  Please refer to the detailed explanation of  command suspension to chapter  Suspension of block oriented commands   erase               fal request_t my BCMD req  my WCMD req   fal u32 my data u32     void erase state O void         specify the BCMD parameter     my BCMD req index ulg   4   my BCMD req command enu   FAL CMD ERASE BLOCK                    FAL Execute   amp my BCMD req            if erase request accepted goto next state 1        if erase request rejected remain in state 0        if erase request error occurs goto error state                                  ifimy BCMD req status enu    FAL BUSY     next state   erase state 1   else     if  my BCMD r
46. unsigned int fal ul6     typedef unsigned long int fal u32        Enumeration type  fal command t     This type defines all codes of available commands          typedef enum                                          FAL CMD UNDEFINED    0x00     FAL CMD BLANKCHECK WORD    0x00   0x01     FAL CMD IVERIFY WORD    0x00   0x02     FAL CMD READ WORD    0x00   0x03     FAL CMD WRITE WORD    0x00   0x04     FAL CMD ERASE BLOCK    0x00   0x05      fal command t           Code value description           FAL CMD UNDEFINED   default value   FAL CMD BLANKCHECK WORD   blank check of 1 Data Flash word   FAL CMD IVERIFY WORD   verify of 1 Data Flash word   FAL CMD READ WORD   read 1 Data Flash word   FAL CMD WRITE WORD   write 1 Data Flash word   FAL CMD ERASE BLOCK   erases 1 Data Flash block  24    NE   S AS 19    Data Flash Access Library       3 2 3 Enumeration type   fal status t     This enumeration type defines all possible status  and error codes can be  generated during data flash access via the FDL  The FAL OK and FAL BUSY  status are returned to the requester during normal operation  Other codes  signalize problems        typedef enum                                                                           operation related status                   FAL OK    0x00     FAL BUSY    0x00 0x01       run tim rror related status           wed  FAL ERR PROTECTION    0x10 0x00    FAL ERR BLANKCHECK    0x10   0x01    FAL ERR VERIFY    0x10   0x02    FAL ERR WRITE    0x10   0x03    FAL ERR
47. you have any questions regarding the information contained in this  document or Renesas Electronics products  or if you have any other inquiries      Note 1     Renesas Electronics  as used in this document means Renesas Electronics Corporation and also includes its  majority owned subsidiaries      Note 2     Renesas Electronics product s     means any product developed or manufactured by or for Renesas Electronics     R01US0005ED0102   ENESAS 3  User Manual    Chapter 1 Introduction    ener nnne nns  1 4 Components of the EEPROM Emulation System         eeeseeeeeeeeeeeeeeeeeeesnen  1 1 1 Physical flash layer    Cette  1 1 2 Flash access layer    eee tentent Sere tte reli  1 4 8 EEPROM access laverie  1 1 4   Application layet  REENEN   1 2 Naming Conmventons ener enne  Chapter 2      Archit CtUre sects eoe bre eite eege ee  2 1 Data Flash fragmentation  enne  2 1 1 FIDL ele  2 1 2 EEL DOOM  E T E A E E T E vacancy  24 9  USERPOON Tienaa ai aaa e e tete oes a a Locate ne    2 2 Address virtualization  2 8   Access right supervision  2 4  Request Response architecture    2 5 Background operation    2 5 1  2 5 2  2 5 8  2 5 4    2 6 Suspension of block oriented commands  erase   Chapter 3     User interface  API                  ssssssssssssseseseeeeneee eene nenne  3 1 Run time configuration    3 2  Datatypes    3 2 1  3 2 2  3 2 3  3 2 4  3 2 5    3 3 Functions    3 8 1  3 3 2    Chapter 4  4 1 Blank check    4 2 internal verify    43 LCD   4 44  NN EE   GG CE E  R01US0005ED
    
Download Pdf Manuals
 
 
    
Related Search
    
Related Contents
Husqvarna 536LiHD60X Trimmer User Manual  WO 2012/111772 A 1  DECODER ET INTERPRETER TOUTE FORME DE  鼻腔通気度計 MPR-3100    CP Technologies 4m Patch Cable  Untitled - ACEWELL    Manuel d'utilisation  5. procedure d`analyse et de tri des sous-projets    Copyright © All rights reserved. 
   Failed to retrieve file