Home
TI FEE User`s Guide - Texas Instruments Wiki
Contents
1. 23 4 5 SYMBOLIC CONSTANTS AND ENUMERATED DATA TYPES 24 4 6 DATASIRUCTURBS S Le entia Neb 26 4 7 1 Operating Frequency iustus scc tes Net tieu aaj avg CURRO Re RVs RE 27 Z2 Numberof na EP Reti ro ad cti Rad dad 28 4 1 3 of Virtual SCCIOUS ato o d qood d en 28 Number of Virtual Sectors for EEP 28 Contents 4 7 5 TI FEE Virtual Sector Configuration inii 29 4 7 6 oiii dedil 31 4 7 7 UOBIGOUOVEFHEGU hadas doubts schaut dou is Arcus cuida 34 4 7 8 Page Overheads uci rM olov a Ud inge 35 4 7 9 leased ated CH aeta S 33 4 740 Virtual Sector Page ide sous ded NR De e n IR ER ONU 35 LTAL Driver SIMON sch dal ERE RR han in 36 4 7 12 Enable ECC COT CCH ON uidi eiue qiti vans qid 36 4 7 13 Error Correction Handling icis olas adve atat tora de 36 4 7 14 Block Write Counter 37 duo Sioux Rate erus D Melee cce eme ree UR 37 47 20 NumberOfEEBsuis ici ici a aa CARENT 37 4 8 APE CLASSIFICATION
2. Bit s Field Description 191 176 Block Number This is used to indicate the block number 175 160 Block size Indicates size of block 159 128 W E counter Indicates write erase counter for a block 127 96 CRC Indicates CRC of block 95 64 Address Address of the previous valid block 63 0 Status of the These 64 bits indicate the Status of the Block The Block following Table lists all the possible combinations for the Block Status 2 2 Data Block Header Field Definitions State Empty Block OxFFFFFFFFFFFFFFFF Start Program Block Valid Block OxFFFFFFFF00000000 Invalid Block OxFFFF000000000000 Corrupt Block 0x0000000000000000 2 3 Data Block States Block Status is used to ensure that data integrity is maintained even if the Block data update process is interrupted by an uncontrolled event such as a power supply failure or reset Empty Block New Data can be written to this Block Start Program Block This indicates that the Data Block is in the progress of being programmed with data Valid Block This indicates that the Data Block is fully programmed and contains Valid Data Invalid Block This indicates that the Data Block contains invalid or old data Corrupt Block This indicates that the Data Block is corrupted and the Software should ignore this Block 2 1 3 Supported Commands The following list describes the supported commands 1 WriteAsync Thi
3. 27 4 4 TI FEE Driver Initialization 5 1 61 111111 saeua 38 4 5 FEE Driver Data Operation APIS 1 1 38 4 6 TI FEE Driver Information 39 4 7 TI FEE Driver Internal Operation 39 4 8 TI FEE Driver Error Info and Recovery APIS 11 1 39 Table of figures Table of figures FIGURE 1 VIRTUAL SECTOR ness nnne nun 14 FIGURE 2 VIRTUAL SECTOR HEADER 15 FIGURE 3 DATA BLOCK 8 16 FIGURE 4 DATA BLOCK HEADER gt LOGICAL 16 FIGURE 5 VIEW GRAPH OF TI FEE DRIVER DIRECTORY TREE ERROR BOOKMARK NOT DEFINED FIGURE 6 FLOW CHART OF A TYPICAL FEE eene 40 Chapter 1 FEE Driver Introduction This chapter introduces the FEE Driver to the user by providing a brief overview of the purpose and construction of the FEE Driver along with hardware and software environment specifics in the context of Tl FEE Driver deployment 1 1 Overview This section describes the functional scope of the FEE Driver and its feature set It introduces the FEE Driver to the user along with the functional decomposition and run time specifics regarding deployment of FEE Driver in u
4. Invalidate Block job was not accepted by the TI Fee module Function to initiate an Invalidate operation on a Data Block 43 4 10 1 7 Shutdown Function Fee Shutdown This function provides functionality for performing a bulk data write when shutting down the system synchronously This function completes the Async jobs which are in progress by performing a bulk Data Write while shutting down the system synchronously TI Fee Shutdown Std ReturnType Fee Shutdown Synchronous None E OK The Async job was Std ReturnType completed The Async job was not completed Function to perform bulk Data write prior to system shutdown 4 10 1 8 Get Version Info Function Tl_Fee_getVersioninfo This function returns the version information for the Fee module TI Fee specific version numbers MM mm rr e MM Major Version e mm Version e rr Revision TI Fee getVersionInfo void TI Fee getVersionlInfo Std VersionlnfoType VersionInfoPtr Synchronous VersioninfoPtr Pointer to standard version information structure Function to return the version information of the TI Fee module 44 4 10 1 9 Get Status Function GetStatus This function returns the status of the FEE module TI Fee GetStatus TI FeeStatusCodeType TI Fee G
5. 38 Initialization odio Locos tta e ree ere eer eh ree ee ee eh ra re eae 38 Data Opera 2 eal ana aac to Sen ita at ba eal aa Soa Rae 38 AOD 39 4 8 4 Internal ODOratioHs tate ease 39 4 6 5 Error Information and Recovery Operations 39 4 9 FEE OPERATION 40 4 10 APLESPECIFICATION uet tei e tee 41 440A TFI FEE Driv r Functions eiusd odas oido eot o actas con odas 41 PRIVILEGE MODE ACCESS io Aides ik pn ates 48 Table of tables 1 1 Table OF Abbreviations 3 Revision History 4 2 1 Virtual Sector Header 514165 15 2 2 Data Block Header Field Definitions 17 2 3 Block 17 3 2 IE FEE Driver Elle 19 3 3 TI FEE HAL CoGen File List jsscccacisscessvscesocsvavsceccescscovseteacnoscessseessoeanecsuccdsecceosses 20 4 1 TI FEE Driver Symbolic Constants ecce eee e eee eee e eee eee e eee tn noe 26 4 2 TI FEE Driver Published Information Data Structure 26 4 3 TI FEE Driver General Configuration Data Structure
6. BlockNumber Number of logical block also denoting start address of that block in Flash memory DataBufferPtr Pointer to data buffer E OK The write job was accepted by the TI Fee module E NOT OK The write job was not accepted by the TI Fee module Function to initiate an Async Write job Std ReturnType 41 4 10 1 3 Sync Write Function TI Fee WriteSync This function provides the functionality to program data to a Block synchronously TI Fee WriteSync Std ReturnType TI Fee WriteSync uint16 BlockNumber uint8 DataBufferPtr Synchronous Number of logical block also denoting BlockNumber start address of that block in Flash memory Pointer to data DataBufferPtr buffer E_OK The write job was accepted by the Fee module Std_ReturnType E NOT_OK The write job was not accepted by the TI Fee module Function to program Data to a Block synchronously 4 10 1 4 Read Function TI Fee Read This function provides functionality for reading of data from a Block Std ReturnType Fee Read uint16 BlockNumber uint16 BlockOffset uint8 DataBufferPtr uint16 Length Synchronous BlockNumber Number of logical block also denoting start address of that block in Flash memory BlockOffset Read address offset inside the block DataBufferPtr Pointer to data buffer Length Numb
7. This chapter describes the implementation method followed for Flash EEPROM emulation in the FEE Driver 2 1 Flash EEPROM Emulation Methodology The EEPROM Emulation Flash bank is divided into two or more Virtual Sectors Each Virtual Sector is further partitioned into several Data Blocks A minimum of two Virtual Sectors are required for Flash EEPROM emulation The initialization routine TI Fee Init identifies which Virtual Sector to be used and marks it as Active The data is written to the first empty location in the Active Virtual Sector If there is insufficient space in the current Virtual Sector to update the data it switches over to the next Virtual Sector and copies all the valid data from the other Data Blocks in the current Virtual Sector to the new one After copying all the valid data the current Virtual Sector is erased and the new one is marked as Active Virtual Sector Any new data is now written into the new Active Virtual Sector and the erased Virtual Sector is used again once this new Virtual Sector has insufficient space Virtual Sectors and Data Blocks have certain space allocated to maintain the status information which is described in more detail in the following sections 2 1 1 Virtual Sector Organization The Virtual Sector is the basic organizational unit used to partition the EEPROM Emulation Flash Bank This structure can contain one or more contiguous Flash Sectors contained within one Flash Bank A mini
8. to get a quick understanding of the FEE Driver APls For detailed descriptions please refer to the API specification section 4 6 The TI FEE Driver APIs that are intended for use in initialization of the FEE module are listed below Name Description TI Fee Init Used to initialize the FEE module 4 4 FEE Driver Initialization APIs 4 8 2 Data Operations The TI FEE Driver APIs that are intended for performing Data operations on Data Blocks are listed below Name Description TI FEE WriteAsync Used to initiate an Asynchronous Write Operation to a Data Block TI FeeManager function should be called at regular intervals to finish the Async Write Operation TI FEE WriteSync Used to perform a Synchronous Write Operation to a Data Block TI FEE Read Used to read Data from a Data Block TI FEE EraselmmediateBlock Used to initiate an Erase Operation of a Data Block FeeManager function should be called at regular intervals to finish the Write Operation TI FEE InvalidateBlock Used to initiate an Invalidate Operation on a Data Block TI FeeManager function should be called at regular intervals to finish the Write Operation TI FEE Shutdown This function completes the Async jobs which are in progress by performing a bulk Data Write while shutting down the system synchronously TI Fee Format Used to erase all the configured Virtual Sectors 4 5 TI FEE Driver Data Oper
9. Bank It should be greater than the FEE Start Sector Please refer to the device datasheet Flash Memory Map for more details 30 4 7 5 5 Sample Virtual Sector Configuration The following code snippet indicates one of the possible configurations for the Virtual Sectors from the file fee config c Virtual Sector Configuration const TI FeeVirtualSectorConfigType FeeVirtualSectorConfiguration Virtual Sector 1 1 Virtual sector number 7 Bank 0 Start Sector 0 End Sector b Virtual Sector 2 2 Virtual sector number 7 Bank 1 Start Sector 1 End Sector 4 7 6 FEE Block Configuration TI Fee BlockConfiguration Used to define a Data Block FeeBlockConfigType This is a structure having the following members BlockNumber Indicates Block s Number BlockSize Defines Block s Size in bytes Immediate Data Used Defines if the block has immediate data NumberOfWriteCycles Number of write cycles required for this block Devicelndex Indicates the device index Number of data sets Number of data 31 sets for this block Indicates on which FeeEEPNumber EEP this block is configured The configurations described in the following section are repeated for each Data Block 4 7 6 1 BlockNumber BlockNumber Ea
10. I FEE Driver It provides necessary information regarding how to effectively install build and use TI FEE Driver in user systems and applications It also provides details regarding the TI FEE Driver functionality the requirements it places on the hardware and software environment where it can be deployed how to customize configure it etc It also provides supplementary information regarding steps to be followed for proper installation un installation of the TI FEE Driver Abbreviations 1 1 Table of Abbreviations Abbreviation TI FEE Driver Description This is Tl coined name for the product FEE Flash EEPROM Emulation Read This First Revision History Version Date Revision History 1 0 09 25 2012 Initial version 1 1 11 12 2012 Contents EM 59 59 Contents eon eoo eo casobac cacodavecesodavecesstececssscec casedecscaccdostcacodececevolecdcsestecscssssecacese gt Table OF tables ccccscsscsccsessecccscssacetsesssvecsessesccscesecscscdscccsscesesesscdecdesecesscssbeveetesbeveavcsseseevesccute OF TUNES S Chapter T um NE NN A NE TI FEE Driver Introduction ccccccssssscscsssssccccsscccccccsc
11. Ris TEXAS INSTRUMENTS Read This First IMPORTANT NOTICE Texas Instruments and its subsidiaries Tl reserve the right to make changes to their products or to discontinue any product or service without notice and advise customers to obtain the latest version of relevant information to verify before placing orders that information being relied on is current and complete All products are sold subject to the terms and conditions of sale supplied at the time of order acknowledgment including those pertaining to warranty patent infringement and limitation of liability warrants performance of its products to the specifications applicable at the time of sale in accordance with Tl s standard warranty Testing and other quality control techniques are utilized to the extent TI deems necessary to support this warranty Specific testing of all parameters of each device is not necessarily performed except those mandated by government requirements Customers are responsible for their applications using components In order to minimize risks associated with the customer s applications adequate design and operating safeguards ought to be provided by the customer so as to minimize inherent or procedural hazards TI assumes no liability for applications assistance or customer product design TI does not warrant or represent that any license either express or implied is granted under any patent right copyright mask work right or othe
12. StatusType VitualSectorStatesType VsState_Copy 3 Virtual Sector is Cop VsState Active 4 Virtual Sector is Active VsState ReadyForErase 5 Virtual Sector is Ready for Erase Block 1 Block is Empty BlockStatesType in progress on this Block Error Enor woe Fee ErrorCodeType Error SeupstateMachine s Error CopyButNoactvevs 4 Error NoActiveVS 5 Error Biockinvatase Enor Error_InvalidVirtualSectorPara meter 9 Error_ExceedSectorOnBank 1 0 24 Eror Cunrentaddress t8 o o Error Exceed No Of DataSet DataSet PET HN s 19 FEE Module is Uninitialized FEE Module is Idle TI FeeStatusCodeType ea FEE Module is Bus Busylnternal FEE Module is performing internal operations Read If set to 1 indicates Read operation is in progress WriteAsync If set to 1 indicates Async Fee StatusWordType UN Write operation is in progress WriteSync If set to 1 indicates Sync Write operation is in progress EraseBlock If set to 1 indicates Erase operation is in progress InvalidateBlock If set to 1 indicates Invalidate operation is in progress Copy If set to 1 indicates Copy operation is in progress Error BlockOffsetGtBlockSize PERENNE 12 Error LengihParamets Suspendis Single Bit Error If set to 1 indic
13. able Fee u16ActCpyVS to know details about the VS s Prototype for the API s are TI Fee ErrorCodeType TI FeeErrorCode uint8 u8EEPIndex void Fee ErrorRecovery TI Fee ErrorCodeType ErrorCode uint8 u8VirtualSector If two EEPROM s are configured then FeeErrorCode has to be called cyclically with different index Ex FeeErrorCode 0 and TI FeeErrorCode 1 21 If Error is of type Error_TwoActiveVS TI 16 5 0x0003 this means VS 1 and 2 are Active If projects want to make VS 1 as Active then TI Fee ErrorRecovery Error TwoActiveVS 2 Virtual sector 2 will be marked as Ready for Erase Virtual sector numbers start from 1 4 2 Single and Double bit Error Corrections FEE software provides a mechanism to detect single and double bit errors In order to use this feature application has to make sure that EDACMODE 3 0 Error Correction Mode in EE CTRL1 should be set to a value other than 0101 EE ONE EN Error on One Fail Enable should be enabled EE ZERO EN Error on Zero Fail Enable should be enabled EE EDACEN 3 0 Error Detection and Correction Enable should be set to a value other than 0101 Projects have to then call error hook functions TI Fee ErrorHookSingleBitError and TI Fee ErrorHookDoubleBitError in ESM For single bit error an event is generated on channel 35 of ESM and for double bit error on channel 36 of ESM 4 3 Memory Mapping Fo
14. ates there was a single bit error during read operation ProgramFailed If set to 1 indicates there was an error during write operation TI FEE SW MAJOR VERSION define Macro which indicates the Major version of the FEE TI FEE SW MINOR VERSION define Macro which indicates the Minor version of the FEE 25 TI FEE SW PATCH VERSION define Macro which indicates the Patch version of the FEE 4 1 TI FEE Driver Symbolic Constants 4 6 Data Structures This section summarizes the entire user visible data structure elements pertaining to the TI FEE Driver run time interfaces Fee PublishedlnformationType Used to contain Published Information Block OverHead in bytes uint8 Ox8 Virtual Page Size in bytes uint8 0x0 Page overhead in bytes uint8 Ox10 Virtual Sector overhead in bytes 4 2 TI FEE Driver Published Information Data Structure Fee GeneralConfigType Used to contain General configuration information uint32 0 Instance ID of this module Should always be 0 boolean True Indicates if CRC check False is enabled for block uint16 Refer Device Operating Datasheet Frequency in MHz boolean True Enables use of Error False correction if supported by underlying device uint16 0x8 Defines the virtual page size 26 Fee Flash Fee Fixor Indicates how to handle ErrorCorre Fee None ECC errors ctionActio nType bo
15. ation APIs 38 4 8 3 Information The FEE Driver APIs that are intended to get information about the status of the FEE Module are listed below FEE getVersionlnfo Used to get the Driver version TI FEE getStatus Used to get the status of the FEE module TI FEE getJobResult Used to get the job result of a Data Operation 4 6 TI FEE Driver Information APIs 4 8 4 Internal Operations The TI FEE Driver APIs that are used to perform internal operations of the FEE Module are listed below TI Fee MainFunction Used to complete the Data Operations initiated by any of the Data Operation functions TI Feelnternal FeeManager Used to perform internal operations Copy Erase Virtual Sector 4 7 TI FEE Driver Internal Operation APIs 4 8 5 Error Information and Recovery Operations The TI FEE Driver APIs that are used to provide error information and recover from severe errors TI FeeErrorCode Function to know the error type Function to recover from severe errors 4 8 TI FEE Driver Error Info and Recovery APIs TI Fee ErrorRecovery 39 4 9 Fee Operation Flow This section depicts a flow chart for a typical FEE operation Initialization To be called only once at the TI Fee Init beginning to initialize the TI FEE module TI FEE is in IDLE state after successful initialization Call any one of the data operation functions as required A new operation can be
16. ch block is assigned a unique number starting from 0 1 0 1 Min 0x1 Max OXFFFE 4 7 6 2 Block Size BlockSize Indicates the size of the Block in bytes 0x8 0x8 to OxFFFF Multiples of 8 4 7 6 3 Immediate Data Immediate Data Indicates if the block has immediate data FALSE TRUE FALSE 4 7 6 4 Number of Write Cycles NumberOfWriteCycles Indicates the number of clock cycles required to write to a flash address location 0x10 32 Device or core flash tech dependent parameter 4 7 6 5 Device Index Devicelndex Indicates the device index This will always be 0 0 0 Fixed to 0x0 4 7 6 6 Device Index Number of Data sets Indicates the data sets for the block 0 1 0 1 2 power Data selection bits 1 4 7 6 7 EEPNumber EEPNumber Indicates into which this block is configured 0 1 0x1 0x2 4 7 6 8 Sample Block Configuration The following code snippet indicates one of the possible configurations for the Blocks from the file fee_config c Block Configuration const FeeBlockConfigType TI Block 1 0x01 Block number 33 0x004 Block size 0x10 Block number of write cycles TRUE Block immediate data used 0 Device Index 1 Number of DataS
17. e various states a Virtual Sector can be in State Value Invalid Virtual Sector OxFFFFFFFFFFFFFFFF Empty Virtual Sector Copy Virtual Sector 0x00000000FFFFFFFF Active Virtual Sector 0x000000000000FFFF Ready for Erase 0x0000000000000000 2 1 Virtual Sector Header States Invalid Virtual Sector This Virtual Sector is either in process of being erased or has not yet been initialized Empty Virtual Sector This indicates the Virtual Sector has been erased and can be used to store data Copy Virtual Sector This indicates that the Data Block Structure is being moved from a full Virtual Sector to this one to allow for moving of the Active Virtual Sector Active Virtual Sector This Virtual Sector is the active one Ready for Erase This Virtual Sector s Data Block Structure has been correctly replicated to a new Virtual Sector and is now ready to be erased and initialized for re use Virtual Sector Information Record is the second 64 bit word in the Virtual Sector header It is used to record information needed by the Virtual Sector management algorithm Currently the first 4 bits are used to indicate the current version of the Virtual Sector and the next 20 bits are used to indicate the number of times the Virtual Sector has been erased The erase count is incremented each time the Virtual Sector is erased The remaining bits are reserved for future use 15 2 1 2 Data Bl
18. er whenever there is no other job pending IDLE State FeeManager function handles all the background tasks internal operations to manage the TI FEE module Note The user has to schedule the tasks data operations such that the TI FEE module is in IDLE state for some time so that the internal operations are handled correctly Fee MainFunction void Fee MainFunction void Asynchronous Function to handle the requested Async data operations 4 10 1 12 Manager Function TI FeeManager The function FeeManager manages the Flash EEPROM Emulation and is called when no other job is pending by the FeeManager function This function handles all the background tasks to manage the FEE This routine is responsible for e Determine whether a Virtual Sector Copy operation is in progress If so it should identify all the Valid Data Blocks in the old Virtual Sector and copy them to the new Virtual Sector e Determine if any of the Virtual Sector needs to be erased If so it should erase that particular Virtual Sector e This function is only called when the Fee module is in IDLE state It should set the Fee module to BUSY INTERNAL state Feelnternal FeeManager FeeStatusType FeeManager void Asynchronous None TI FeeStatusType TI FEE OK The job was completed TI FEE ERROR The job was not completed due to an error Fu
19. er of bytes to read E OK The Read job was accepted by the TI Fee module Std ReturnType E NOT OK The Read job was not accepted by the TI Fee module Function to read data from a Block 42 4 10 1 5 Erase Function TI Fee EraselmmediateBlock This function provides functionality for Erasing a Data Block asynchronously TI Fee MainFunction function should be called at regular intervals to finish the Erase operation TI Fee EraselmmediateBlock Std ReturnType TI Fee EraselmmediateBlock uint16 BlockNumber Asynchronous Number of logical block also denoting start address of that block in Flash memory BlockNumber E OK The Erase job was accepted by the TI Fee module Std_ReturnType NOT The Erase job was not accepted by the TI Fee module Function to initiate Erase operation on a Data Block 4 10 1 6 Invalidate Function TI Fee InvalidateBlock This function provides functionality for invalidating a Data Block asynchronously TI Fee MainFunction function should be called at regular intervals to finish the Invalidate Block operation TI Fee InvalidateBlock Std ReturnType TI Fee InvalidateBlock uint16 BlockNumber Asynchronous Number of logical block also BlockNumber denoting start address of that block in Flash memory E OK The Invalidate Block job was accepted by the TI Fee module Std_ReturnType E NOT
20. etStatus Synchronous None UNINIT TI Fee Module has not been initialized IDLE TI Fee Module is currently idle TI FeeStatusCodeType BUSY TI Fee Module is currently busy BUSY INTERNAL TI Fee Module is currently busy with internal management operations Function gets the status of the TI Fee module 4 10 1 10 Get Job Result Function GetJobResult This function returns the result of the last job synchronously TI Fee GetJobResult Synchronous None FeeJobResultType Fee GetJobResult TI FeeJobResultType JOB OK The last job has finished successfully JOB PENDING The last job is waiting for execution or is currently being executed JOB CANCELLED The last job has been cancelled JOB FAILED The last job failed BLOCK INCONSISTENT The requested block is inconsistent it may contain corrupted data BLOCK INVALID The requested block has been invalidated The requested read operation cannot be performed Function gets the job result from the TI Fee module 45 4 10 1 11 Task Function TI Fee MainFunction This function handles the Write Erase Invalidate asynchronous jobs initiated by Fee WriteAsync TI Fee EraseBlock TI Fee InvalidateBlock functions This function should be called at regular intervals by a scheduler This function internally calls another function TI FeeManag
21. ets 1 EEP Number Block 2 0x02 Block number 5 0x008 Block size 0 10 Block number of write cycles TRUE Block immediate data used 0 Device Index 2 Number of DataSets 2 Number b Block 3 0x03 Block number 0x0004 Block size 0x10 Block number of write cycles TRUE Block immediate data used 0 Device Index 3 Number of DataSets 1 EEP Number i Block 4 0x04 Block number Ox001A Block size 0x10 Block number of write cycles TRUE Block immediate data used 0 Device Index 4 Number of DataSets 1 EEP Number 4 7 7 Block OverHead FEE BLOCK OVERHEAD Indicates the number of bytes used for Block Header 0x8 Fixed to 0x8 34 define FEE BLOCK OVERHEAD 8 4 7 8 Page OverHead TI FEE PAGE OVERHEAD Indicates the Page Overhead in bytes 0x0 Fixed to 0x0 define FEE PAGE OVERHEAD 0 4 7 9 Virtual Sector OverHead TI FEE VIRTUAL SECTOR OVERHEAD Indicates the number of bytes used for Virtual Sector Header 0x10 Fixed to 0x10 define TI FEE VIRTUAL SECTOR OVERHEAD 16 4 7 10 Virtual Sector Page Size FEE VIRTUAL PAGE SIZE Indicates the virtual page size in bytes 0x8 35 Fixed to 0x8 def
22. ine FEE VIRTUAL PAGE SIZE 8 4 7 11 Driver Index FEE INDEX Instance ID of TI FEE module Should always be 0x0 0x0 Fixed to 0 0 define 0 4 7 12 Enable ECC Correction FEE FLASH ERROR CORRECTION ENABLE Used to enable disable Error Correction 0 0 FALSE or 1 TRUE define TI FEE FLASH ERROR CORRECTION ENABLE 0 4 7 13 Error Correction Handling FEE FLASH ERROR CORRECTION HANDLING Indicates desired action to be taken on detection of bit errors Fee None Fee None or Fee Fix 36 define FEE FLASH ERROR CORRECTION HANDLING Fee None 4 7 14 Block Write Counter Save FEE WRITECOUNTER SAVE Used to enable disable saving of write erase counter value in to block header STD OFF STD STD OFF define FEE WRITECOUNTER SAVE STD OFF 4 7 15 Enable CRC FEE CRC ENABLE Used to enable disable 32 bit STD OFF STD STD OFF define FEE ENABLE STD OFF 4 7 16 NumberOfEEPs FEE NUMBER OF EEPS Used to configure number of emulations on a single bank 1 1 2 define FEE NUMBER OF EEPS 1 37 4 8 API Classification 4 8 1 Initialization This section introduces the application programming interface for the FEE Driver by grouping them into logical units This is intended for the user
23. initiated only when the module is in Idle state Schedule a Data Operation TI FEE WriteAsync TI FEE WriteSync TI FEE EraseBlock TI FEE InvalidateBlock TI FEE Read To be called at regular intervals to complete the Data operation TI Feelnternal Fee Manager Schedule Other TI Fee MainFu Application Tasks nction TI Fee getStatus Called by TI FeeMain whenever in Idle state to handle internal operations Fee getJobResult Returns the Job result of the last operation Figure 6 Flow chart of a typical FEE operation 40 4 10 API Specification This section constitutes the detailed reference for the entire API set published to users of the FEE Driver 4 10 1 FEE Driver Functions 4 10 1 1 Initilization Function Fee Init This function provides functionality for initializing the TI FEE module This routine must be called only once at the beginning before commencing any data operation TI Fee Init void TI Fee Init void Synchronous None None Function to initialize the Tl Fee module 4 10 1 2 Async Write Function TI Fee WriteAsync This function initiates an Asynchronous Write operation to a Data Block TI Fee MainFunction function should be called at regular intervals to finish the Async Write operation TI Fee WriteAsync Std ReturnType TI Fee WriteAsync uint16 BlockNumber uint8 DataBufferPtr Asynchronous
24. ion directory ti_fee h Include til fee Types h Include ti fee utils c Source ti fee EraselmmediateBlock c Source ti fee Format c Source ti fee Info c Source ti fee InvalidateBlock c Source ti fee cancel c Source ti fee Read c Source ti fee Shutdown c Source ti fee ini c Source ti fee Main c Source ti fee WriteAsync c Source ti fee WriteSync c Source fee interface h Include 3 2 TI FEE Driver File List Files generated using HALCoGen are listed below FieName _ Destination directory device_types h Include Device_header h Include TI fee Include TI fee cfg c Source Device TMS570LS31 h Include Device TMS570LS31 c Source 3 3 TI FEE HALCoGen File List Note xx indicates device part number E g If the target device chosen is TMS570LS31 then the device specific files generated are Device TMS570LS31 h and Device TMS570LS31 c 20 Chapter 4 Integration Guide This chapter describes the steps for using the FEE Driver This chapter also discusses the FEE Driver run time interfaces that comprise the classification usage scenarios and the API specification The entire source code to implement the FEE Driver is included in the delivered product 41 Error Recovery Implementation Projects should implement error recovery mechanism to recover from serious errors They should call the TI FeeErrorCode periodically to check if there are any severe errors Erro
25. k e Fee InvalidateBlock e Fee Shutdown e TI Fee Cancel e TI Fee Format Information FEE getStatus e FEE getJobResult e TI_FEE_getVersionInfo Internal Operations e Fee MainFunction TI Feelnternal FeeManager Error Information and Recovery e I FeeErrorCode TI Fee ErrorRecovery 1 1 2 Other Components The TI FEE Driver requires the following components for complete deployment 1 TI Fee Configuration Files The user needs to generate the following two configuration files using HALCoGen to deploy and use TI FEE Driver fee cfg h b TI fee cfg c These two files define which Flash sectors to be used for EEPROM emulation define Data Blocks Block Size and other configuration parameters HALCoGen also generates device specific files that defines the memory mapping for the Flash FEE bank 2 Flash API library The TI FEE Driver uses the Flash API library for performing program erase operations The apprioprate Flash API library depending on the type of Flash technology has to be included in the application to deploy and use the TI FEE Driver F021 version should be 2 0 0 of greater 1 1 3 Development Platform The TI FEE Driver was developed and validated on a system with the following operating system and software installed e Operating System Win7 e Codegeneration tools TMS570 Code Generation tools 4 9 5 Chapter 2 FEE Driver Design Overview Overview
26. llowing macros can be used for reallocating code constants and variables e FEE START SEC CONST UNSPECIFIED e FEE STOP SEC CONST UNSPECIFIED e FEE START SEC CODE e FEE STOP SEC CODE FEE START SEC VAR INIT UNSPECIFIED FEE STOP SEC VAR INIT UNSPECIFIED 22 4 4 Build Procedure The build procedure mentions how one ought to go about building the FEE Driver into their systems and applications 1 The driver files generated from HALCoGen should be included in the application 2 Thefiles listed in Table 3 3 Fee configuration files and device specific files generated using HALCoGen should be included in the application The configuration files ti_fee_cfg h amp ti_fee_cfg c define which Flash sectors to be used for EEPROM emulation define Data Blocks Block Size and other configuration parameters whereas the device specific files define the memory mapping for the Flash FEE bank 3 Flash API library The AutoSAR FEE Driver uses the Flash API library for performing program erase operations Include appropriate F021 library and include files of F021 F021 version should be V2 0 0 greater 23 4 5 Symbolic Constants and Enumerated Data types This section summarizes the symbolic constants specified as either define macros and or enumerated C data types Described alongside the macro or enumeration is the semantics or interpretation of the same in terms of what value it stands for and what it means TI Fee
27. mum of 2 Virtual Sectors are required to support the TI FEE Driver The internal structure of the Virtual Sector contains a Virtual Sector Header a static Data Structure and the remaining space is used for Data Blocks Virtual Sector Organization Virtual Sector Header Block 3 Block 5 DS4 Block Block n Block 3 Block 3 Block 5 053 Block 0 Block 1 DS2 Block 3 Block 2 Block 5 DS4 Block X Block X Block X Block X Block n Block X Block 3 Block 5 DS3 Block 2 Block n Virtual Sector K Virtual Sector Header BE Block n Block5 DS3 Block 3 Block 1 DS2 Block n Block 5 DS4 Block 5 DS3 Block X Block X Block X Block X Block X Block X Figure 1 Virtual Sector Organization 14 Virtual Sector 2 1 1 1 Virtual Sector Header The Virtual Sector Header consists of two 64bit words 16 bytes that start at the first address of a Virtual Sector Structure The state of the Virtual Sector Structure is maintained in the Virtual Sector Header 64 bit Status Word 40 bits Reserved Erase Count Version Number 20 bits 4 Bits Figure 2 Virtual Sector Header The Status Word is the first 64 bit word of the Virtual Sector Header and is used to indicate the current state of the Virtual Sector The following table indicates th
28. nction to handle the requested Async data operations 46 4 10 1 13 Format Function This function provides functionality for erasing all the Virtual Sectors synchronously void TI Fee Format void Synchronous None None Function formats all the Virtual Sectors Note Calling this function will result in loss of data This function should be called only if you want to reconfigure the Data Blocks Virtual Sectors or detect a serious error condition 4 10 1 14 FeeErrorCode This function provides functionality to identify occurrence of an error It returns 0 if no error has occurred else it returns an Error code TI FeeErrorCode FeeErrorCodeType FeeErrorCode Synchronous Non Reentrant EEP Index None TI FeeErrorCodeType Returns an Error Code Returns 0 if no error has occurred else it returns an Error code 4 10 1 15 TI Fee ErrorRecovery This function provides functionality to recover from any severe errors Fee ErrorRecovery void TI Fee ErrorRecovery Synchronous Non Reentrant Error TwoActiveVS Error TwoCopyVS Machi Error Code Error SetupStateMachine Error NoActiveVS Error CopyButNoActiveVS Error NoFreeVS Virtual Sector Number None None Function recovers from any
29. ock Organization The Data Block is used to define where the data within a Virtual Sector is mapped One or more variables can be within a Data Block based on the user definition The smallest amount of data that can be stored within the Data Block is 64 bits If the Data size exceeds 64 bits the Data Packets are added in 64 bit increments The Data Block Structure is limited to the size of the Virtual Sector it resides in Note The size of all the Data Blocks cannot exceed the Virtual Sector length When a Data Packet write exceeds the available space of the current Virtual Sector the Data Block structure is duplicated in the next Virtual Sector to be made active Data Block Structure Block5 Dataset2 Block5 Dataset6 Block1 Dataset2 Block3 Dataset1 Header Header Header Header Block4 Dataset4 Block2 Dataset2 Block1 Dataset8 Block2 Dataset3 Header Header Header Header Figure 3 Data Block Structure 2 1 21 Data Block Header The Data Block Header is 8 bytes in length and is used to indicate the location information address of valid data within a Virtual Sector Block Number 16 bits Block size 16 bits Block W E Cycle count optional 32 bits reserved if saving not enabled CRC optional 32 bits Address of previous Valid Block 32 bits Block Status 64 bits Figure 4 Data Block Header gt Logical Structure A Standard Data Block Header has the following fields
30. olean True Indicates if the counter False for block is enabled Uint8 1 2 Inidicates how many EEP s are configured 4 7 TI FEE Parameter Configuration 4 3 TI FEE Driver General Configuration Data Structure This section describes the parameters which are used to configure the TI FEE driver 4 7 1 Operating Frequency 80 define Device operating frequency in MHz It is equivalent to the HCLK frequency in the TMS5470M clock tree Device dependent parameter Refer to the device datasheet to know the range TI FEE OPERATING FREQUENCY 80 0 27 4 72 Number of Blocks TI FEE NUMBER OF BLOCKS Defines the number of Data Blocks used for EEPROM emulation 0 1 0x1 to OxFFFE define FEE NUMBER OF BLOCKS 1 4 7 3 Number of Virtual Sectors TI FEE NUMBER OF VIRTUAL SECTORS Defines the number of Virtual Sectors used for FEE 0x2 Min Ox2 Max 0x4 define TI FEE NUMBER OF VIRTUAL SECTORS 2 4 74 Number of Virtual Sectors for EEP1 FEE NUMBER OF VIRTUAL SECTORS Defines the number of Virtual Sectors used for FEE for EEP1 0 0 Min Ox TI FEE NUMBER OF VIRTUAL SECTORS 2 define TI FEE NUMBER OF VIRTUAL 5 1 2 28 4 7 5 TI FEE Virtual Sector Configuration TI FeeVirtualSectorConfiguration Used
31. r TwoActiveVS Error TwoCopyVS Error SetupStateMachine Error NoActiveVS Error CopyButNoActiveVS Error NoFreeVS Error EraseVS If error is any of the above type then API TI Fee ErrorRecovery should be called with proper parameters If the error is of type Error TwoActiveVS or Error TwoCopyVS or Error CopyButNoActiveVS then the application has to provide info on which of the VS needs to be corrected in u8VirtualSector Tl Fee u16ActCpyVS will provide info on which of the VS s are Active Copy For error of type Error CopyButNoActiveVS Fee u16ActCpyVS will provide info on which VS is Copy In this case the second argument for the Fee ErrorRecovery should be the copy VS number Error recovery API will mark the VS as Active If the error is of type Error NoFreeVS then the application has to provide info on which of the VS needs to be erased in u8VirtualSector Fee u16ActCpyVS will provide info on which VS is active If the error is of type Error SetupStateMachine recheck configuration Configure RWAIT EWAIT and operating frequency correctly If the error is of type Error EraseVS this means either erasing or a blank check of VS failed Call error recovery function to perform erase again Check the variables TI Fee GlobalVariables u8EEPIndex Fee ut6ActiveVirtualSector TI Fee GlobalVariables u8EEPIndex Fee u16CopyVirtualSector to know which of the VS s are active copy Erase other sectors Application can access the vari
32. r intellectual property right of TI covering or relating to any combination machine or process in which such products or services might be or are used Tl s publication of information regarding any third party s products or services does not constitute approval license warranty endorsement thereof Reproduction of information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties conditions limitations and notices Representation or reproduction of this information with alteration voids all warranties provided for an associated TI product or service is an unfair and deceptive business practice and is neither responsible nor liable for any such use Resale of 5 products or services with statements different from or beyond the parameters stated by TI for that product or service voids all express and any implied warranties for the associated TI product or service is an unfair and deceptive business practice and is not responsible nor liable for any such use Also see Standard Terms and Conditions of for Semiconductor Products www ti com sc docs stdterms htm Mailing Address Texas Instruments Post Office Box 655303 Dallas Texas 75265 Copyright 2012 Texas Instruments Incorporated Preface Read This First About This Manual This User s Manual serves as a software programmer s handbook for working with the T
33. s command shall program a Flash Data block asynchronously 2 WriteSync This command shall program a Flash Data block synchronously 3 Read This command shall copy a continuous Flash Data block 4 Erase This command will erase a Flash Data block It will update the address field in the Data Block to point to a location which is blank all 1 s 5 Invalidate Block This command shall mark the block as invalid in Data Block header 2 1 4 Status Codes 2 1 5 Job Result This indicates the status of the Fee module It can be in one of the following states 1 Uninitialized The Fee Module has not been initialized 2 Idle The Fee Module is currently idle 3 Busy The Fee Module is currently busy 4 Busy Internal The Fee Module is currently busy with internal management operations This indicates the result of the last job The job result can be any one of the following states 1 OK The last job has finished successfully 2 Pending The last job is waiting for execution or is currently being executed 3 Cancel last job has been cancelled 4 Failed The last read erase write job failed 5 Inconsistent The requested block is inconsistent it may contain corrupted data 6 Invalid The requested block has been invalidated The requested read operation cannot be performed Chapter 3 File List This chapter provides the list of files generated from HALCoGen for FEE Driver FieName _ Destinat
34. scccccssscscccccsccsscssscccscsssccsccses 1 1 OVERVIEW UE 10 1 1 1 Functions supported in the TI FEE Driver Las ete ke caos 10 7 52 Other Components iiic TE ERE XANH MEER ease sent de ER XR 11 1 1 3 Development Platform iie ea ved ee ERRARE NEUE ADR netsh 11 2 O FEE Driver Design 5 9 L2 SoA amen 12 2 1 FLASH EEPROM EMULATION METHODOLOGY 13 2 1 1 Virtual Sector Organization 13 24 2 Data Block 16 2 1 3 Supported Commands siete tet pii prO ED tanh 18 244 Slats COMES id nen ana 18 ale 18 EN ONDE EQ IDE n qi doe ai E File Li 19 MID Chapter aee iR Ieri 1 4 1 ERROR RECOVERY 40000000000 000000 188 21 4 2 SINGLE AND DOUBLE BIT ERROR CORRECTIONS 22 4 3 MEMORY MAPPING to 22 4 4 B IDD PEROCEDDBE
35. ser s application Many applications require storing small quantities of system related data e g calibration values device configuration in a non volatile memory so that it can be used modified or reused even after power cycling the system 5 are primarily used for this purpose EEPROMs have the ability to erase and write individual bytes of memory many times over and the programmed locations retain the data over a long period even when the system is powered down The objective of FEE Driver is to provide a set of software functions intended to use a Sector of on chip Flash memory as the emulated EEPROM These software functions are transparently used by the application program for writing reading and modifying the data A list of functions supported by the FEE Driver can be found in Section 1 1 1 The primary function responsible for Fee management is the FeeManager function This function shall operate asynchronously and with little or no user intervention after configuration maintaining the Fee structures in Flash memory This function should be called on a cyclic basis when no other pending Fee operations are pending so that it can perform internal operations 1 1 11 Functions supported in the FEE Driver The FEE Driver provides the following functional services Initialization e Fee Init Operations e Fee WriteAsync e Fee WriteSync e TI Fee Read e TI Fee EraselmmediateBloc
36. severe errors 4 11 Privilege Mode access FEE needs following API s to be executed in Privilege mode TI Fee Init Feelnternal WriteDataF021 48
37. to define a Virtual Sector FeeVirtualSectorConfigType This is a structure having the following members VirtualSectorNumber Virtual Sector s Number FlashBank Flash Bank to use for virtual sector StartSector Starting Sector in the Bank for this Virtual Sector EndSector Ending Sector in the Bank for this Virtual Sector The configurations described in the following section are repeated for each Virtual Sector 4 75 1 Virtual Sector Number VirtualSectorNumber Each Virtual Sector is assigned a number starting from Ox1 0 1 Min Ox1 Max 0x4 29 4 7 5 2 Flash Bank 4 7 5 3 Start Sector 4 7 5 4 End Sector FlashBank Indicates the Flash Bank used by the Virtual Sector All the Virtual Sectors should use the same Flash Bank 0 7 Bank 0 is not supported for FEE Any other Flash Bank on the device can be used Please refer to the device datasheet Flash Memory Map for more details StartSector Indicates the Flash Sector in the Bank used by the Virtual Sector as the Start sector 0x0 Device specific can use any Sector of the selected Flash Bank Please refer to the device datasheet Flash Memory Map for more details EndSector Indicates the Flash Sector in the Bank used by the Virtual Sector as the End sector 0 0 Device specific can use any Flash Sector of the selected Flash
Download Pdf Manuals
Related Search
Related Contents
Quality Assurance Plan for Discharge Measurements Using MANUAL DE OPERACIÓN InviMag Blood DNA Mini Kit/ KF96 User manual Register and win! KM 130/300 R D Manuel Utilisateur midiclock - E Samsung ST550 User's Manual Copyright © All rights reserved.
Failed to retrieve file