STMicroelectronics C90LC User Manual

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

1 Introduction

1.1 Document overview

This document is the user manual for the Standard Software Driver (SSD) for C90LC 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 B: Acronyms and Appendix C:
Documentation references list the documents referred and terms used in making of this
document. Appendix B: Acronyms lists the acronyms used.
Section 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. Section 2.4 and Section 2.5 describe the CallBack notifications and return codes for the driver respectively. Section 2.6 and
Section 2.7 provides the detailed description of normal mode and special mode standard
software Flash Driver APIs’ respectively.

1.2 Features

The C90LC SSD provides the following features:
Two sets of driver binaries built with Variable-Length-Encoding (VLE) instruction set.
Three sets of driver binaries built with three different toolchains.
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 debug-
mode/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
UM1627 Rev3 5/38
API specification UM1627

2 API specification

2.1 General overview

The C90LC 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
INT64 64-bits signed long long
VINT64 64-bits volatile signed long long
UINT64 64-bits unsigned long long

Table 1. Type definitions

VUINT64 64-bits volatile unsigned long long

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.
6/38 UM1627 Rev3
UM1627 API specification
Parameter name Type Parameter description
c90flRegBase UINT32 The base address of C90LC and BIU control registers.
mainArrayBase UINT32 The base address of Flash main array.
mainArraySize UINT32 The size of Flash main array.
shadowRowBase UINT32 The base address of shadow row
shadowRowSize UINT32 The size of shadow row in byte.
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 C90LC Flash
BDMEnable UINT32

Table 2. SSD configuration structure field definition

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;

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 C90LC 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.
UM1627 Rev3 7/38
API specification UM1627

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
C90FL_ERROR_SUSP 0x00001000
8/38 UM1627 Rev3
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.
On going high voltage operation cannot be suspended.
UM1627 API specification

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. ‘FlashIni()’ 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 can be
UINT32
returned with a single return code. Each bit in the returned value, except for C90FL_OK, indicates a kind of current status of C90LC module.
Table 5. Return values for FlashInit()
C90FL_OK C90FL_INFO_EER C90FL_INFO_RWE
Troubleshooting
Error codes Possible causes Solution
C90FL_INFO_EER
Table 6. Troubleshooting for FlashInit()
An ECC Error occurred during a previous read.
Clear FLASH_MCR-EER bit.
C90FL_INFO_RWE
A Read While Write Error occurred during a previous read
Clear the FLASH_MCR-RWE bit.
Comments
FlashIni()’ checks the C90FL_MCR_RWE and C90FL_MCR_EER bit, but does not clear
them when any of them is set. If RWE bit is set, Flash program/erase operations can still be performed.
Assumptions
None.
UM1627 Rev3 9/38
API specification UM1627

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.
Prototypse
UINT32 FlahErase (PSSD_CONFIG pSSDConfig,
BOOL shadowFlag,
UINT32 lowEnabledBlocks,
UINT32 midEnabledBlocks,
UINT32 highEnabledBlocks,
void (*CallBack)(void));
Arguments
Argument Description Range
Table 7. 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
10/38 UM1627 Rev3
Address of void call back function pointer.
Any addressable void function address. To disable it use NULL_CALLBACK macro.
UM1627 API specification
Return values
Type Description Possible values
UINT32 Successful completion or error value.
Table 8. Return values for FlashErase()
C90FL_OK C90FL_ERROR_BUSY C90FL_ERROR_EGOOD
Troubleshooting
Error codes Possible causes Solution
C90FL_ERROR_BUSY
Table 9. Troubleshooting for FlashErase()
Wait until all previous program/erase operations on the Flash module finish.
New erase operation cannot be performed because there is program/erase sequence in progress on the Flash module.
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 C90LC is available and
C90FL_ERROR_ EGOOD Erase operation failed.
high voltage is applied to C90LC. 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 give an example of the formats of lowEnabledBlocks,
midEnabledBlocks and highEnabledBlocks for the C90LC module. Refer to Appendix C:
Documentation references for the valid bits configuration depending from the specific
microcontroller Flash module sectors.
MSB LSB
Table 10. Bit allocation for blocks in low address space
bit 31 bit 10 bit 9 bit 8 bit 1 bit 0
reserved reserved block 9 block 8 block 1 block 0
UM1627 Rev3 11/38
API specification UM1627
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 11. Bit allocation for blocks in middle address space
Table 12. 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 C90LC module. ‘FlashErase()’ returns C90FL_ERROR_BUSY
when trying to do so. Similarly, once an erasing operation has started on C90LC 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.

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.
Prototype
UINT32 BlankCheck (PSSD_CONFIG pSSDConfig,
UINT32 dest,
UINT32 size,
UINT32 * pFailAddress,
UINT64 *pFailData,
void (*CallBack) (void ));
12/38 UM1627 Rev3
Loading...
+ 26 hidden pages