STMicroelectronics C90FL User Manual

UM1620
User manual
Standard Software Driver for C90FL Flash module embedded on
SPC56 A line microcontroller
Introduction
This document is the user manual for the Standard Software Driver (SSD) for single C90 Flash module.
The C90FL Standard Software Driver (SSD) provides the following API’s:
FlashInit
FlashErase
BlankCheck
FlashProgram
ProgramVerify
CheckSum
FlashSuspend
FlashResume
GetLock
SetLock
FlashArrayIntegrityCheck
FlashECCLogicCheck
FactoryMarginReadCheck
July 2020 UM1620 Rev 4 1/41
www.st.com
Contents UM1620
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1 Document overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 API specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1 General overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 General type definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Configuration parameters and macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 Callback notification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5 Return codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.6 Normal mode functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.6.1 FlashInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.6.2 FlashErase() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.6.3 BlankCheck() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.6.4 FlashProgram() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.6.5 ProgramVerify() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.6.6 CheckSum() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.6.7 FlashSuspend() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.6.8 FlashResume() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.6.9 GetLock() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.6.10 SetLock() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.7 User test mode functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.7.1 FlashArrayIntegrityCheck() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.7.2 FlashECCLogicCheck() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.7.3 FactoryMarginReadCheck() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Appendix A CallBack timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Appendix B System requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Appendix C Acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Appendix D Document reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2/41 UM1620 Rev 4
UM1620 Contents
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
UM1620 Rev 4 3/41
List of tables UM1620
List of tables
Table 1. Type definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Table 2. SSD configuration structure field definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Table 3. Return codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Table 4. Arguments for FlashInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Table 5. Return values for FlashInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Table 6. Arguments for FlashErase() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Table 7. Return values for FlashErase() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Table 8. Troubleshooting for FlashErase() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Table 9. Bit allocation for blocks in low address space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Table 10. Bit allocation for blocks in middle address space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Table 11. Bit allocation for blocks in high address space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Table 12. Arguments for BlankCheck(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Table 13. Return values for BlankCheck() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Table 14. Troubleshooting for BlankCheck() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Table 15. Arguments for FlashProgram() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Table 16. Return values for FlashProgram() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Table 17. Troubleshooting for FlashProgram() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Table 18. Arguments for ProgramVerify() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Table 19. Return values for ProgramVerify() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Table 20. Troubleshooting for ProgramVerify() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Table 21. Arguments for CheckSum() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Table 22. Return values for CheckSum() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Table 23. Troubleshooting for CheckSum() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Table 24. Arguments for FlashSuspend() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Table 25. Return values for FlashSuspend() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Table 26. suspendState definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Table 27. Suspending state and flag vs. C90FL status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Table 28. Arguments for FlashResume() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Table 29. Return values for FlashResume() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Table 30. resumeState definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
. 24
Table 31. Arguments for GetLock() . . . . . . . . . . . . . . .
Table 32. Return values for GetLock() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Table 33. Troubleshooting for GetLock() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Table 34. blkLockIndicator definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Table 35. blkLockState bit allocation for shadow address space . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Table 36. blkLockState bit allocation for low address space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Table 37. blkLockState bit allocation for mid address space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Table 38. blkLockState bit allocation for high address space. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Table 39. Arguments for SetLock() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Table 40. Return values for SetLock() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Table 41. Troubleshooting for SetLock() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Table 42. Arguments for FlashArrayIntegrityCheck() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Table 43. Return values for FlashArrayIntegrityCheck(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Table 44. Troubleshooting for FlashArrayIntegrityCheck() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Table 45. Bit allocation for blocks in low address space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Table 46. Bit allocation for blocks in middle address space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Table 47. Bit Allocation for Blocks in High Address Space. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Table 48. Arguments for FlashECCLogicCheck(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .
4/41 UM1620 Rev 4
UM1620 List of tables
Table 49. Return values for FlashECCLogicCheck() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Table 50. Troubleshooting for FlashECCLogicCheck() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Table 51. Arguments for FactoryMarginReadCheck() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Table 52. Return values for FactoryMarginReadCheck() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Table 53. Troubleshooting for FactoryMarginReadCheck() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Table 54. Bit allocation for blocks in low address space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Table 55. Bit allocation for blocks in middle address space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Table 56. Bit allocation for blocks in high address space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Table 57. CallBack timings period for SPC564A70 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Table 58. System requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Table 59. Acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Table 60. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
UM1620 Rev 4 5/41
Introduction UM1620

1 Introduction

1.1 Document overview

This document is the user manual for the Standard Software Driver (SSD) for single C90FL Flash module. The road-map for the document is as follows.
Section 1.2 shows the features of the driver. Appendix B: System requirements details the
system requirement for the driver development. Appendix D: Document reference lists the documents referred and terms used in making of this document. Appendix C: Acronyms lists
the acronyms used.
Chapter 2 describes the API specifications. In this section there are many sub sections,
which describe the different aspects of the driver. Section 2.1 provides a general overview of
the driver.
Section 2.2 mentions about the type definitions used for the driver. Section 2.3 mentions the
driver configuration parameters and configuration macros respectively. Section 2.4 and
Section 2.5 describe the CallBack notifications, and return codes used for the driver. Section 2.6 and Section 2.7 provide the detailed description of normal mode and special
mode standard software Flash Driver APIs’ respectively. Appendix A: CallBack timings
provides the performance indexes.

1.2 Features

The C90FL SSD provides the following features:
Two sets of driver binaries built on Power Architecture instruction set technology and
Variable-Length-Encoding (VLE) instruction set.
Drivers released in binary c-array format to provide compiler-independent support for
non-debug-mode embedded applications.
Drivers released in s-record format to provide compiler-independent support for
debugmode/JTAG programming tools.
Each driver function is independent of each other so the end user can choose the
function subset to meet their particular needs.
Support page-wise programming for fast programming.
Position-independent and ROM-able
Ready-to-use demos illustrating the usage of the driver
Concurrency support via callback
6/41 UM1620 Rev 4
UM1620 API specification

2 API specification

2.1 General overview

The C90FL 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. This SSD also provides 3 user test APIs for checking the Array Integrity and the ECC Logic.

2.2 General 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-bits 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

Table 1. Type definitions

2.3 Configuration parameters and macros

The configuration parameter which is used for SSD operations is explained in this section. The configuration parameters are handled as structure. The user should correctly initialize
the fields including c90flRegBase, mainArrayBase, shadowRowBase, shadowRowSize,
pageSize and BDMEnable before passing the structure to SSD functions. The pointer to CallBack has to be initialized either to a null pointer or a valid CallBack function pointer.
Parameter name Type Parameter description
c90flRegBase UINT32 The base address of C90FL and BIU control registers.
mainArrayBase UINT32 The base address of Flash main array.
mainArraySize UINT32 The size of Flash main array in byte.

Table 2. SSD configuration structure field definition

UM1620 Rev 4 7/41
API specification UM1620
Table 2. SSD configuration structure field definition (continued)
Parameter name Type Parameter description
shadowRowBase UINT32 The base address of shadow row
shadowRowSize UINT32 The size of shadow row in byte.
shadowRowSize UINT32 Number of blocks of the large address space (128K or 256K).
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 UINT32 The page size of the C90FL Flash
BDMEnable UINT32
Defines the state of background debug mode (enable /disable)
The type definition for the structure is given below.
typedef struct _ssd_config { UINT32 c90flRegBase; UINT32 mainArrayBase; UINT32 mainArraySize; UINT32 shadowRowBase; UINT32 shadowRowSize; UINT32 lowBlockNum; UINT32 midBlockNum; UINT32 highBlockNum; UINT32 pageSize; UINT32 BDMEnable; } SSD_CONFIG, *PSSD_CONFIG;
Note: The macro value COMPILER_SELECT should be set to
CODE_WARRIOR – if CodeWarrior compiler is used for compiling DIAB_COMPILER – if Diab compiler is used for compiling

2.4 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 it is not necessary to provide the CallBack service, the user is able to disable it by a NULL function macro.
#define NULL_CALLBACK ((void *) 0xFFFFFFFF)
The job processing callback notifications shall have no parameters and no return value.
8/41 UM1620 Rev 4
UM1620 API specification

2.5 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:
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.
C90FL_ERROR_BUSY 0x00000300
C90FL_ERROR_PGOOD 0x00000400 The program operation is unsuccessful.
C90FL_ERROR_EGOOD 0x00000500 The erase operation is unsuccessful.
C90FL_ERROR_NOT_BLANK 0x00000600
C90FL_ERROR_VERIFY 0x00000700
C90FL_ERROR_LOCK_INDICATOR 0x00000800 Invalid block lock indicator.
C90FL_ERROR_RWE 0x00000900
C90FL_ERROR_PASSWORD 0x00000A00

Table 3. Return codes

New program/erase cannot be preformed while a high voltage operation is already in progress.
There is a non-blank Flash memory location within the checked Flash memory region.
There is a mismatch between the source data and the content in the checked Flash memory.
Read-while-write error occurred in previous reads.
The password provided cannot unlock the block lock register for register writes
C90FL_ERROR_AIC_MISMATCH 0x00000B00
C90FL_ERROR_AIC_NO_BLOCK 0x00000C00
C90FL_ERROR_FMR_MISMATCH 0x00000D00
C90FL_ERROR_FMR_NO_BLOCK 0x00000E00
C90FL_ERROR_ECC_LOGIC 0x00000F00
UM1620 Rev 4 9/41
In ‘FlashArrayIntegrityCheck()’ the MISR
values generated by the hardware do not match the values passed by the user.
In ‘FlashArrayIntegrityCheck()’ no blocks
have been enabled for Array Integrity check
In ‘FactoryMarginReadCheck()’ the MISR
values generated by the hardware do not match the values passed by the user.
In ‘FactoryMarginReadCheck()’ no blocks
have been enabled for Array Integrity check
In ‘FlashECCLogicCheck()’ the simulated
ECC error has not occurred.
API specification UM1620

2.6 Normal mode functions

2.6.1 FlashInit()

Description
This function reads the Flash configuration information from the Flash control registers and
initialize parameters in SSD configuration structure. ‘FlashInit()’ must be called prior to any
other Flash operations.
Prototype
UINT32 FlashInit (PSSD_CONFIG pSSDConfig);
Arguments
Argument Description Range
pSSDConfig
Pointer to the SSD Configuration Structure.
Table 4. Arguments for FlashInit()
The values in this structure are chip-dependent.
Please refer to Section 2.3 for more details.
Return values
Type Description Possible values
Indicates either success or failure type. It is a bit mapped return code so that more than one condition
UINT32
can be returned with a single return code. Each bit in the returned value, except for C90FL_OK, indicates a kind of current status of C90FL module.
Table 5. Return values for FlashInit()
C90FL_OK C90FL_INFO_EER C90FL_INFO_RWE
Troubleshooting
None.
Comments
‘FlashInit()’ checks the C90FL_MCR_RWE and C90FL_MCR_EER bit, and clear them
when any of them is set. If RWE bit is set, Flash program/erase operations can still be performed.
Assumptions
The user must correctly initialize the fields including c90flRegBase, mainArrayBase, shadowRowBase, shadowRowSize, pageSize and BDMEnable before passing the structure
to the FlashInit() functions
10/41 UM1620 Rev 4
.
UM1620 API specification

2.6.2 FlashErase()

Description
This function 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, BOOL shadowFlag, UINT32 lowEnabledBlocks, UINT32 midEnabledBlocks, UINT32 highEnabledBlocks, void (*CallBack)(void));
Arguments
Argument Description Range
Table 6. Arguments for FlashErase()
pSSDConfig
shadowFlag
lowEnabledBlocks
midEnabledBlocks
highEnabledBlocks
Pointer to the SSD Configuration Structure.
Indicate either the main array or the shadow row to be erased.
To select the array blocks in low address space for erasing.
To select the array blocks in mid address space for erasing.
To select the array blocks in high address space for erasing.
The values in this structure are chip-dependent.
Please refer to Section 2.3 for more details.
TRUE: the shadow row is erased. The
lowEnabledBlocks, midEnabledBlocks and highEnabledBlocks are ignored;
FALSE: The main array is erased. Which blocks are erased in low, mid and high address spaces are
specified by lowEnabledBlocks, midEnabledBlocks and highEnabledBlocks respectively.
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.
Bit-mapped value. Select the block in the middle address space to be erased by setting 1 to the
appropriate bit of midEnabledBlocks. If there is not
any block to be erased in the middle address space,
midEnabledBlocks must be set to 0.
Bit-mapped value. Select the block in the high address space to be erased by setting 1 to the
appropriate bit of highEnabledBlocks. If there is not
any block to be erased in the high address space,
highEnabledBlocks must be set to 0.
CallBack
Address of void call back function pointer.
UM1620 Rev 4 11/41
Any addressable void function address. To disable it use NULL_CALLBACK macro.
API specification UM1620
Return values
Type Description Possible values
UINT32 Successful completion or error value.
Table 7. Return values for FlashErase()
C90FL_OK C90FL_ERROR_BUSY C90FL_ERROR_EGOOD
Troubleshooting
Error codes Possible causes Solution
C90FL_ERROR_BUSY
C90FL_ERROR_ EGOOD Erase operation failed.
Table 8. Troubleshooting for FlashErase()
Wait until all previous program/erase operations on the
New erase operation cannot be performed because there is program/erase sequence in progress on the Flash module.
Flash module finish. Possible cases that erase cannot
start are: – erase in progress
(FLASH_MCR-ERS is high);
– program in progress
(FLASH_MCR-PGM is high);
Check if the C90FL is available and high voltage is applied to C90FL. Then try to do the erase operation again.
Comments
When shadowFlag is set to FALSE, 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 TRUE, this function erases the shadow row. The inputs lowEnabledBlocks, midEnabledBlocks and highEnabledBlocks 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 the blocks of the main array is determined by
setting/clearing the corresponding bit in lowEnabledBlocks, midEnabledBlocks or highEnabledBlocks.
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 0 to bit (lowBlockNum – 1). In which, lowBlockNum is the number of low blocks returned from FlashInit();
For middle address space valid bits are from bit 0 and bit (midBlockNum – 1). In which, midBlockNum is the number of middle blocks returned from FlashInit();
For high address space valid bits are from bit 0 to bit (highBlockNum – 1). In which, highBlockNum is the number of high blocks returned from FlashInit();
12/41 UM1620 Rev 4
UM1620 API specification
For example, below are bit allocations for blocks in Low/Mid/High Address Space of SPC564A70:
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 9. Bit allocation for blocks in low address space
MSB LSB
bit 31 bit 4 bit 3 bit 2 bit 1 bit 0
reserved reserved reserved reserved block 1 block 0
MSB LSB
bit 31 bit 6 bit 5 bit 4 bit 1 bit 0
reserved reserved block 5 block 4 Block 1 Block 0
Table 10. Bit allocation for blocks in middle address space
Table 11. Bit allocation for blocks in high address space
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()’ function.
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
module 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 ‘FlashInit()’ API. User provides the
correct ssdconfig parameters to FlashErase() as returned by FlashInit().

2.6.3 BlankCheck()

Description
This function 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.
UM1620 Rev 4 13/41
Loading...
+ 28 hidden pages