Home
Standard software driver for C90FL2 Flash
Contents
1. 15 Return values for BlankCheck 16 Arguments for 5 17 Return values for FlashProgram 18 Programming algorithm for FlashProgram lisse 19 Arguments for 19 Return values for ProgramVerify 20 Arguments for CheckSum 21 Return values for 5 21 Arguments for lt 22 Return values for FlashSuspend 22 suspendState definitions illii ees 23 Suspending state and flag vs CQOFL status 23 Arguments for 5 24 Return values for 25 resumeState definitions liliis rh 25 Arguments for GetLock 26 Return values for GetLock 000 cee eren 26 blkLocklndicator 5 26 blkLockState bit allocation for s
2. Code Name Value Description LOCK MID 6 block lock protection of mid address space LOCK MID SECONDARY 7 Secondary block lock protection of mid address space LOCK HIGH 8 Block lock protection of high address space For Shadow Low Mid address spaces there are two block lock levels The secondary level of block locking provides an alternative means to protect blocks from being modified A logical OR of the corresponding bits in the primary and secondary lock registers for a block determines the final lock status for that block For high address space there is only one block lock level The output parameter b kLockState returns a bit mapped value indicating the block lock status of the specified locking level and address space A main array block or shadow row is locked from if its corresponding bit is set The indicated address space determines the valid bits of b kLockState For either Low Mid High address spaces if blocks corresponding to valid block lock state bits are not present due to configuration or total memory size values for these block lock state bits will be always 1 because such blocks are locked by hardware on reset These blocks cannot be unlocked by software with SetLock function The following diagrams show the block bitmap definitions of b kLockState for shadow Low Mid High address spaces Table 31 blkLockState bit allocation for shadow
3. DoclD024601 Rev 15 43 API specification UM1634 Table 12 Arguments for BlankCheck Argument Descri Size in bytes o Ae region to check ption f the Flash If size 0 the return value is C90FL It should be multiple of 8 and its combination with dest should fall in either main array or shadow row Range Return the addr non blank Flash checking region pFailAddress ess of the first location in the Only valid when this function returns C90FL ERROR NOT BLANK Return the content of the first Only valid when this function returns function pFailData non blank Flash location in the C90FL ERROR NOT BLANK checking region CallBack Address of void callback Any addressable void function address To disable it use NULL CALLBACK macro Return values Table 13 Return values for BlankCheck Return Values C90FL ERROR ALIGNMENT Possible Causes The dest and size are not properly aligned Solution Check if dest and size are aligned on double word 64 bit boundary C90FL ERROR RANGE The area specified by dest and size is out of the valid C90FL array ranges Check dest and dest size The area to be checked must be within main array space or shadow space C90FL ERROR NOT BLANK C90FL OK There is a non blank double word within the area to be checked Successful completion Re erase the relevant bl
4. DoclD024601 Rev 7 43 Memory layout UM1634 8 43 Figure 2 Linear logical address mapping xx00 0000 LAS BANKO LAS BANKO MAS 8 X 16K Blocks 2 X 64K Blocks 2 X 128K Blocks xx08 0000 MAS BANKI LAS MAS 2 X 256K Blocks xxl0 0000 xx3F FFFF xxEF C000 Shadow Row 1 xxFF C000 Shadow Row 0 So for user the block information looks like as follows Table 1 Block Information for user Address space Number of blocks Description Low Address Space LAS 12 8 x 16K Blocks 2 x 64K Blocks 2 x128 k blocks Mid Address Space MAS 2 2 x 256K Blocks High Address Space HAS 6 6 x 512K Blocks Shadow Row 1 1 Size 16 Base address C000 Shadow Row 0 1 Size 16 Base address xxFF C000 DoclD024601 Rev UM1634 API specification 3 API specification 3 1 General overview The C90FL 2 SSD has APIs to handle the erase program erase verify and program verify operations on the Flash Apart from these it also provides the feature for locking specific blocks and calculating check sum 3 2 General type definitions Table 2 Type definitions Derived type Size C language type description BOOL 8 bits unsigned char INT8 8 bits signed char VINT8 8 bits volatile signed char UINT8 8 bits unsigned char VUINT8 8 bits volatile unsigned char INT16 16 bits signed short VINT16 16 bit
5. life augmented y UM1634 User manual Standard software driver for C9OFL2 Flash April 2014 Introduction This document is the user manual for the Standard Software Driver SSD for C90FL 2 Flash module The SSD is a set of API s that enables user application to operate on the Flash module embedded on a microcontroller The C90FL 2 SSD contains a set of functions to program erase C90FL 2 Flash module The C90FL 2 Standard Software Driver SSD provides the following API s Flashlnit FlashErase BlankCheck FlashProgram ProgramVerify CheckSum FlashSuspend FlashResume GetLock SetLock FlashDepletionRecover FlashECCLogicCheck FlashArrayIntegrityCheck FactoryMarginReadCheck DoclD024601 Rev 1 43 www st com Contents UM1634 Contents 1 Introduction LE 6 1 1 Document overview 6 1 2 Features 3 5 6 2 Memory 7 2 1 General overview 7 3 API specification 9 3 1 General overview 9 3 2 General type definitions 9 3 3 Configuration parameters and macros 9 3 4 Callback notification ic EE E COR eRe COE X qn 10 3 5 Return COGS uc ree
6. NOTCHECK for FlashECCLogicCheck 4 DoclD024601 Rev UM1634 Please Read Carefully Information in this document is provided solely in connection with ST products STMicroelectronics NV and its subsidiaries ST reserve the right to make changes corrections modifications or improvements to this document and the products and services described herein at any time without notice All ST products are sold pursuant to ST s terms and conditions of sale Purchasers are solely responsible for the choice selection and use of the ST products and services described herein and ST assumes no liability whatsoever relating to the choice selection or use of the ST products and services described herein No license express or implied by estoppel or otherwise to any intellectual property rights is granted under this document If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILI
7. 9 Configuration Structure Please refer to Section 3 3 for more details 1 shadow row not to be erased Indicate either th 2 shadow row of to be erased i e Shadow ndicate either the Rowo to be erased shadowFlag array or the shadow row to be erased 3 shadow row of bank1 to be erased i e Shadow Row1 to be erased 4 both the shadow rows to be erased lowEnabledBlocks To select the array blocks in low address space for erasing Bit mapped value Select the block in the low address space to be erased by setting 1 to the appropriate bit of lowEnabledBlocks If there is not any block to be erased in the low address space lowEnabledBlocks must be set to 0 To select the array Bit mapped value Select the block in the middle address space to be erased by setting 1 to the midEnabledBlocks blocks in mid address appropriate bit of midEnabledBlocks If there is not space for erasing any block to be erased in the middle address space midEnableaBlocks must be set to 0 Bit mapped value Select the block in the high To select the array address space to be erased by setting 1 to the highEnabledBlocks blocks in high address appropriate bit of highEnableaBlocks If there is not space for erasing any block to be erased in the high address space highEnabledBlocks must be set to 0 Address of void call Any addressable void function address To disable it CallBack back function point
8. Table 16 Programming algorithm for FlashProgram Address space to be programmed Description LAS or MAS or Shadow Row Programmed linearly double word by double word Programmed linearly double word by double word alternately P across each bank Programmed in parallel until programming in one address space LAS and MAS finishes The remaining double words are programmed linearly in the other address space Program MAS linearly Once programming finishes HAS is MAS and HAS programmed in parallel First programmed in parallel for LAS and MAS Once LAS MAS and HAS programming finishes in both the address spaces HAS is programmed in parallel Assumptions It assumes that the Flash block is initialized using a Flashlnit 3 6 5 ProgramVerify Description The ProgramVerify checks if a programmed Flash range matches the corresponding source data buffer In case of mismatch the failed address destination value and source value are saved and relevant error code is returned Prototype UINT32 ProgramVerify PSSD CONFIG pSSDConfig INT32 dest INT32 size INT32 source INT32 pFailAddress INT64 pFailData INT64 pFailSource void CallBack void Gl Arguments Table 17 Arguments for ProgramVerify Argument Description Range SSDConfi Pointer to the SSD The values in this structure are chip dependent 9
9. 4 DoclD024601 Rev UM1634 API specification 4 Following table defines and describes various suspend states and associated suspend codes Table 23 suspendState definitions Argument Code Description Valid operation after suspend Erasing operation programming NO_OPERTION 0 There is no program erase operation and read are valid on operation both main array space and shadow row There is a program PGM WRITE 1 sequence in interlock write Only read is valid on both maini array space and shadow row stage ERS_WRITE 2 There is an erase sequence Only read is valid on both main in interlock write stage array space and shadow row There is an erase suspend ERS SUS WRITE 3 program sequence in valle on bot main array space and shadow row interlock write stage The program operation is in Only read is valid on both main PGM_SUS 4 suspended state array space and shadow row The erase operation on Prearemmne opraion sal ERS_SUS 5 main array is in suspended yc y space is valid on both main array space state and shadow row The erase operation on SHADOW ERS SUS 6 shadow row is in suspended Read iS velis space and shadow space state The erase suspended ERS 505 505 7 program operation is Pal regis valid Om array space and shadow row suspended state The table below lists the Suspend Flag val
10. 4 DoclD024601 Rev 3 43 List of tables UM1634 List of tables Table 1 Table 2 Table 3 Table 4 Table 5 Table 6 Table 7 Table 8 Table 9 Table 10 Table 11 Table 12 Table 13 Table 14 Table 15 Table 16 Table 17 Table 18 Table 19 Table 20 Table 21 Table 22 Table 23 Table 24 Table 25 Table 26 Table 27 Table 28 Table 29 Table 30 Table 31 Table 32 Table 33 Table 34 Table 35 Table 36 Table 37 Table 38 Table 39 Table 40 Table 41 Table 42 Table 43 Table 44 Table 45 Table 46 Table 47 Table 48 4 43 Block Information for USer 0 8 Type definitiOns acc ced Rea Rd RR x dae os De ee Rahs 9 SSD configuration structure field 10 8 DL 11 Arguments for Flashlnit 2 2 9 29 2 92 25 RII III 12 Return values for 12 Arguments for 5 13 Return values for 14 Bit allocation for blocks in low address space 14 Bit allocation for blocks in middle address 14 Bit allocation for blocks in high address 5 15 Arguments for
11. Configuration Structure Please refer to Section 3 3 for more details Destination address to be Any accessible address aligned on double word Dest odi verified in Flash memory boundary in main array or shadow row DoclD024601 Rev 3 19 43 API specification UM1634 Table 17 Arguments for ProgramVerify continued Argument Size Description Size in byte of the Flash region to verify Range If size 0 is returned Its combination with dest should fall within either main array or shadow row Source Verify source buffer address This address must reside on word boundary pFailAddress Return first failing address in Flash Only valid when the function returns C90FL ERROR VERIFY pFailData pFailSource Returns first mismatch data in Flash Returns first mismatch data in buffer Only valid when this function returns C90FL ERROR VERIFY Only valid when this function returns C90FL ERROR VERIFY CallBack Address of void call back function pointer Any addressable void function address To disable it use NULL CALLBACK macro Return values Table 18 Return values for ProgramVerify Return Values C90FL ERROR ALIGNMENT aligned This error indicates that dest size source isn t properly Possible Causes Solution Check if dest and size are aligned on double word 64 bit boundary Check if source is aligned on wo
12. ECC value which is eccValue calculated by an offline ECC calculator 8 bit mask of the bits at errECCBits which the user intends to inject error on ECC value Any 8 bit value Select the bit to be a fault bit by setting 1 to the appropriate bit of this input 4 DoclD024601 Rev UM1634 API specification 3 7 3 4 Return values Table 45 Return values for FlashECCLogicCheck Return Values Possible Causes Solution The ECC value calculated Re calculate the ECC values C90FL ERROR ECC LOGIC by the user is incorrect using the correct Data Hardware is failure Hardware Error This API supports to check single bit fault correction or double bit fault detection only There are more than two bit C90FL ERROR ECC NOTCHECK faults simulated C90FL OK Successful completion Comments The API supports single bit correction and double bit error detection in 72 bit codeword including 8 ECC bits Depending on the errBits and errECCBits values a single or double bit faults is simulated When a Flash read is done if the simulated error has not occurred then the API returns the error code C90FL ERROR LOGIC For more than two bit faults detection the behavior is indeterministic Thus this API will not check for this case and shall return error code C90FL ERROR ECC NOTCHECK The read buffer in flash platform controller must be disabled before simulating for single
13. address space for erasing Please refer to Section 3 3 for more details Bit mapped value Select the block in the low address space whose array integrity is to be evaluated by setting 1 to the appropriate bit of lowEnableaBlocks f there is not any block to be evaluated in the low address space lowEnableaBlocks must be set to 0 To select the array Bit mapped value Select the block in the middle address space whose array integrity is to be evaluated by setting 1 to the appropriate bit of misrValue BkO misrValue Bk1 CallBack Meee DEKS i Mid M midEnableaBlocks f there is not any block to be evaluated in the middle address space midEnabledBlocks must be set to 0 Bit mapped value Select the block in the high To select the array address space whose array integrity is to be highEnabledBlocks blocks in high address Valvated by setting 1 to the appropriate bit of space for erasing highEnableaBlocks f there is not any block to be evaluated in the high address space highEnabledBlocks must be set to 0 The default sequence addrSeq 0 is meant to replicate sequences normal user code follows and thoroughly check the read propagation paths To determine the This sequence is proprietary addrSeq acaress Sequence tope The alternative sequence addrSeq 1 is just used during array integrity checks A structure variable containing the MISR values for Bank 0 calculated by the user by using a
14. and bit 1 for high address space valid bits are from bit O to bit 5 Table 48 Bit allocation for blocks in low address space MSB LSB bit 31 E bit 10 bit 9 bit 8 bit 1 bit 0 reserved 2s reserved block 9 block 8 2 block 1 block 0 Table 49 Bit allocation for blocks in middle address space MSB LSB bit 31 ed bit 4 bit 3 bit 2 bit 1 bit 0 reserved at reserved reserved reserved block 1 block 0 DoclD024601 Rev 37 43 API specification UM1634 Table 50 Bit allocation for blocks in high address space MSB LSB bit 31 bit 6 bit 5 bit 4 bit 1 bit 0 reserved reserved block 5 block 4 Block 1 Block 0 If no blocks are enabled the C90FL ERROR FMR NO BLOCK error code is returned The MISR values are calculated for the enabled blocks using the logical sequence If the MISR values calculated by the hardware is not the same as the values passed to this API by the user then the API returns the error code C90FL ERROR FMR MISMATCH Assumptions It assumes that the Flash block is initialized using a Flashlnit a 38 43 DoclD024601 Rev 4 UM1634 System requirements Appendix System requirements The C90FL 2 SSD is designed to support C90FL 2 Flash module embedded on SPC564Axx microcontrollers Before using this SSD on a different derivative microcontroller user has to provide the
15. che VEN one 11 3 6 Normal mode functions 12 3 6 1 Flashlnit ic ite eere Oke Aaa 12 3 6 2 FlashErase 13 3 6 3 BlankCheck 15 3 6 4 FlashProgram coos nme E EA RR Reds 17 3 6 5 ProgramVerify ne 19 3 6 6 Chi ckSutm e aridi e la anaes aaa aia 21 3 6 7 FlashSuspend c 302 sa sada eed aed hx ea da eee e In 22 3 6 8 FlashResume sc twine eta ken ee ewe bee ed ae 24 3 6 9 GetLock 2 0 2 2 eee 25 3 06 10 DeLOCK cna Lau dope te wade wt ee 28 3 6 11 FlashDepletionRecover 29 3 7 User test mode functions 31 3 7 1 FlashArraylntegrityCheck 31 3 7 2 FlashECCLogicCheck 34 3 7 3 FactoryMarginReadCheck 35 Appendix A System requirements 39 Appendix lt 40 2 43 DoclD024601 Rev 3 Ly UM1634 Contents Appendix C Document reference 41 REVISION NISIOLY uas accion dnd basics CR een aae dica CR dod uf x es OA CR RC 42
16. high Check if the C90FL module is available and high voltage is C90FL ERROR EGOOD Depletion operation failed applied to C90FL Then try to do the recovery operation again C90FL OK Successful completion Comments For comments please refer to Section 3 6 2 for details Assumptions It assumes that the flash block is initialized using the Flashinit API User will provide the correct ssdconfig parameters to the FlashDepletionRecover as returned by the Flashinit User test mode functions FlashArraylIntegrityCheck Description This function checks the array integrity of the Flash The user specified address sequence is used for array integrity reads and the operation is done on the specified blocks The MISR values calculated by the hardware is compared to the values passed by the user if they are not the same then an error code is returned Prototype UINT32 FlashArrayIntegrityCheck PSSD CONFIG pSSDConfig UINT32 lowEnabledBlocks UINT32 midEnabledBlocks UINT32 highEnabledBlocks UINT8 addrSeq MISR misrValue DoclD024601 Rev 31 43 API specification UM1634 32 43 MISR misrValue void CallBack void Arguments Table 39 Arguments for FlashArrayIntegrityCheck Argument Description Range pSSDContig Pointer to the SSD The values in this structure are chip dependent lowEnabledBlocks Configuration Structure To select the array blocks in low
17. information specific to the derivative through a configuration structure Table 51 System requirements Tool name Description Version number CodeWarrior IDE Development tool 2 3 Win32 Diab Development tool 5 5 1 0 Trace32 Lauterbach Debugging tool DoclD024601 Rev 39 43 Acronyms UM1634 Appendix Acronyms 40 43 Table 52 Acronyms Abbreviation Complete name API Application Programming Interface ECC Error Correction Code ECU Electronic Control Unit EVB Evaluation Board RWW Read While Write SSD Standard Software Driver DoclD024601 Rev UM1634 Document reference Appendix Document reference 1 SPC564A74xx SPC564A80xx 32 bit MCU family built on the embedded Power Architecture RM0029 DoclD15177 4 DoclD024601 Rev 41 43 Revision history UM1634 Revision history 42 43 Table 53 Document revision history Date Revision Changes 02 May 2013 1 Initial release 22 Sep 2013 2 Updated Disclaimer Add FlashDepletionRecover Remove note about COMPILER_SELECT in Section 3 3 Configuration parameters and macros Merge Return Values table and Troubleshooting table for ion 3 AP e 09 Apr 2014 3 Section 3 I specification Add more information in comment section of FlashECCLogicCheck Change function prototype of FlashECCLogicCheck Add one more return value CO0FL ERROR
18. the same as the values passed to this API by the user then the API returns the error code C90FL ERROR AIC MISMATCH Assumptions It assumes that the Flash block is initialized using a Flashlnit FlashECCLogicCheck Description This function checks the ECC logic of the Flash The API simulates a single or double bit fault depending on the user input If the simulated ECC error is not detected then the error code C90FL ERROR LOGIC is returned User has to pass ECC value calculated by the off line tool to this API Prototype UINT32 FlashECCCLogicCheck PSSD CONFIG pSSDConfig UINT64 dataVal UINT64 errBits UINT8 eccValue UINT8 errECCBits Arguments Table 44 Arguments for FlashECCLogicCheck Argument Description Range SSDConfi Pointer to the SSD The values in this structure are chip dependent P 9 Configuration Structure Please refer to Section 3 3 for more details The 64 bits of data for which the ECC is calculated The dataValue bits of dataValue are flipped Any 64 bit value to generate single or double bit faults 64 bit mask of the bits at errBits which the user ihteridsto Any 64 bit value Select the bit to be a fault bit by inject error on data value setting 1 to the appropriate bit of this input This is a corresponding ECC value for the data value passed by the user Note Same data words should be used in offline ECC calculator and Flash ECC logic check API 8 bit
19. to any other flash operations Prototype UINT32 FlashInit PSSD CONFIG pSSDConfig Arguments Table 5 Arguments for Flashlnit Argument Description Range SSDConfi Pointer to the SSD The values in this structure are chip dependent p 9 Configuration Structure Please refer to Section 3 3 for more details Return values Table 6 Return values for Flashlnit Return Values Possible Causes Solution C90FL OK Successful completion Comments The Flashinit will check the COOFL MCR RWE and C90FL MCR EER bits and clear them when any of them is set Assumptions The user must correctly initialize the fields including c90flHegBase mainArrayBase shadowRowBase shadowRowSize pageSize and BDMEnable before passing the structure to the Flashlnit functions 4 DoclD024601 Rev UM1634 API specification 3 6 2 4 FlashErase Description The FlashErase API erases the enabled blocks in the main array or the shadow row Input arguments together with relevant Flash module status are checked and relevant error code is returned if there is any error Prototype UINT32 FlashErase PSSD CONFIG pSSDConfig UINT8 shadowFlag UINT32 lowEnabledBlocks UINT32 midEnabledBlocks UINT32 highEnabledBlocks void CallBack void Arguments Table 7 Arguments for FlashErase Argument Description Range SSDConfi Pointer to the SSD The values in this structure are chip dependent
20. Both should fall in the same C90FL address ranges i e both in main array or both in shadow row C90FL ERROR PGO OD Program operation failed Re erase relevant location and do programming again If still fails check if the power supplied is sufficient or not C90FL OK Comments Successful completion If the selected main array blocks or the shadow row is locked for programming those blocks or the shadow row not programmed and FlashProgram still returns C90FL User needs to verify the programmed data with ProgramVerify function It is impossible to program any Flash block or shadow row when a program or erase operation is already in progress on C90FL module FlashProgram returns C90FL ERROR BUSY when doing so However user can use the FlashSuspend function to suspend an on going erase operation on one block to perform a program operation on another block An exception is that once the user has begun an erase operation on the main array or shadow row it may not be suspended to program the main array and vice versa It is unsafe to read the data from the Flash partitions having one or more blocks being programmed when FlashProgram is running Otherwise it causes a Read While Write error If the address to be programmed by the user lies across the boundaries of LAS MAS and HAS FlashProgram handles them as follows DoclD024601 Rev Ly UM1634 API specification
21. DoclD024601 Rev 3 ky UM1634 API specification 3 5 4 define NULL CALLBACK void OxFFFFFFFF The job processing callback notifications shall have no parameters and no return value Return codes The return code is returned to the caller function to notify the success or errors of the API execution These are the possible values of return code Table 4 Return codes Name Value Description C90FL OK 0x00000000 The requested operation is successful C90FL INFO RWE 0x00000001 RWE bit is set before Flash operations C90FL INFO EER 0x00000002 EER bit is set before Flash operations C90FL ERROR ALIGNMENT 0x00000100 Alignment error C90FL ERROR RANGE 0x00000200 Address range error New program erase cannot be preformed C90FL ERROR BUSY 0x00000300 while a high voltage operation is already in progress C90FL ERROR PGOOD 0x00000400 The program operation is unsuccessful C90FL ERROR EGOOD 0x00000500 The erase operation is unsuccessful C90FL ERROR NOT BLANK There is a non blank Flash memory location within the checked Flash memory region There is a mismatch between the source C90FL_ERROR_VERIFY 0x00000700 data and the content in the checked Flash memory C90FL_ERROR_LOCK_INDICATOR 0x00000800 Invalid block lock indicator C90FL ERROR RWE 0x00000900 TTE error occurred in previous C90FL ERROR PASSWORD 0x00000A00 The password provided cannot unlo
22. State is same as that in GetLock function Assumptions It assumes that the Flash block is initialized using a Flashlnit FlashDepletionRecover Description This function recovers over erased or depleted bits in flash block It is possible that a brownout during Flash erase operation will leave the bits in the Flash block s being erased at an over erased or depleted state Depending how depleted the bits are the excessive column leakage caused by the bits might cause the following erase operation for brownout recovery to fail due to suppressed drain bias For such case this function invok to recover the depleted bits in those Flash block s so that they can be erased again for brownout recovery Prototype UINT32 FlashDepletionRecover PSSD CONFIG pSSDConfig UINT8 shadowFlag UINT32 lowEnabledBlocks UINT32 midEnabledBlocks UINT32 highEnabledBlocks void CallBack void DoclD024601 Rev 29 43 API specification 30 43 UM1634 Arguments Table 37 Arguments for FlashDepletionRecover Argument Description Range The values in this structure are chip pSSDConfig Pointer to dependent Please refer to Section 3 3 for Configuration Structure more details 04 Shadow row not to be recovered Indicate either th 05 Shadow row of bankO to be erased i e naicate either the main array or shadow Rowo to be recovered shadowFlag the shadow row to be recovered 06 Shadow row of
23. TY FITNESS FOR A PARTICULAR PURPOSE AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION OR INFRINGEMENT OF ANY PATENT COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT ST PRODUCTS ARE NOT DESIGNED OR AUTHORIZED FOR USE IN A SAFETY CRITICAL APPLICATIONS SUCH AS LIFE SUPPORTING ACTIVE IMPLANTED DEVICES OR SYSTEMS WITH PRODUCT FUNCTIONAL SAFETY REQUIREMENTS B AERONAUTIC APPLICATIONS C AUTOMOTIVE APPLICATIONS OR ENVIRONMENTS AND OR D AEROSPACE APPLICATIONS OR ENVIRONMENTS WHERE ST PRODUCTS ARE NOT DESIGNED FOR SUCH USE THE PURCHASER SHALL USE PRODUCTS AT PURCHASER S SOLE RISK EVEN IF ST HAS BEEN INFORMED IN WRITING OF SUCH USAGE UNLESS A PRODUCT IS EXPRESSLY DESIGNATED BY ST AS BEING INTENDED FOR AUTOMOTIVE AUTOMOTIVE SAFETY OR MEDICAL INDUSTRY DOMAINS ACCORDING TO ST PRODUCT DESIGN SPECIFICATIONS PRODUCTS FORMALLY ESCC QML OR JAN QUALIFIED ARE DEEMED SUITABLE FOR USE IN AEROSPACE BY THE CORRESPONDING GOVERNMENTAL AGENCY Resale of ST products with provisions different from the statements and or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever any liability of ST ST and the ST logo are trademarks or registered trademarks of ST in various countries Information in this document supersedes and replaces all information previously supplied The ST logo is a registered trademark
24. address space MSB LSB bit 31 sine bit 1 bit 0 reserved reserved shadow row Table 32 blkLockState bit allocation for low address space MSB LSB bit 31 m bit 10 bit 9 bit 8 aes bit 1 bit 0 reserved bus reserved block 9 block 8 block 1 block 0 Table 33 blkLockState bit allocation for mid address space MSB LSB bit 31 a bit 4 bit 3 bit 2 bit 1 bit 0 reserved 2 reserved reserved reserved block 1 block 0 DoclD024601 Rev 3 27 43 API specification UM1634 Table 34 blkLockSiate bit allocation for high address space MSB LSB bit 31 T bit 6 bit 5 bit 4 xus bit 1 bit 0 reserved reserved block 5 block 4 zs block 1 block 0 Assumptions It assumes that the Flash block is initialized using a Flashlnit 3 6 10 SetLock Description The SetLock API sets the block lock state for Shadow Low Middle High address space on the C90FL module to protect them from program erase The API provides password to enable block lock register writes when is needed and write the block lock value to block lock register for the requested address space Prototype UINT32 SetLock PSSD CONFIG pSSDConfig UINT8 blkLockIndicator UINT32 blkLockState UINT32 password Arguments Table 35 Arguments for SetLock Argument Description Range SSDConfi Pointer to the SSD The values in thi
25. address space block locking register is disabled for register writes Returns the blocks locking Bit mapped value indicating the locking status of status of indicated locking the specified locking level and address space blkLockState 1 The block is locked from program erase 0 The block is ready for program erase Table 29 Return values for GetLock Return Values C90FL ERROR LOCK INDICATOR Possible Causes The input blkLocklndicator is invalid Solution Set this argument to correct value listed in Table 30 C90FL OK Successful completion Comments Following table defines and describes various blkLocklIndicator values Table 30 blkLocklndicator definitions Code Name Value LOCK SHADOW PRIMARYO 0 Primary block lock protection of shadow address space Shadow row 0 Description LOCK SHADOW SECONDARYO Secondary block lock protection of shadow address space Shadow row 0 LOCK_SHADOW_PRIMARY1 2 Primary block lock protection of shadow address space Shadow row 1 LOCK SHADOW SECONDARY1 Secondary block lock protection of shadow address space Shadow row 1 LOCK LOW PRIMARY 4 Primary block lock protection of low address space LOCK LOW SECONDARY Secondary block lock protection of low address space DoclD024601 Rev Ly UM1634 API specification 4 Table 30 blkLocklndicator definitions continued
26. ation for blocks in low address space 37 DoclD024601 Rev 3 ky UM1634 List of tables Table 49 Bit allocation for blocks in middle address 5 37 Table 50 Bit allocation for blocks in high address 38 Table 51 System dee 39 Table 52 ACrODVITIS osse oid ce aol nace eae ine e e dex edd a god cec e Rex a 40 Table 53 Document revision history 42 Ly DoclD024601 Rev 3 5 43 Introduction UM1634 1 1 1 2 6 43 Introduction Document overview This document is the user manual for the Standard Software Driver SSD for C90FL 2 Flash module The roadmap for the document is as follows Section 1 2 shows the features of the driver Appendix A System requirements details the system requirement for the driver development Appendix C Document reference lists the documents referred and Appendix B Acronyms lists the acronyms used Chapter 2 provides information about physical and logical memory map Chapter 3 describes the API specifications In this section there are many sub sections which describe the different aspects of the driver Section 3 1 provides a general overview of the driver Section 3 2 talks about the type definitions used for the driver Section 3 3 discusses about the d
27. bank1 to be erased i e Shadow to be recovered 07 Both the shadow rows to be recovered lowEnabledBlocks To select the array blocks in linear logical low address space for recovering refer to Section 2 1 General overview for more details Refer to section Arguments in Section 3 6 2 for details midEnabledBlocks highEnabledBlocks To select the array blocks in linear logical mid address space for recovering refer to Section 2 1 General overview for more details To select the array blocks in linear logical high address space for recovering refer to Section 2 1 General overview for more details Refer to section Arguments in Section 3 6 2 for details Refer to section Arguments in Section 3 6 2 for details CallBack Address of void call back function pointer Any addressable void function address To disable it use NULL CALLBACK macro DoclD024601 Rev 4 UM1634 API specification 3 7 3 7 1 4 Return values Table 38 Return values for FlashDepletionRecover Return Values Possible Causes Solution Wait until all previous program erase operations on Depletion operation cannot _ the flash module finish be performed because there Possible cases that erase C90FL_ERROR_BUSY is program erase sequence cannot start are in progress on the flash 1 erase in progress MCR module ERS is high 2 program in progress MCR PGM is
28. bit correction and double bit detection For double bit detection the ECC error exception handler needs to be set up properly as well Assumptions It assumes that the Flash block is initialized using a Flashlnit FactoryMarginReadCheck Description This function checks the Factory Margin reads of the Flash The user specified margin level is used for reads and the operation is done on the specified blocks The MISR values calculated by the hardware is compared to the values passed by the user if they are not the same then an error code is returned Prototype UINT32 FactoryMarginReadCheck PSSD CONFIG pSSDConfig UINT32 lowEnabledBlocks UINT32 midEnabledBlocks UINT32 highEnabledBlocks UINT8 marginLevel MISR misrValue MISR misrValue Bkl void CallBack void DoclD024601 Rev 35 43 API specification UM1634 36 43 Arguments Table 46 Arguments for FactoryMarginReadCheck Argument Description Range pSSDContig Pointer to the SSD The values in this structure are chip dependent Configuration Structure Please refer to Section 3 3 for more details lowEnabledBlocks To select the array blocks in low address space for erasing Bit mapped value Select the block in the low address space whose array integrity is to be evaluated by setting 1 to the appropriate bit of lowEnableaBlocks f there is not any block to be evaluated in the low address space lowEnableaBloc
29. ck the block lock register for register writes In FlashArraylntegrityCheck the MISR C90FL_ERROR_AIC_MISMATCH 0x00000BO0 values generated by the hardware do not match the values passed by the user C90FL ERROR AIC NO BLOCK FlashArrayintegrityCheck blocks have been enabled for Array Integrity check In FactoryMarginReadCheck the MISR C90FL ERROR FMR MISMATCH 0 00000000 values generated the hardware do not match the values passed by the user C90FL ERROR NO BLOCK oxoooooEoo FactoryMarginReadCheck no blocks have been enabled for Array Integrity check C90FL ERROR ECC LOGIC 0 00000 00 In FlashECCLogicCheck the simulated ECC error has not occurred DoclD024601 Rev 11 43 API specification UM1634 3 6 3 6 1 12 43 Normal mode functions Flashlnit Description The Flashlnit API reads the Flash configuration information from the Flash control registers and initialize parameters in SSD configuration structure The user gets low block number as sum of LAS and MAS blocks of bankO mid block number as sum of LAS and MAS blocks of bank1 high block number remains the same as the high blocks in bankO or bank1 Two HAS blocks one each from and Bank1 size 256 KB each are combined to form one logical HAS block 512 KB Main array size is returned to the user as sum of the size of the 2 banks FlashInit must be called prior
30. e lowBlockNum UINT32 Block number of the low address space midBlockNum UINT32 Block number of the mid address space highBlockNum UINT32 Block number of the high address space pageSize UINT16 The page size of the C90FL Flash 16 bytes BDMEnable UINT32 Defines the state of background debug mode enable disable The type definition for the structure is given below typedef struct _ssd_config INT32 c90flRegBase INT32 mainArrayBase INT32 mainArraySize INT32 shadowRowBase INT32 shadowRowSize INT32 lowBlockNum INT32 midBlockNum INT32 highBlockNum INT16 pageSize INT32 BDMEnable SSD CONFIG PSSD CONFIG ct 0 User has to make sure shadowRowBase always points to Shadow row Base of Bank 0 Even if the operation is done on Shadow Row of Bank 1 shadowRowBase should have address of Bank 0 shadow row Driver code expects shadow row base address of bank 0 only Driver has the workaround to point to shadow row base of bank 1 when needed this is done based on the value set for shadowFlag by the user Callback notification The Standard Software Driver facilitates the user to supply a pointer to CallBack function so that time critical events can be serviced during C90FL Standard Software driver operations Servicing watchdog timers is one such time critical event If itis not necessary to provide the CallBack service the user is able to disable it by a NULL function macro
31. e blocks of the main array is determined by setting clearing the corresponding bit in lowEnabledBlocks midEnabledBlocks or highEnableaBlocks The bit allocations for blocks in one address space are bit 0 is assigned to block 0 bit 1 to block 1 etc The following diagrams show the formats of lowEnabledBlocks midEnabledBlocks and highEnableaBlocks for the C90FL module For low address space valid bits are from bit O to bit 9 For middle address space valid bits are bit O and bit 1 For high address space valid bits are from bit O to bit 5 Table 9 Bit allocation for blocks in low address space MSB LSB bit 31 bit 10 bit 9 bit 8 ie bit 1 bit 0 reserved reserved block 9 block 8 ss block 1 block 0 Table 10 Bit allocation for blocks in middle address space MSB LSB bit 31 Em bit 4 bit 3 bit 2 bit 1 bit 0 reserved reserved reserved reserved block 1 block 0 DoclD024601 Rev 3 UM1634 API specification 3 6 3 4 Table 11 Bit allocation for blocks in high address space MSB LSB bit 31 T bit 6 bit 5 bit 4 Hs bit 1 bit 0 block 5 reserved reserved block 4 Block 1 Block 0 If the selected main array blocks or the shadow row is locked for erasing those blocks or the shadow row are not erased but FlashErase still returns C90FL OK User needs to check the erasing result with the BlankCheck functi
32. er use NULL CALLBACK macro DoclD024601 Rev 3 13 43 API specification UM1634 14 43 Return values Table 8 Return values for FlashErase Return Values Possible Causes Solution Wait until all previous program erase operations on this flash module to finish Possible cases that erase cannot start are 1 erase in progress MCR ERS is high 2 program in progress MCR PGM is high Check if the voltage supplied is sufficient Then try to do the erase operation again New erase operation cannot be C90FL_ERROR_B performed because there is USY program erase sequence in progress on the same flash module C90FL_ERROR_ EGOOD C90FL_OK Erase operation failed Successful completion Comments When shadowFlag is set to 0x00 the FlashErase function erases the blocks in the main array It is capable of erasing any combination of blocks in the low mid and high address spaces in one operation If shadowFlag is 0x01 0x02 or 0x03 this function erases the shadow row of Bank1 and and Bank1 together respectively User has to make sure that security word is programmed back after erasing the shadow rows to protect the part from getting censored The inputs owEnableaBlocks midEnabledBlocks and highEnableaBlocks are bit mapped arguments that are used to select the blocks to be erased in the Low Mid High address spaces of main array The selection of th
33. hadow address 5 27 blkLockState bit allocation for low address space 27 blkLockState bit allocation for mid address space 27 blkLockState bit allocation for high address 5 28 Arguments for 5 28 Return values for SetLock 29 Arguments for FlashDepletionRecover 30 Return values for FlashDepletionRecover 31 Arguments for 32 Return values for 33 Bit allocation for blocks in low address space 33 Bit allocation for blocks in middle address 33 Bit Allocation for Blocks in High Address 33 Arguments for 6 34 Return values for FlashECCLogicCheck 35 Arguments for FactoryMarginReadCheck 36 Return values for 37 Bit alloc
34. imultaneously without any suspend operation Assumptions It assumes that the Flash block is initialized using a Flashlnit FlashResume Description The FlashResume API checks if there is any suspended erase or program operation on the C90FL module and resumes the suspended operation if there is any Prototype UINT32 FlashResume PSSD CONFIG pSSDConfig UINT8 resumeState Arguments Table 25 Arguments for FlashResume Argument Description Range SSDConfi Pointer to the SSD The values in this structure are chip dependent 9 Configuration Structure Please refer to Section 3 3 for more details Indicate the resume state of resumeState C90FL module after the All return values are listed in Table 26 function being called 4 DoclD024601 Rev UM1634 API specification Return values Table 26 Return values for FlashResume C90FL OK Successful completion Comments This function resumes one operation if there is any operation is suspended For instance if a program operation is in suspended state it is resumed If an erase operation is in suspended state it is resumed too If an erase suspended program operation is in suspended state the program operation is resumed prior to resuming the erase operation It is better to call this function based on suspendFlag returned from FlashSupend Following table defines and describes various resume s
35. ks must be set to 0 To select the array blocks Bit mapped value Select the block in the middle address space whose array integrity is to be evaluated by setting 1 to the appropriate bit of midEnabledBlocks dass midEnableaBlocks f there is not any block to be 9 evaluated in the middle address space midEnabledBlocks must be set to 0 Bit mapped value Select the block in the high To select the array blocks address space whose array integrity is to be highEnabledBlocks in high address space for evaluated by setting 1 to the appropriate bit of g TPAS SCR OCAS a P highEnableaBlocks f there is not any block to be steer evaluated in the high address space highEnabledBlocks must be set to 0 To determine the margin Selects the margin level that is being checked level to be used during Margin can be checked to an erased level marginLevel factory margin read checks marginLevel 1 or to a programmed level marginLevel 0 misrValue BkO A structure variable containing the MISR values for Bank 0 calculated by the user using an off line MISR calculator The individual MISR words can range from 0x00000000 OXFFFFFFFF misrValue Bk1 A structure variable containing the MISR values for Bank 1 calculated by the user using an off line MISR calculator The individual MISR words can range from 0x00000000 OXFFFFFFFF CallBack Address of void call back func
36. locks of the main array is determined by setting clearing the corresponding bit in lowEnabledBlocks midEnabledBlocks or highEnableaBlocks The bit allocations for blocks in one address space are bit 0 is assigned to block 0 bit 1 to block 1 etc The following diagrams show the formats of lowEnabledBlocks midEnabledBlocks and highEnabledBlocks for the C90FL module For low address space valid bits are from bit O to bit 9 For middle address space valid bits are bit O and bit 1 For high address space valid bits are from bit O to bit 5 Table 41 Bit allocation for blocks in low address space MSB LSB bit 31 bit 10 bit 9 bit 8 bit 1 bit 0 reserved reserved block 9 block 8 block 1 block 0 Table 42 Bit allocation for blocks in middle address space MSB LSB bit 31 bit 4 bit 3 bit 2 bit 1 bit 0 reserved reserved reserved reserved block 1 block 0 Table 43 Bit Allocation for Blocks in High Address Space MSB LSB bit 31 bit 6 bit 5 bit 4 bit 1 bit 0 reserved reserved block 5 block 4 Block 1 Block 0 DoclD024601 Rev 33 43 API specification UM1634 3 7 2 34 43 If no blocks are enabled the C90FL ERROR AIC NO BLOCK error code is returned Depending on the address sequence specified the MISR values are calculated for the enabled blocks using the corresponding sequence If the MISR values calculated by the hardware is not
37. n off line MISR calculator A structure variable containing the MISR values for Bank 1 calculated by the user by using an off line MISR calculator Address of void call back function pointer logically sequential It should be noted that the time to run a sequential sequence is significantly shorter than the time to run the proprietary sequence The individual MISR words can range from 0x00000000 OxFFFFFFFF The individual MISR words can range from 0x00000000 OxFFFFFFFF Any addressable void function address To disable it use NULL CALLBACK macro DoclD024601 Rev Ly UM1634 API specification 4 Return values Table 40 Return values for FlashArrayIntegrityCheck Return Values Possible Causes Solution Re calculate the MISR values using the correct Data and addrSeq The MISR value calculated by the user is incorrect C90FL ERROR MISMATCH The MISR calculated by the s Hardware Error Hardware is incorrect Enable any of the blocks using variables lowEnabledBlocks midEnabledBlocks and highEnabledBlock None of the Blocks are enabled for Array Integrity Check C90FL ERROR AIC NO BLOCK C90FL OK Successful completion Comments The inputs owEnabledBlocks midEnabledBlocks and highEnabledBlocks are bit mapped arguments that are used to select the blocks to be evaluated in the Low Mid High address spaces of main array The selection of the b
38. ocks and check again Comments If the blank checking fails the first failing address is saved to pFailAdaress and the failing data in Flash is saved to pFailData The contents pointed by pFailAddress and pFailData are updated only when there is a non blank location in the checked Flash range Assumptions It assumes that the Flash block is initialized using a Flashlnit DoclD024601 Rev 4 UM1634 API specification 3 6 4 4 FlashProgram Description The FlashProgram API programs the specified Flash areas with the provided source data Input arguments together with relevant Flash module status are checked and relevant error code is returned if there is any error Prototype UINT32 FlashProgram PSSD CONFIG pSSDConfig UINT32 dest UINT32 size UINT32 source void CallBack void Arguments Table 14 Arguments for FlashProgram Argument Description Range SSDConfi Pointer to the SSD The values in this structure are chip dependent P 9 Configuration Structure Please refer to Section 3 3 for more details Destiriation audress tobe Any accessible address aligned on double word Dest programmed in Flash boundary in main array or shadow row memory If size 0 C9OFL OK is returned Size bytes of the Flash Nm a Size It should be multiple of 8 and its combination with dest region to be programmed dne should fall in either main array or shadow r
39. of STMicroelectronics All other names are the property of their respective owners 2014 STMicroelectronics All rights reserved STMicroelectronics group of companies Australia Belgium Brazil Canada China Czech Republic Finland France Germany Hong Kong India Israel Italy Japan Malaysia Malta Morocco Philippines Singapore Spain Sweden Switzerland United Kingdom United States of America www st com 4 DoclD024601 Rev 43 43
40. on It is impossible to erase any Flash block or shadow row when a program or erase operation is already in progress on C90FL module FlashErase returns C90FL ERROR BUSY when trying to do so Similarly once an erasing operation has started on C90FL module it is impossible to run another program or erase operation In addition when FlashErase is running it is unsafe to read the data from the Flash partitions having one or more blocks being erased Otherwise it causes a Read While Write error Assumptions It assumes that the Flash block is initialized using a Flashlnit API User provides the correct ssdconfig parameters to FlashErase as returned by Flashlnit BlankCheck Description The BlankCheck API checks on the specified Flash range in the main array or shadow row for blank state If the blank checking fails the first failing address and the failing data in Flash block are saved Prototype UINT32 BlankCheck PSSD CONFIG pSSDConfig UINT32 dest UINT32 size UINT32 pFailAddress UINT64 pFailData void CallBack void Arguments Table 12 Arguments for BlankCheck Argument Description Range SSDConfi Pointer to the SSD The values in this structure are chip dependent P 9 Configuration Structure Please refer to Section 3 3 for more details Destination address to be Any accessible address aligned on double word dest boundary in main array or shadow row
41. or program in progress on the C90FL module and if the operation can be suspended This function suspends the ongoing operation if it can be suspended Prototype UINT32 FlashSuspend PSSD CONFIG pSSDConfig UINT8 suspendState BOOL suspendFlag Arguments Table 21 Arguments for FlashSuspend Argument Description Range SSDConfi Pointer to the SSD The values in this structure are chip dependent p 9 Configuration Structure Please refer to Section 3 3 for more details Indicate the suspend state suspendState of C90FL module after the All return values are enumerated in Table 24 function being called cur i TRUE the operation is suspended by this call FALSE either no operation to be suspended or the there is any is suspended i by this ae P operation is suspended not by this call suspendFlag Return values Table 22 Return values for FlashSuspend Comments After calling FlashSuspend read is allowed on both main array space and shadow row without any Read While Write error But data read from the blocks targeted for programming or erasing is indeterminate even if the operation is suspended This function should be used together with FlashResume The suspendFlag returned by FlashSuspend determine whether FlashResume needs to be called or not If suspendFlag is TRUE FlashHesume must be called symmetrically to resume the suspended operation
42. ore details Any accessible address aligned on double word boundary in either main array or shadow row If size is 0 and the other parameters are all valid C90FL OK is returned Its combination with dest should fall within either main array or shadow row pSum Returns the sum value 0x00000000 OxFFFFFFFF Note that this value is only valid when the function returns C90FL OK CallBack Address of void call back function pointer Any addressable void function address To disable it use NULL CALLBACK macro Return values Table 20 Return values for CheckSum Return Values C90FL ERROR ALIGNMENT aligned Possible Causes This error indicates that dest size isn t properly Solution Check if dest and size are aligned on double word 64 bit boundary Check if source is aligned on word boundary Check dest and dest size both 4 C90FL ERROR RANGE The area specified by dest and size is out of the valid C90FL address range should fall in the same C90FL address ranges i e both in main array or both in shadow row C90FL OK Successful completion Comments None DoclD024601 Rev 21 43 API specification UM1634 3 6 7 22 43 Assumptions It assumes that the Flash block is initialized using a Flashinit FlashSuspend Description The FlashSuspend API checks if there is any high voltage operation erase
43. ow Source program buffer Source This address must reside on word boundary CallBack Address of void call back Any addressable void function address To disable it function pointer use NULL_CALLBACK macro DoclD024601 Rev 17 43 API specification UM1634 18 43 Return values Return Values C90FL ERROR BUSY C90FL ERROR ALIG NMENT Possible Causes New program operation cannot be performed because the flash module is busy with some operation and cannot meet the condition for starting a program operation This error indicates that dest size source isn t properly aligned Table 15 Return values for FlashProgram Solution Wait until the current operations finish Use ProgramVerify API to find The first address in FLASH which has NOT been programmed as expected in FlashProgram API The first address in SOURCE buffer which has NOT been programmed as expected in FlashProgram API Program the rest of data based the new addresses Conditions that program cannot start are 1 program in progress MCR PGM high 2 program not in progress MCR PGM low but a erase in progress but not suspended Check if dest and size are aligned on double word 64 bit boundary Check if source is aligned on word boundary C90FL ERROR RANG E The area specified by dest and size is out of the valid C90FL address range Check dest and dest size
44. rd boundary C90FL ERROR RANGE The area specified by dest and size is out of the valid C90FL address range Check dest and dest size both should fall in the same C90FL address ranges i e both in main array or both in shadow row C90FL OK C90FL ERROR VERIFY Successful completion Check the correct source and The content in C90FL and destination addresses erase the source data mismatch block and reprogram data into flash Comments The contents pointed by pFailLoc pFailData and pFailSource are updated only when there is a mismatch between the source and destination regions Assumptions It assumes that the Flash block is initialized using a Flashlnit 20 43 DoclD024601 Rev 4 UM1634 API specification 3 6 6 CheckSum Description The CheckSum API performs a 32 bit sum over the specified Flash memory range without carry which provides a rapid method for checking data integrity Prototype UINT32 CheckSum PSSD CONFIG pSSDConfig UINT32 dest UINT32 size UINT32 pSum void CallBack void Arguments Table 19 Arguments for CheckSum Argument pSSDConfig Dest Size Description Pointer to the SSD Configuration Structure Destination address to be summed in Flash memory Size in bytes of the Flash region to check sum Range The values in this structure are chip dependent Please refer to Section 3 3 for m
45. river configuration parameters and configuration macros respectively Section 3 4 and Section 3 5 describe the CallBack notifications and return codes used for the driver Section 3 6 provides the detailed description of standard software Flash Driver APIs Features The C90FL 2 Standard Software Driver SSD provides the following features e Two sets of driver binaries built on Power Architecture instruction set technology and Variable Length Encoding VLE instruction set e Drivers released in binary c array format to provide compiler independent support for non debug mode embedded applications e Each driver function is independent of each other so the end user can choose the function subset to meet their particular needs e Position independent and ROM able e Concurrency support via callback 4 DoclD024601 Rev UM1634 Memory layout 2 Memory layout 2 1 General overview 4 The SPC564Axx microcontrollers has 2 separate flash modules which can be described as set of 2 banks BANKO and BANK1 with separate set of flash registers Figures below demonstrate how physical address of SPC564Axx has been mapped to logical linear memory and same linear mapping has been used to develop the SSD Figure 1 Physical address mapping BANK 0 BANK 1 xx00_0000 LAS 8 X 16K Blocks 2 X 64K Blocks MAS 2 X 128K Blocks xx08 0000 LAS 1 X 256K Blocks MAS 1 X 256K Blocks xx10 0000 C000 C000
46. s structure are chip dependent 9 Configuration Structure Please refer to Section 3 3 for more details Indicating the address space and the protection level of the block lock register to be read blkLockIndicator Refer to Table 30 for valid codes for this parameter Bit mapped value indicating the lock status of the specified protection level and address space 1 The block is locked from program erase 0 The block is ready for program erase The block locks to be set to blkLockState the specified address space and protection level Correct passwords for block lock registers are OxA1A1 1111 for Low Mid Address Space Block Locking Register OxXC3C3 3333 for Secondary Low Mid Address Space Block Locking Register and OxB2B2 2222 for High Address Space Block Select Register A password is required to password enable the block lock register for register write 4 28 43 DoclD024601 Rev UM1634 API specification 3 6 11 4 Return values Table 36 Return values for SetLock Return Values Possible Causes Solution Set this argument to correct value listed in Table 30 The input blkLocklndicator is C90FL ERROR LOCK INDICATOR invalid The given password cannot enable Pass in a correct C90FL ERROR PASSWORD the block lock register for register password writes C90FL OK Successful completion Comments The bit field allocation for b kLock
47. s volatile signed short UINT16 16 bits unsigned short VUINT16 16 bits volatile unsigned short INT32 32 bits signed long VINT32 32 bits volatile signed long UINT32 32 bits unsigned long VUINT32 32 bits volatile unsigned long INT64 64 bits signed long long VINT64 64 bits volatile signed long long UINT64 64 bits unsigned long long VUINT64 64 bits volatile unsigned long long 3 3 Configuration parameters and macros 4 The configuration parameters which are used for SSD operations are explained in this section The configuration parameters are handled as a structure The user should correctly initialize the fields including c90flRegBase mainArrayBase shadowRowBase shadowRowSize pageSize and BDMEnable before passing the structure to the SSD functions The pointer to CallBack has to be initialized either to a null pointer or a valid function pointer DoclD024601 Rev 9 43 API specification UM1634 Note 10 43 Table 3 SSD configuration structure field definition Parameter name Type Parameter description The base address of C90FL and BIU control registers c90flRegBase UINT32 base address mainArrayBase UINT32 The base address of Flash main array base address mainArraySize UINT32 The size of Flash main array The base address of shadow row Base Address of shadow shadowRowBase UINT32 shadow shadowRowSize UINT32 The size of shadow row in byt
48. tates and associated resume codes Table 27 resumeState definitions Code name Value Description RES NOTHING 0 No program erase operation to be resumed RES PGM 1 A program operation is resumed RES ERS 2 A erase operation is resumed RES ERS PGM 3 A suspended erase suspended program operation is resumed Assumptions It assumes that the Flash block is initialized using a Flashlnit 3 6 9 GetLock Description 4 The GetLock API checks the block locking status of Shadow Low Middle High address spaces in the C90FL module Prototype UINT32 GetLock PSSD CONFIG pSSDConfig UINT8 blkLockIndicator BOOL blkLockEnabled UINT32 blkLockState DoclD024601 Rev 25 43 API specification 26 43 UM1634 Arguments Table 28 Arguments for GetLock Argument Description Range pSSDContig Pointer to the SSD The values in this structure are chip dependent Configuration Structure Please refer to Section 3 3 for more details Indicating the address space and the block locking level which determines the address space block locking register to be checked blkLockindicator Refer to Table 30 for valid values for this parameter Indicate whether the address TRUE The address space block locking register is enabled for register writes level in the given address space Return values blkLockEnabled space block locking register is enabled for register writes FALSE
49. tion pointer DoclD024601 Rev Any addressable void function address To disable it use NULL CALLBACK macro 4 UM1634 API specification 4 Return values Table 47 Return values for FactoryMarginReadCheck Return Values Possible Causes Solution The MISR value calculated P9 calculate the MISR values using the correct Data and by the user is incorrect C90FL_ERROR_FMR_MISMATC 2 H The MISR calculated by the Hardware is incorrect Hardware Error Enable any of the blocks using None of the Blocks are variables cun ERROR_FMALNO_BLOC for Factory Margin lowEnabledBlocks Read Check midEnabledBlocks and highEnabledBlock C90FL OK Successful completion Comments The inputs owEnabledBlocks midEnabledBlocks and highEnableaBlocks are bit mapped arguments that are used to select the blocks to be evaluated in the Low Mid High address spaces of main array The selection of the blocks of the main array is determined by setting clearing the corresponding bit in lowEnableaBlocks midEnabledBlocks or highEnableaBlocks The bit allocations for blocks in one address space are bit 0 is assigned to block 0 bit 1 to block 1 etc The following diagrams show the formats of lowEnabledBlocks midEnabledBlocks and highEnabledBlocks for the C90FL module For low address space valid bits are from bit O to bit 9 for middle address space valid bits are bit O
50. ues returned against the Suspend State and the Flash block status Table 24 Suspending state and flag vs C90FL status suspendState EHV ERS ESUS PGM PSUS PEAS suspendFlag NO_OPERATION X 0 X 0 X FALSE PGM WRITE 0 0 X 1 0 X FALSE ERS WRITE 0 1 0 0 X X FALSE ESUS PGM WRITE 0 1 1 1 0 X FALSE 1 0 X 1 0 X TRUE PGM SUS X 0 X 1 1 X FALSE 1 1 0 0 X 0 TRUE ERS SUS X 1 1 0 0 FALSE DoclD024601 Rev 3 23 43 API specification UM1634 Note 3 6 8 24 43 Table 24 Suspending state and flag vs C90FL status continued suspendState EHV ERS ESUS PGM PSUS PEAS suspendFlag 1 1 0 0 X 1 TRUE SHADOW_ERS_SUS X 1 1 0 X 1 FALSE 1 1 1 1 0 TRUE ERS SUS PGM SUS X 1 1 1 1 FALSE The values of EHV ERS ESUS PGM PSUS and PEAS represent the C90FL status at the entry of FlashSuspend 0 Logic zero 1 Logic one X Do not care Since there are two Flash banks in SPC564Axx user can perform following operations in respective blocks Erase can be suspended in any of the LAS blocks from 0 to 9 and program can be performed on block 10 and block11 of LAS or vice versa Erase can be suspended in MAS block 0 and program can be performed in MAS block 1 Or vice versa Erase can be suspended in any of the LAS or MAS blocks and program can be performed in HAS blocks or vice versa LAS and MAS blocks can be programmed or erased s
Download Pdf Manuals
Related Search
Related Contents
Acronis® Backup & Recovery ™ 10 Server for Windows H-3401 SDI Rain Gauge User Guide HP Indigo Labels and Packaging powered by EskoArtwork spimd20 - STMicroelectronics HoMedics HG-1 massager Home Decorators Collection 9003662 Instructions / Assembly Copyright © All rights reserved.
Failed to retrieve file