Home

Data Flash Access Library

image

Contents

1. eeeeeeeeeeee eere 19 42 Run time configuration cuina 19 43 Dala TY S re 21 4 3 1 User operation request StruCture cccscesecccsseseeeesseeeeeenseeeeeenseeneeenseeneeenseeneesnseeneeseseenenes 21 4 3 2 Status and Error Codes eeee eese nenes 23 4 3 3 FAL CMD ERASE 2 oiincceeicccceengc cc cues avaccuve auae AS 23 4 3 4 FAL CMD BLANKCHECK iac ceni ii ici 24 4 35 FAL CMD BITCHECK cui 26 LEE WEEJ WebR p lmee E edeciss 27 44 Library FUNCTIONS ceca tcr rona nara e C rcu an dau Ea 29 4 4 1 AA 29 4 4 2 Suspend Resume crei cce iine ncc edere ia eranc EE EENS Rina cue 30 4 4 3 Standby Wakeup iecore niece a caute E enas Ve Xara ema a Denn 32 4 4 4 Operational f nctlors recreo EENS EES dee 35 4 4 5 Administrative functions cccececeeeeeeeee cece ee eeneeeeeee nene 39 Chapter 5 Integration into the user application 41 Bil ISU SIGS EE 41 5 2 Application SAMS nociones 41 5 3 Special considerations msi a 41 5 3 1 Function reentranCy E 41 5 3 2 Task switch context change and synchronization between functions 41 5 3 3 Concurrent Data Flash accesses cccssseceeeseseeeenseeneeenseseeeenseeeeenseseensnseseenenseenenes 41 R01US0045ED Rev 1 01 RENESAS
2. RAM Serial programming All trademarks and registered trademarks are the property of their respective owners User Manual Table of Contents Chapter 1 Introduction PA AP oou nonno n Ea ER EPRR ern nnmnnn ERE ERES 10 Chapter 2 FDL Architecture eeeeeeeee rre 11 2 1 Flash Infrastructure Leeeee eee LL Lieeeeeeeee enne nnne n nana nnns anna anna ann 11 2 1 44 Complementary Read Flash eeseeesseeesseeeeeseeeeees eene REENEN anna nnn nn nannan 11 2 1 2 DUAODOA ON 11 2 1 3 Flash granularify c ociinanionininiicracic iii diia 12 2 2 Layered software architeCture cccccccsssssseeeeeeeeeeeeeeeeseeeeeeeeeeeeeeseeneeeeeneees 12 2 3 Data ao MNT 13 K NT 14 25 BID error elige KS AAA CQRQPe QK Q cuba usta epu iu quia exuta Cu dr oda uina ut 14 Chapter 3 FDL Implementation e cce 15 3 1 File unl e P 15 SAR AAE ARAE SAAR ASAE 15 3 1 2 Delivery package directory structure and files cene 16 3 2 FDE Linker SECOS ts 18 3 3 MISRA Compllance nnne onn tenu rana an uan adu uu cin ss 18 Chapter A User Interface API eeee esee 19 4 1 Pre compile configuration
3. define FAL EEL POOL SIZE 6 FAL EEL VIRTUALBLOCKSIZE 4 3 4 3 1 Figure 4 1 Value range Min 64 4 blocks required for proper EEL operation Max FAL pool size while the sum of FAL_EEL_POOL_START and FAL_EEL_POOL_SIZE is less or equal than FAL FAL POOL SIZE Data Types User operation request structure All user operations are initiated by a central initiation function see chapter 4 4 4 1 FAL Execute All information required for the execution is passed to the FAL by a central request structure Also the error is returned by the same structure Write access Application Read access myRequest Request structure handling FDL operations request structure required for FAL Execute typedef volatile struct FAL REQUEST T fal command t command enu fal u32 dataAdd u32 fal w32 idx u32 fal ul6 cnt ul6 fal access type accessType enu tal status E status enu fal request tj command enu User command to execute User Manual Data Flash Access Library FDL T06 User Interface API FDL operation initiation command typedef enum FAL COMMAND T FAL CMD ERASE Flash erase Multiple blocks FAL CMD WRITE Flash write Multiple words FAL CMD BLANKCHECK Flash blank check Multiple words FAL CMD BITCHECK Flash bit check Multiple words fal command t
4. All commands can be requested by using the FAL Execute function Note All commands operate on virtual addresses relative address that start from block 0 of the data Flash memory as address 0 and block numbers E g 1st HWd of the Data Flash 0x00000000 3rd HWd of the Data Flash 0x00000004 dataAdd u32 Address of the write buffer of the application parameter only necessary during write commands idx u32 Write Destination byte index address relative to the DF start address Erase Block index of the 1st block to erase Blank Check Check start byte index address relative to the DF start address Bit Error Check Check start byte index address relative to the DF start address cnt u16 Write Number of HWds to write Erase Number of blocks to erase Blank Check Number of HWds to check Bit Error Check Number of HWds to check status enu Library return codes see 4 3 2 Status and Error Codes accessType enu Access right definition FDL operations originator defines typedef enum FAL ACCESS TYPE T FAL ACCESS NONE FDL internal value Not used FAL ACCESS USER FDL operation by user application FAL ACCESS EEL FDL operation by EEL tal access type tj Note In order to initiate a Flash operation the access right to the Flash must be set The user application may only access the complete configured Data Flash range exce
5. Library related functions which may be edited by the user FDL_Cfg h Header file with definitions for library setup at compile time root lt device name gt lt compiler gt sample FDL lib FDL_Env h Library internal defines for accessing the Flash programming hardware and Data Flash related definitions FDL_Global h Library internal defines function prototypes and variables FDL HWAccess c Source code for the library HW interface FDL UserlF c Source code for the library user interface and service functions RO1US0045ED Rev 1 01 User Manual RENESAS 17 Data Flash Access Library FDL T06 FDL Implementation root lt device name gt lt compiler gt sample EEL Header file containing all function prototypes EEL h of the library user interface Header file containing calling structures and EEL Types h error enumerations of the library user interface EEL Cfgh Header file with definitions for library setup at compile time Descriptor file with the run time EEL configuration Using the defines of EEL_Descriptor h and should not be edited by the user EEL Descriptor c Descriptor file header with the run time EEL EP PESTANA configuration To be edited by the user root lt device name gt lt compiler gt sample EEL lib EEL Global h Library internal defines function prototypes and variables EEL BasicFct c EEL internal functions a
6. User Manual 5 3 4 User Data Flash access during active EEPROM emulation 5 3 5 Direct access to the Data Flash by the user application by DMA 5 3 6 Entering power safe mode R01USO0045ED Rev 1 01 User Manual 24 NE S AS Data Flash Access Library FDL T06 Introduction Chapter 1 Caution Caution Introduction This user s manual describes the internal structure the functionality and software interfaces API of the Renesas V850 Data Flash Access Library FDL type T06 The library type TO6 is suitable for all Renesas V850 Flash based on the RCO3F Flash technology Do not use this library for devices based on other Flash technologies than RCOSF as this might lead to unwanted behaviour or demolition of the device The device features differ depending on the used Flash implementation and basic technology node Therefore pre compile and run time configuration options allow adaptation of the library to the device features and to the application needs The libraries are delivered in source code However it has to be considered carefully to do any changes as not intended behaviour and programming faults might be the result The development environments of the companies Green Hills GHS IAR and Renesas are supported Due to the different compiler and assembler features especially the assembler files differ between the environments So the library
7. and application programs are distributed using an installer tool allowing selecting the appropriate environment For support of other development environments additional development effort may be necessary Especially but maybe not only the calling conventions to the assembler code and compiler dependent section defines differ significantly The libraries are delivered together with device dependent application programs showing the implementation of the libraries and the usage of the library functions The different options of setup and usage of the libraries are explained in detail in this document Please read all chapters of the application note carefully Much attention has been put to proper conditions and limitations description Anyhow it can never be ensured completely that all not allowed concepts of library implementation into the user application are explicitly forbidden So please follow exactly the given sequences and recommendations in this document in order to make full use of the libraries functionality and features and in order to avoid any possible problems caused by libraries misuse The Data Flash Access Libraries together with the EEPROM emulation libraries application samples this manual and other device dependent information can be downloaded from the following URL http www renesas eu update User Manual Data Flash Access Library FDL T06 FDL Architecture Chapter 2 2 1 2 1 1 Note FDL Ar
8. myReq str cnt ul6 4 myReq str accessType enu FAL ACCESS USER FAL Execute amp myReq str do fdlRet FAL StandBy while FAL BUSY fdlRet iti FAL OE Geier error handler devic nters power safe mode device recovers from power safe mode fdlRet FAL WakeUp if FAL OK l fdlRet i error handler Finish the erase while myReq str status enu FAL BUSY FAL Handler if FAL OR l5 myR g str statue enu Error handler 4 4 3 2 FAL_WakeUp Description This function wakes up the library from the former entered Standby In case of any violation of the correct function usage the function will return FAL_ERR_REJECTED Interface fal status t FAL WakeUp void User Manual Data Flash Access Library FDL T06 User Interface API Arguments None Return types values Type Argument Description fal_status_t Operation status when returned from function call e FAL OK e FAL ERR REJECTED Pre conditions e The library must be initialized e The FAL is in standby mode Post conditions None Example See FAL StandBy 4 4 A Operational functions 4 4 4 1 FAL Execute Description The execute function initiates all Flash modification operations The operation type and operation parameters are passed to the FAL by a request structure the status and the resu
9. retention but just give an indication if cells are possibly erased or possibly written Therefore the blank check results need to be interpreted correctly On blank check fail the cells are surely not blank This might result from successfully written cells but also from interrupted erase or write operations On blank check pass it is ensured that the cells are not completely written This might result from successfully erased Flash blocks but also from interrupted erase or write operations User Manual Data Flash Access Library FDL T06 User Interface API The check command is initiated by FAL_Execute and is executed by the sequencer After that FAL_Handler must be called frequently to complete the command and check the status Status Class Background and Handling FAL_BUSY normal meaning operation started successfully reason no problems during execution remedy call FAL_Handler until the Flash operation is finished reported by the request structure status return value FAL_OK normal meaning operation finished successfully reason no problems during execution remedy nothing FAL_ERR_PARAMETER heavy meaning current command is rejected reason wrong parameters have been passed to the FAL the range start HWa to Start HWd Number of HWds 1 must be in the EEL User Pool remedy refrain from further Flash Operations and investigat
10. 2 5 Bit error checks Independent from the Flash manufacturer or Flash technology Bit errors in the Flash might be caused by different conditions Different measures are implemented or provided in order to handle such problems While device dependant causes like hardware defects or weak Flash cells are completely covered by the Renesas qualification and production quality and by Flash ECC Error correction code one major issue need to be considered additionally Interruption of Flash erase or write operations e g by power fails or Resets result in not completely charged or discharged Flash cells which results in Flash data without sufficient data retention This need to be prevented by the operation conditions of the device or need to be detected by the software in order to ensure stable data storage conditions While prevention is often not possible detection can be done by different mechanisms like checksums or special write sequences where one written word ensures that previous data write was completed successfully After having considered the mechanisms above one method to additionally increase the system robustness is the check for bit errors in written data This method assumes that multiple bit errors by not completely charged discharged Flash cells don t occur at once but by time By special correction bits the Renesas Data Flash hardware can correct single double bit errors in a 16bit data word correction bits during run t
11. Data Flash access layer ara Firmware is a piece of software that is located in a hidden area of the device handling the interfacing to the flash Electrically erasable and programmable nonvolatile Flash memory The difference to ROM is that this type of memory can be re programmed several times Flash Area Area of Flash consists of several coherent Flash Blocks RO1US0045ED Rev 1 01 User Manual 24 NE SAS A flash block is the smallest erasable unit of the flash memory A certain number of Flash blocks is grouped together ina Flash macro Firmware Half Word 16bit data Identifier of a Data Set instance in the Renesas EEPROM Emulation Non volatile memory All memories that hold the value even when the power is cut off E g Flash memory EEPROM MRAM Random access memory volatile memory with random access REE Renesas Electronics Europe GmbH REL Renesas Electronics Japan Read only memory nonvolatile memory The content of ROM that memory can not be changed Segment of Flash is a part of the flash that might consist of Segment Section several blocks Important is that this segment can be protected against manipulation Capability to reprogram the embedded flash without Self Programming external programming tool only via control code running on the microcontroller The onboard programming mode is used to program the device with an external programmer tool Flash Block Flash Macro
12. address e cnt u16 Number of HWds to check e accessType enu Access rights see 4 3 1 FAL CMD BITCHECK Interface Performs internal checks starting from the specified beginning address of the Data Flash for the area in the execution range The following arguments must be set for execution e idx u32 Start byte index relative address e cnt u16 Number of HWds to check e accessType enu Access rights see 4 3 1 void EAL Execute fal request t request pstr Arguments Type Argument Description fal request t Return types values request pstr Address of the structure specifying the command to be executed Type Argument Description fal request t Pre conditions The library must be initialized Post conditions request pstr status enu Operation status when returned from function call e FAL BUSY e FAL ERR PARAMETER e FAL ERR REJECTED e FAL ERR COMMAND e FAL OK e FAL ERR BITCHECK Call FAL Handler until the Flash operation is finished This is reported by the request structure status return value R01USO0045ED Rev 1 01 User Manual ENESAS 36 Data Flash Access Library FDL T06 User Interface API Example e Erase blocks 0 to 3 myRequest command enu FAL ERASE myRequest idx u32 0 myRequest cnt ul6 4 myRequest accessType enu FDL ACCESS USER FAL Execute amp myR
13. and is executed by the sequencer to perform the physical erase After the erase command has been initiated FAL Handler must be called to complete it and to update the library status Status Class Background and Handling meaning operation started successfully reason no problems during execution FAL BUSY normal call FAL Handler until the i Flash operation is finished reported by the request structure status return value meaning operation finished successfully FAL OK normal reason no problems during execution remedy nothing an ongoing Flash operation is meaning suspended by user application request FAL SuspendRequest called and successfully finished start another operation or resume the suspended remedy operation using FAL ResumeRequest command meaning current command is rejected wrong parameters have been passed to the FAL remedy reason FAL SUSPENDED normal FAL ERR PARAMETER heavy reason the range start block to Start block Number of blocks 1 must be in the EEL User Pool User Manual Data Flash Access Library FDL T06 User Interface API 4 3 4 Note Background and Handling refrain from further Flash remedy operations and investigate in the root cause meaning current command is rejected to gain robustness the parameter check is repeated right before Flash modification reason and returns the protection FAL ERR PRO
14. any other operation is ongoing FAL ERR REJECTED heavy repeat the command when the remedy preceding operation has finished a bit error is found in at least FAL ERR BITCHECK normal meaning one data word within the specified range R01USO0045ED Rev 1 01 User Manual 24 NE S AS 26 Data Flash Access Library FDL T06 User Interface API Background and Handling reason possible causes 1 erased Flash cells normally have bit errors 2 not completely written Flash e g caused by a power fail during a Flash operation 3 long time frame between erase or write and bit error check depending on the error reason 1 do not execute bit error check on erased cells 2 refresh the data 3 refresh the data FAL_ERR_INTERNAL 4 3 6 FAL CMD WRITE meaning a library internal error occurred which could not happen in case of normal application execution reason application bug e g program run away destroyed program counter or hardware problem remedy refrain from further Flash operations and investigate in the root cause The write command can be used to write a number of HWds located in the RAM into the Data Flash at the location specified by the virtual target address The write command is initiated by FAL Execute and is executed by the sequencer to perform the physical write After the write command has been initiated FAL Handler must be called to com
15. occurrence of failure at a 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 11 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 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 12 This document may not be reproduced or duplicated in any form in whole or in part without prior written consent of Renesas Electronics 13 Please contact a Renesas Electronics sales office if you have any qu
16. only master on the EEL pool accesses to this pool shall be done via the EEL API only Access to the user pool is done by using the FDL API functions for all accesses except read e g FDL_Erase FDL_Write while Data Flash read is directly done by the CPU The configuration of FDL pool and EEL pool and resulting user pool is done in the FDL descriptor User Manual Data Flash Access Library FDL T06 Integration into the user application 5 3 4 5 3 5 5 3 6 User Data Flash access during active EEPROM emulation Please refer to the EEL user manual regarding more detailed description of synchronization between EEPROM emulation and user accesses Direct access to the Data Flash by the user application by DMA Basically DMA transfers from Data Flash are permitted but need to be synchronized with the EEL Same considerations apply as mentioned in the last sub chapter for accesses by the user application Entering power safe mode Entering power safe mode is not allowed at all during ongoing Data Flash operations Use FAL_StandBy or wait until operations are no longer busy RO1US0045ED Rev 1 01 ENESAS 42 User Manual Data Flash Access Library FDL T06 Integration into the user application Revision History Chapier Page Description Rev 1 00 Initial version Rev 1 01 4 2 20 Updated frequency setting description RO1US0045ED Rev 1 01 43 User Manual RENESAS Data Flash Acces
17. system The amount of not accessible Flash depends on the device architecture A standard architectural approach is the separation of the Flash into Code Flash and Data Flash By that it is possible to read from the Code Flash to execute program code or read data while Data Flash is modified and vice versa This allows implementation of EEPROM emulation concepts with Data storage on Data Flash while all program code is executed from Code Flash If not mentioned otherwise in the device users manuals the devices with Data Flash are designed according to this standard approach It is not possible to modify Code Flash and Data Flash in parallel User Manual Data Flash Access Library FDL T06 FDL Architecture 2 1 3 2 2 Figure 2 1 Application EEPROM Emulation Library EEL Data Flash Library FDL Note Flash granularity The Data Flash can be erased in 32 Byte units The Data Flash can be written and read in 2 Byte units As the CPU is able to handle 4 Byte units as one Word this document often refers to the Half Word HWd as 2 Byte units Layered software architecture This chapter describes the function of all blocks belonging to the EEPROM Emulation and the Data Flash Access System Even though this manual describes the functional block FDL a short description of all concerned functional blocks and their relationship can be beneficial for the general understanding Code Flash Cod
18. themselves but to the user application These files reflect an example how the library descriptor ROM variables can be built up which need to be passed with the functions FDL EEL Init to the FDL EEL for run time configuration see chapter 4 2 Run time configuration and 4 4 1 1 FAL Init The structure of the descriptor is passed to the user application by FDL EEL Types h while the value definition should be done in the file FDL EEL Descriptor h The constant variable definition and value assignment should be done in the file FDL EEL Descriptor c If overtaking the files FDL EEL Descriptor c h into the user application only the file FDL EEL Descriptor h need to be adapted by the user while FDL EEL Descriptor c may remain unchanged 3 1 2 Delivery package directory structure and files The following table contains all files installed by the library installer e Files in red belong to the build environment controlling the compile link and target build process e Files in blue belong to the sample application e Files in green are description files only e Files in black belong to the FDL and EEL in the separate directories for EEL and FDL root Release txt Installer package release notes rootimake GNUPublicLicense txt Make utility license file libiconv2 dll DLL File required by make exe libintl3 dll DLL File required by make exe make exe Make utility root lt device name gt com
19. C o D Dd c GC ENESAS Data Flasn Access Library FDL T06 Data Flash Access Library for RCO3F Flash based V850 devices 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 www renesas com Renesas Electronics RO1US0045ED Rev 1 01 www renesas com Mar 15 2013 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 express implied or otherwise is granted hereby under an
20. FAL GetVersionString void Arguments None Return types values Type Argument Description fal u08 Pointer to version string Version string format DV850T06xxxxxYZabcD Coded information about the supported compiler If no xxxxx information is coded the library is a generic library valid for different compiler Coded information about the used memory register model If no Y information is coded the library is a generic library valid for all memory register models E for engineering version V for normal version abc Library version number a bc optiona Z optional character identifying different engineering versions D Pre conditions None RO1US0045ED Rev 1 01 ENESAS 39 User Manual Data Flash Access Library FDL T06 Post conditions None Example User Interface API Read library version fal u08 version pu08 version pu08 FAL GetVersionString RO1US0045ED Rev 1 01 ENESAS User Manual 40 Data Flash Access Library FDL T06 Integration into the user application Chapter 5 5 1 5 2 Note 5 3 5 3 1 Caution 5 3 2 5 3 3 Integration into the user application First steps It is very important to have theoretic background about the Data Flash and the EEL and FDL in order to successfully implement the library into the user application Therefore it is important to read this user manual in
21. None Return types values Type Argument Description fal_status_t Operation status when returned from function call e FAL OK e FAL ERR REJECTED Pre conditions The library must be suspended Call FAL SuspendRequest before and wait until the suspend process finished Post conditions Call FAL Handler until the library is resumed Example See FAL SuspendRequest 4 4 3 Standby Wakeup The stand by functionality shall suspend ongoing Flash operations asynchronously to the normal FDL handling flow e g by using a high priority interrupt function It does not necessarily immediately suspend any Flash operation as suspend might be delayed by the device internal hardware or might not be supported at all only Erase and Write are suspend able So the function FAL StandBy tries to suspend the Flash operation and returns FAL BUSY as long as a Flash operation is ongoing If suspend was not possible e g blank check operation FAL BUSY is returned until the operation is finished normally So in order to be sure to have no Flash operation ongoing the function must be called continuously until the function does no longer return FAL BUSY or until a timeout occurred User Manual Data Flash Access Library FDL T06 User Interface API After stand by it is mandatory to call FAL_WakeUp before entering normal FAL operation again The prescribed sequence in case of using FAL_StandBy WakeUp is 1 any FAL opera
22. Register contents Diagrams User Manual Preface This manual is intended for users who want to understand the functions of the concerned libraries This manual presents the software manual for the concerned libraries This document describes the following sections e Architecture e Implementation and Usage e API Additional remark or tip Item deserving extra attention Binary XXXX or xxxB Decimal XXXX Hexadecimal XxxxH or Ox xxxx Representing powers of 2 address space memory capacity K kilo 2 1024 M mega 2 1024 1 048 576 G giga 2 10243 1 073 741 824 X x don t care Block diagrams do not necessarily show the exact software flow but the functional structure Timing diagrams are for functional explanation purposes only without any relevance to the real hardware implementation How to Use This Manual 1 Purpose and Target Readers This manual is designed to provide the user with an understanding of the library itself and the functionality provided by the library It is intended for users designing applications using libraries provided by Renesas A basic knowledge of software systems as well as Renesas microcontrollers is necessary in order to use this manual The manual comprises an overview of the library its functionality and its structure how to use it and restrictions in using the library Particular attention should be paid to the precautionary notes when using the manual These
23. TECTION error in case of a violation e g due to an unwanted variable modification refrain from further Flash remedy operations and investigate in the root cause meaning current command is rejected reason any other operation is ongoing FAL ERR REJECTED repeat the command when the remedy preceding operation has finished at least one bit within the specified blocks is not erased one or more Flash bits could not be erased completely a Flash block respectively the remedy complete Data Flash should be considered as defect meaning FAL ERR ERASE aer a library internal error occurred which could not happen in case of normal application execution application bug e g program reason run away destroyed program counter or hardware problem refrain from further Flash remedy operations and investigate in the root cause meaning FAL_ERR_INTERNAL FAL_CMD_BLANKCHECK The blank check command can be used by the requester to check if all cells in the specified target flash area are possibly blank e g before writing data into it or reading data The user can use the blank check command freely as it is a non destructive flash access Different from an Erase operation which checks if the cells to be erased have really reached the erase level the blank check does not check on this level but on a standard read level It cannot ensure any electrical margin required for data
24. advance The best way after initial reading of the user manual will be testing the application sample Application sample After a first compile run it will be worth playing around with the library in the debugger By that you will get feeling for the source code files and the working mechanism of the library Before the first compile run the compiler path must be configured in the application sample file makefile Set the variable COMPILER_INSTALL_DIR to the correct compiler directory Special considerations Function reentrancy All functions are not reentrant So reentrant calls of any EEL or FDL functions must be avoided Task switch context change and synchronization between functions Each function depends on global FDL available information and is able to modify this information 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 Concurrent Data Flash accesses Depending on the user application scenario the Data Flash might be used for different purposes e g one part is reserved for direct access by the user application and one part is reserved for EEPROM emulation by the Renesas EEL The FDL is prepared to split the Data Flash into an EEL Pool and a User Pool On partitioned Data Flash the EEL is the
25. are During that time the Code Flash is not accessible and so no interrupts or exceptions can be served The library can execute code to disable interrupts and or exceptions during that time as user callback functions The user must configure these by the library pre compile configuration see 4 1 Pre compile configuration Interface fal status t FAL Init const fal descriptor Ek descriptor pstr Arguments Type Argument Description fal_descriptor_t descriptor_pstr Pointer to the FDL run time configuration descriptor in ROM Return types values Type Argument Description fal_status_t Operation status when returned from function call e FAL OK e FAL ERR PARAMETER e FAL EHR INTERNAL Pre conditions None Post conditions None User Manual Data Flash Access Library FDL T06 User Interface API Example fal status t ret Initialze FDL ret FAL Init fal RTCONFIG enu it ret l FAL OK Error handler 4 4 2 Suspend Resume The library provides the functionality to suspend and resume the library operation in order to provide the possibility to synchronize the EEL Flash operations with possible user application Flash operations e g write erase by using the FDL library directly or read by direct Data Flash read access Note 1 When FAL SuspendRequest has already suspended a Flash Erase another Flash erase is not possible If FAL Sus
26. chitecture Flash Infrastructure Complementary Read Flash Based on the different application needs the Flash implementation used for Data Flash differs from the Code Flash implementation In order to achieve the required high endurance erase cycles Renesas decided for a Complementary Read CR Flash implementation on Data Flash Each data bit is realized by two Flash cells which are programmed to the opposite direction data bit The cell value difference is read to judge the data value Data bit level of Flash cell 1 level of Flash cell 2 0 high low 1 low high Resulting from the implementation erased Flash both Flash cells with same similar level has a very small differential level The resulting data bit judgement has an undefined result but with a tendency to formerly written data This need to be considered on interpretation of the read values e The lower level library FDL provides a blank check to distinguish between erased and written Flash on read level e When inspecting the Data Flash contents e g using a debugger the debugger need to provide the information on the Flash status erased written Dual operation Common for all Flash implementations is that during Flash modification operations Erase Write a certain amount of Flash memory is not accessible for any read operation e g program execution or data read This does not only concern the modified Flash range but a certain part of the complete Flash
27. e Flash OR Data Flash Hardware ke Data Flash Hardware Ee Rough relationship between functional system blocks of the system The functional block Application should not use the functions offered by the FDL directly in fact it is recommended to access the EEL API only Nevertheless if the user intends to implement a proprietary EEPROM emulation he may use the FDL functions for direct Data Flash accesses Even combinations of both are possible The functional block EEPROM Emulation library offers all functions and commands the Application can use in order to handle its own EEPROM data The Data Flash Library offers an access interface to any user defined Data Flash area so called FDL poo described in next chapter Beside the initialization function the FDL allows the execution of access commands like write as well as a suspend able erase command General requirement is to be able to deliver pre compiled EEL libraries which can be linked to either Data Flash libraries FDL or Code Flash libraries FCL To support this a unique API towards the EEL must be provided by these User Manual Data Flash Access Library FDL T06 FDL Architecture 2 3 Figure 2 2 FDL pool EEL pool libraries Following that the standard API prefix FDL_ which would usually be provided by the FDL library is replaced by a standard Flash Access Layer prefix FAL_ A
28. e delivery package contains dedicated directories for both libraries containing the source and the header files 3 1 1 Overview The following picture contains the library and application related files Figure 3 1 Library Files Fix may not be touched by the user au Library pre compile configuration Only on souce code delivery File name fix File content user configurable Application User Code Completely in the hand of the user Libray API declaration Ge User Teen gt FDL h gt FDL a Source Code Application Precompiled fe Library FDL_ c Source Code Library Library Configuration Library and application file structure The library code consists of different source files starting with FDL EEL_ The files shall not be touched by the user independently if the library is distributed as source code or pre compiled The file FDL EEL h is the library interface functions header file The interface parameters and types are defined in the file FDL EEL_Types h Data Flash Access Library FDL T06 FDL Implementation In case of source code delivery the library must be configured for compilation The file FDL EEL_Cfg h contains defines for that As it is included by the library source files the file contents may be modified by the user but the file name may not Caution Wrong configuration of the EEL FDL might lead to undefined results FDL EEL_Descriptor c and FDL EEL_Descriptor h do not belong to the libraries
29. e in the root cause FAL_ERR_PROTECTION heavy meaning current command is rejected reason to gain robustness the parameter check is repeated right before Flash modification and returns the protection error in case of a violation e g due to an unwanted variable modification remedy refrain from further Flash operations and investigate in the root cause FAL_ERR_REJECTED heavy meaning current command is rejected reason any other operation is ongoing remedy repeat the command when the preceding operation has finished FAL_ERR_BLANKCHECK heavy meaning at least one bit within the specified range is not blank reason for any bit in the addressed flash range the voltage level is below specification for an blank cell remedy depending on the Blank Check usage concept FAL_ERR_INTERNAL heavy meaning a library internal error occurred which could not happen in case of normal application execution RO1US0045ED Rev 1 01 ENESAS User Manual 25 Data Flash Access Library FDL T06 User Interface API Background and Handling reason application bug e g program run away destroyed program counter or hardware problem remedy refrain from further Flash operations and investigate in 4 3 5 FAL CMD BITCHECK the root cause A Flash cell especially a not completely written or erased one e g opera
30. ed So only Code from RAM can be executed interrupts NMIs and exceptions need to be relocated to RAM or to be disabled The critical code part with disabled Flash access is called critical section The library provides the possibility to execute callback routines to disable enable or relocate interrupts and exceptions at begin and end of the critical section Call back routine at critical section start disable interrupts and exceptions define FDL CRITICAL SECTION BEGIN Call back routine at critical section end disable interrupts and exceptions define FDL CRITICAL SECTION END 4 2 Run time configuration The overall EEL run time configuration is defined by an EEL specific part EEL run time configuration and by the FDL run time configuration Background of the splitting is that the FDL requires either common by EEL and FDL used information e g block size or EEL related information e g about the EEL pool size So this information is part of the FDL run time configuration Both configurations of FDL and EEL are stored in descriptor structures which are declared in FDL_Types h EEL_Types h and defined in FDL_Descriptor c EEL_Descriptor c with header files FDL_Descriptor h EEL_Descriptor h The descriptor files c and h are considered as part of the user application In fact the file FDL_Descriptor h might be modified according to the user applications needs and might be added to the user ap
31. enesas 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 RO1US0045ED Rev 1 01 User Manual RENESAS 8 The quality grade of each Renesas Electronics product is Standard unless otherwise expressly specified in a Renesas Electronics data sheets o
32. equest while myRequest status enu FAL BUSY FAL Handler if myRequest status enu FAL OK Error handler e Write Data to addresses 0x100 to 0x107 fal u32 data 0x12345678 0x23456789 myRequest command enu FAL WRITE myRequest idx u32 0x100 myRequest cnt ul6 4 myRequest dataAdd u32 myRequest accessType enu amp data 0 FDL ACCESS USER FAL Execute amp myRequest while myRequest status enu FAL BUSY FAL Handler if myRequest status enu FAL OK Error handler e Blank check on the address range 0x100 to 0x107 myRequest command enu FAL CMD BLANKCHECK myRequest idx u32 0x100 myRequest cnt ul6 4 myRequest accessType enu FDL ACCESS USER FAL Execute amp myRequest while myRequest status enu FAL BUSY FAL Handler if myRequest status enu FAL OK Error handler R01USO0045ED Rev 1 01 User Manual RENESAS 37 Data Flash Access Library FDL T06 User Interface API e Bit check on the address range 0x100 to 0x107 myRequest command enu FAL CMD BITCHECK myRequest idx u32 0x100 myRequest cnt ul6 4 myRequest accessType enu FDL ACCESS USER FAL Execute amp myRequest while myRequest status enu FAL BUSY FAL Handler if myRequest status en
33. estions 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 RO1US0045ED Rev 1 01 ENESAS User Manual Regional Information Some information contained in this document may vary from country to country Before using any Renesas Electronics product in your application please contact the Renesas Electronics office in your country to obtain a list of authorized representatives and distributors They will verify e Device availability e e Ordering information e Product release schedule e e Availability of related technical literature e Development environment specifications for example specifications for third party tools and components host computers power plugs AC supply voltages and so forth e Network requirements In addition trademarks registered trademarks export restrictions and other legal issues may also vary from country to country Visit http www renesas com to get in contact with your regional representatives and distributors RO1US0045ED Rev 1 01 User Manual RENESAS Readers Purpose Organisation Note Caution Numeric notation Numeric prefixes
34. ime Furthermore it can signal this error to the application By that the user application can set up a mechanism to refresh the data with the single bit error right on time before a multi bit error can occur that destroys the data For that purpose the FDL provides a function to check a certain Flash address for bit errors on the data word Note It is recommended to cyclically execute the bit error check over the complete data range User Manual Data Flash Access Library FDL T06 FDL Implementation Chapter 3 User Manual FDL Implementation 3 1 File structure The library is delivered as a complete compilable sample project which contains the EEL and FDL libraries and in addition to an application sample to show the library implementation and usage in the target application The application sample initializes the EEL and does some dummy dataset Write and Read operations Differing from former EEPROM emulation libraries this one is realized not as a graphical IDE related specific sample project but as a standard sample project which is controlled by makefiles Following that the sample project can be built in a command line interface and the resulting elf file can be run in the debugger The FDL and EEL files are strictly separated so that the FDL can be used without the EEL However using EEL without FDL is not possible Th
35. ll functions type definitions enumerations etc will be prefixed by FAL_ or fal_ Independent from the API the module names will be prefixed with FDL_ in order to distinguish the source object modules for Code and Data Flash Data Flash Pools The FDL pool defines the Flash blocks which may be accessed by any FDL operation e g write erase The limits of the FDL pool are taken into consideration by any of the FDL flash access commands The user can define the size of the FDL pool freely at project run time function FAL Init while usually the complete Data Flash is selected The FDL pool provides the space for the EEL pool which is allocated by the EEL inside the FDL pool The EEL pool provides the Flash space for the EEL to store the emulation data and management information All FDL pool space not allocated by the EEL pool is freely usable by the user application so is called the User pool User Application RA Data Flash FDL Pool The FDL pool is just a place holder for the EEL pool It does not allocate any flash memory The FDL pool descriptor defines the valid address space for FDL access to protect all flash outside the FDL pool against destructive access write erase by a simple address check in the library To simplify function parameter passing between FDL and the higher layer the device depending physical Flash addresses e g 0x02000000 0x0200FFFF or OxFE000000 0xFEOOFFFF are transformed into a linea
36. lt of the operation are returned to the user application also by the same structure The required parameters as well as the possible return values depend on the operation to be started This function only starts a hardware operation according to the command to be executed The command processing must be controlled and stepped forward by the handler function FAL Handler Depending on the used command different combinations of operation and parameter are possible Command Description FAL CMD ERASE Performs erase for each block of the specified range The following arguments must be set for execution e idx u32 Start block index block number e ont u16 Numbers of blocks to erase e accessType enu Access rights see 4 3 1 FAL CMD WRITE Write the data placed in the write input buffer to the Data Flash at the specified relative starting address for the specified number of HWds The following arguments must be set for execution e idx u32 Start byte index relative address e cnt u16 Number of HWds to check e accessType enu Access rights see 4 3 1 RO1US0045ED Rev 1 01 ENESAS 35 User Manual Data Flash Access Library FDL T06 User Interface API Command Description FAL_CMD_BLANKCHECK Performs internal checks starting from the specified beginning address of the Data Flash for the area in the execution range The following arguments must be set for execution e idx u32 Start byte index relative
37. mp state machine EEL UserlF c EEL user interface functions 3 2 FDL Linker sections The following sections are Data Flash Access Library related Data sections e FAL DATA This section contains the variables required for FDL Code sections e FAL Text This section contains the hardware und user interface e FAL Const This section contains all FDL library internal constant data 3 3 MISRA Compliance The EEL and FDL have been tested regarding MISRA compliance The used tool is the QAC Source Code Analyzer which tests against the MISRA 2004 standard rules All MISRA related rules have been enabled Remaining findings are commented in the code while the QAC checker machine is set to silent mode in the concerning code lines User Manual Data Flash Access Library FDL T06 User Interface API Chapter 4 User Interface API 4 1 Pre compile configuration The pre compile configuration of the FDL may be located in the FDL_cfg h The user has to configure all parameters and attributes by adapting the related constant definition in that header file Caution Take care to follow the configurations done in the sample application in order to ensure correct FDL operation During initialization the library needs to activate the device internal firmware for a short time in order to have access to certain data This results in disabling the Code Flash During that time the Code Flash as well as Data Flash access is disabl
38. notes occur within the body of the text at the end of each section and in the Usage Notes section The revision history summarizes the locations of revisions and additions It does not list all revisions Refer to the text of the manual for details 2 List of Abbreviations and Acronyms Abbreviation Full Form API Application Programming Interface Embedded Flash where the application code or constant Code Flash data is stored Embedded Flash where mainly the data of the EEPROM Data Flash emulation are stored Data Set Instance of data written to the Flash by the EEPROM Emulation Library EEL identified by the Data Set ID DS Short for Data Set Dual Operation Dual operation is the capability to access flash memory during reprogramming another flash memory range Dual operation is available between Code Flash and Data Flash Between different Code Flash macros dual operation depends on the device implementation ECC Error Correction Code EEL EEPROM Emulation Library EEPROM Electrically erasable programmable read only memory EEPROM emulation In distinction to a real EEPROM the EEPROM emulation uses some portion of the flash memory to emulate the 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
39. operations and investigate in the root cause FAL ERR REJECTED meaning current command is rejected reason any other operation is ongoing remedy repeat the command when the preceding operation has finished FAL ERR WRITE meaning at least one HWd could not be written correctly reason 1 for any bit of the written area the voltage levels are below specification for a written cell 2 a Flash write operation on a not blank cell failed remedy a Flash block respectively the complete Data Flash should be considered as defect FAL ERR INTERNAL meaning a library internal error occurred which could not happen in case of normal application execution reason application bug e g program run away destroyed program counter or hardware problem remedy R01USO0045ED Rev 1 01 24 NE SAS User Manual refrain from further Flash operations and investigate in the root cause 28 Data Flash Access Library FDL T06 User Interface API 4 4 Library Functions 4 4 1 Initialization 4 4 1 1 FAL Init Description Function is executed before any execution of other FDL Flash operations The main functionality of the FAL Init is e Initialization of the Flash programming hardware e Set internal frequency e initialization of internal FDL variables Note FAL_Init need to access the device internal firmware in order to initialize the Flash programming hardw
40. pendRequest has already suspended a Flash Write another Flash Erase or Write is not possible Note 2 The suspend resume mechanism can not be nested Therefore the following sequence is not allowed Any Flash operation suspend any Flash operation suspend 4 4 2 1 FAL SuspendRequest Description This function requests suspending a Flash operation in order to be able to do other Flash operations or Flash read If the function returned successfully no further error check of the suspend procedure is necessary as a potential error is saved and restored on FAL ResumeRequest In case of any violation of the correct function usage the function will return FAL ERR REJECTED Interface fal status t FAL SuspendRequest void Arguments None Return types values Type Argument Description fal status t Operation status when returned from function call e FAL OK e FAL ERR REJECTED Pre conditions e AFlash operation must have been started R01USO0045ED Rev 1 01 24 NE S AS 30 User Manual Data Flash Access Library FDL T06 User Interface API e The started operation may not have been finished request structure status value is FAL BUSY e The library may not already be suspended Post conditions Call FAL Handler until the library is suspended Example fal status t shes emu fal request t myReq str fal u32 SC Start Erase operation myReq s
41. piler Build bat Batch file to build the application sample Clean bat Batch file to clean the application sample Makefile that controls the build and clean Makefile process root lt device name gt lt compiler gt sample EELApp Main c Main source code EELApp Control c EEPROM emulation sample code target h target device and application related definitions User Manual Data Flash Access Library FDL T06 FDL Implementation root lt device name gt lt compiler gt sample device header files df lt device number gt h GHS df lt device number gt _irq h io macros v2 h io 70f device number gt h io macros h IAR Ixx h cfi h GHS DF dev num startup 850 107 585 startup file IAR cstartup s85 REC cstart asm linker directive file GHS df lt dev num gt ld IAR Ink70f lt dev num gt xcl REC df lt dev num gt dir root lt device name gt lt compiler gt sample FDL FDL h Header file containing function prototypes of the library user interface FDL_Types h Header file containing calling structures and error enumerations of the library user interface FDL_Descriptor h Descriptor file header with the run time FDL configuration To be edited by the user FDL_Descriptor c Descriptor file with the run time FDL configuration Using the defines of FDL_Descriptor h Should not be edited by the user FDL_User c
42. plete it and to update the library status Status Class Background and Handling meaning operation started successfully reason no problems during execution FAL BUSY normal call FAL Handler until the me Flash operation is finished y reported by the request structure status return value meaning operation finished successfully FAL_OK normal reason no problems during execution remedy nothing an ongoing Flash operation is meaning suspended by user application FAL_SUSPENDED normal request Ve FAL_SuspendRequest called and successfully finished RO1US0045ED Rev 1 01 ENESAS User Manual 27 Data Flash Access Library FDL T06 User Interface API Background and Handling remedy start another operation or resume the suspended operation using FAL_ResumeRequest command FAL_ERR_PARAMETER meaning current command is rejected reason wrong parameters have been passed to the FAL the range start HWa to Start HWd Number of HWds 1 must be in the EEL User Pool remedy refrain from further Flash operations and investigate in the root cause FAL ERR PROTECTION meaning current command is rejected reason to gain robustness the parameter check is repeated right before Flash modification and returns the protection error in case of a violation e g due to an unwanted variable modification remedy refrain from further Flash
43. plication project together with the FDL_Descriptor c The defined descriptor structures are passed to the libraries as reference by the functions FDL_Init and EEL Init FAL CPU FREQUENCY MHZ This configuration element is set to the CPU frequency A frequency fractional part need to be rounded up e g 25 3MHz need to be rounded up to 26MHz Ur GE SN User Manual RENESAS Data Flash Access Library FDL T06 User Interface API CPU frequency setting condition The Flash programming hardware is provided with a clock derived from the CPU frequency The frequency divider of this derived clock is device family dependent The resulting friash hardware Must be in the range of 8 to 50MHz E g Fx4 L Px4 L Tosch hardware fopu 2 c 16MHz lt fcpu lt mimimum of lt 100MHz gt or maximum device frequency Caution The CPU frequency must be set correctly If not malfunction may occur such as unstable Flash data without data retention programming failure operation blocking define FAL CPU FREQUENCY MHZ 48 FAL EEL VIRTUALBLOCKSIZE The physical erase unit of the Data Flash is 32Byte However based on the compatibility to former Data Flash implementations the EEL groups together each 64 erasable Blocks to a 2kB virtual block which are then handled by the EEL So EEL Pool start and size must be aligned to the 2kB boundary For FAL Pool size this is not necessary and may be changed accordingly but in thi
44. pt the one configured for the EEL The EEL may only access its range The ranges are defined in the FAL descriptor passed to the FAL Init function The access right is reset after each Flash operation If not set again on calling FAL Execute this function will return a protection error RO1US0045ED Rev 1 01 ENESAS 22 User Manual Data Flash Access Library FDL T06 User Interface API 4 3 2 Status and Error Codes FDL status return values typedef enum FAL STATUS T FAL OK Operation terminated successfully FAL BUSY Operation is still ongoing f FAL SUSPENDED Operation is suspended FAL ERR PARAMETER Wrong parameter in FDL function call FAL ERR PROTECTION Operation blocked wrong parameters FAL ERR REJECTED Flow error other operation ongoing FAL ERR WRITE Flash write error FAL ERR ERASE Flash erase error FAL ERR COMMAND Unknown command FAL ERR BITCHECK Bit check error FAL ERR INTERNAL Library internal error fal status t All status and error codes depend on the called command The Library offers a set of commands that all can be requested by using the FAL Execute function 4 3 3 FAL CMD ERASE The erase command can be used to erase a number of Flash blocks defined by a start block and the number of blocks The command is initiated by FAL Execute
45. r address room 0x0000 0xFFFF used by the FDL The EEL pool allocates and formats virgin initialization all flash blocks belonging to the EEL pool The header data are generated in proper way to be directly usable by the application User Manual Data Flash Access Library FDL T06 FDL Architecture User pool The User Pool is completely in the hands of the user application It can be used to build up an own user EEPROM emulation or to simply store constants 2 4 Safety Considerations EEPROM emulation in the automotive market is not only operated under normal conditions where stable function execution can be guaranteed In fact several failure scenarios should be considered Most important issue to be considered is the interruption of a function e g by power fail or Reset Differing from a normal digital system where the operation is re started from a defined entry point e g Reset vector the EEPROM emulation modifies Flash cells which is an analogue process with permanent impact on the cells Such an interruption may lead to instable electrical cell conditions of affected cells This might be visible by undefined read values read value write value but also to defined read values blank or read value write value In each case the read margin of these cells is not given The value may change by time into any direction This needs to be considered in any proprietary EEPROM emulation or simple data storage concept
46. r data books 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 9 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 10 Although Renesas Electronics endeavors to improve the quality and reliability of its products semiconductor products have specific characteristics such as the
47. s sample configuration also FAL Pool size is aligned to 2kB define FAL EEL VIRTUALBLOCKSIZE 64 FAL FAL POOL SIZE Defines the number of physical Flash blocks used for the FAL pool which means the User Pool EEL Pool Usually the FAL pool size equals the total number of Flash blocks E g Data Flash size 32kb block size 32Bytes FAL FAL POOL SIZE 1024 define FAL FAL POOL SIZE 16 FAL EEL VIRTUALBLOCKSIZE Value range Min EEL pool size Max Physical number of Data Flash blocks FAL EEL POOL START Define to set the number of the first physical Data Flash block used as EEL Pool The value should be set to zero if the FAL is used only Caution The block number must be aligned to the virtual block size 2kB used by the EEL Following that the block number must be a multiple of 64 2kB 64 32Byte define FAL EEL POOL START 1 FAL EEL VIRTUALBLOCKSIZE Value range Min FAL Pool start block Max sum of FAL EEL POOL START and FAL EEL POOL SIZE is less or equal than FAL FAL POOL SIZE kia AAA K K R RRRRRRAR User Manual RENESAS Data Flash Access Library FDL T06 User Interface API Caution FAL EEL POOL SIZE Defines the number of blocks used for the EEL Pool The block number must be aligned to the virtual block size 2kB used by the EEL Following that the block number must be a multiple of 64 2kB 64 32Byte
48. s Library 21 NESAS Renesas Electronics Corporation RO1USO045ED
49. tion FAL_StandBy FAL_Handler until operation in standby device power safe device wake up FAL_WakeUp 7 continue FAL operations oe o ko bh Caution Please consider not to enter a power safe mode which resets the Flash hardware e g Deep Stop mode because a resume of the previous operation is not possible afterwards The library is not able to detect this failure 4 4 3 1 FAL_StandBy Description This function suspends a possibly ongoing Flash Erase or Write Any other Flash operation is untouched In case of any violation of the correct function usage the function will return FAL_ERR_REJECTED Interface fal status t FAL StandBy void Arguments None Return types values Type Argument Description fal_status_t Operation status when returned from function call e FAL_OK e FAL_BUSY e FAL ERR REJECTED Pre conditions e The library must be initialized e The following sequence is not allowed Flash Erase gt FAL suspend Flash Write FAL standby e The FAL is not in standby mode Post conditions e Continue calling FAL StandBy until it no longer returns FAL BUSY e Execute FAL WakeUp as next FAL function LiLo SGAE TT AAA User Manual RENESAS Data Flash Access Library FDL T06 User Interface API Example fal status t fdlRet enu fal request t myReq str Start Erase operation myReq str command enu FAL CMD ERASE myReq str idx u32 0
50. tion interrupted due to a power fail might drift over time Cyclic bit checks on the data may detect possible data retention problems and the user can refresh the data if the correctness of the data is ensured The bit check command bases on the Flash internal ECC The ECC circuit is able to detect and correct a single bit error Multiple bit errors will be detected only with a high confidence level but cannot be corrected The bit check command signalizes any detected and eventually corrected bit failure The user can use the bit check command freely as it is a non destructive flash access Status Class Background and Handling meaning operation finished successfully FAL OK normal reason no problems during execution remedy nothing meaning current command is rejected wrong parameters have been passed to the FAL reason the range start HWa to Start FAL ERR PARAMETER heavy HWd Number of HWds 1 must be in the EEL User Pool refrain from further Flash remedy operations and investigate in the root cause meaning current command is rejected to gain robustness the parameter check is repeated right before Flash modification reason and returns the protection FAL ERR PROTECTION heavy error in case of a violation e g due to an unwanted variable modification refrain from further Flash remedy operations and investigate in the root cause meaning current command is rejected reason
51. tr command enu FAL CMD ERASE myReq str idx u32 0 myReq str cnt ul6 4 myReq str accessType enu FAL ACCESS USER FAL Execute amp myReq str Now call the handler some times i 0 while myReq str status enu FAL BUSY amp amp i 10 FAL Handler itt Suspend request and wait until suspended STRESS enu FAL SuspendRequest CO if FAL OK srRes enu d error handler while FAL SUSPENDED myReq str status_enu FAL Handler FAL is suspended Handle other operations or read the Flash GR zea Y Erase resume srRes enu FAL Resumerequest i if FAL OK t srRes enu Error handler Finish the erase while myReq str status enu FAL SUSPENDED FAL Handler while myReq str status enu FAL BUSY FAL Handler if FAL OR myReq str status enu User Manual Data Flash Access Library FDL T06 User Interface API Error handler 4 4 2 2 FAL_ResumeRequest Description This function requests to resume the FAL operation after suspending The resume is just requested by this function Resume handling is done by the FAL_Handler function In case of any violation of the correct function usage the function will return FAL_ERR_REJECTED Interface fal status t FAL ResumeRequest void Arguments
52. u FAL OK Z Error handler 4 4 4 2 FAL Handler Description This function handles the command processing for the FAL Flash operations After initiation by FAL Execute this function needs to be called frequently The function checks the operation status and updates the request structure status enu variable when the operation has finished By that the operations end can be polled Note FAL Handler must be called until the Flash operation has finished in order to deinitialize the Flash hardware Only after deinitialization further operations can be started or Data Flash can be read Interface void FAL Handler void Arguments None Return types values Type Argument Description fal status t Operation status when returned from function call e FAL OK e FAL BUSY e FAL SUSPENDED e FAL ERR PROTECTION e FAL ERR WRITE e FAL ERR ERASE e FAL ERR BLANKCHECK e FAL ERR BITCHECK e FAL EHR INTERNAL R01USO0045ED Rev 1 01 24 NE S AS 38 User Manual Data Flash Access Library FDL T06 User Interface API Pre conditions e The library must be initialized e FAL_Execute must be executed Post conditions None Example See FAL_Execute 4 4 5 Administrative functions 4 4 5 1 FAL GetVersionString Description This function returns the pointer to the library version string The version string is a zero terminated string identifying the library Interface const fal u08
53. y 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 the information included in this document but R

Download Pdf Manuals

image

Related Search

Related Contents

Philips SPF1528  ERP400 - 400 watt 220 volt Power Inverter  Accord relatif à la prévention des risques psychosociaux et aux  GE CGS975SEDSS Installation Guide  Belkin G1H2000CWBLK mobile headset    Stanton M.212 User's Manual  User Manual: Tune2Print - Océ  CC2533 RF4CE Development Kit Hardware User`s Guide (Rev. A)  MPEG Troubleshooting  

Copyright © All rights reserved.
Failed to retrieve file