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 SSD is a set of API’s that enables user application to operate on the Flash module
embedded on a microcontroller. The C90FL SSD contains a set of functions to
program/erase a single C90FL Flash module.
The C90FL Standard Software Driver (SSD) provides the following API’s:
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.2shows the features of the driver. Appendix B: System requirementsdetails the
system requirement for the driver development. Appendix D: Document referencelists the
documents referred and terms used in making of this document. Appendix C: Acronymslists
the acronyms used.
Chapter 2describes 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.2mentions 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
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/41UM1620 Rev 4
UM1620API 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 typeSizeC language type description
BOOL8-bitsunsigned char
INT88-bitssigned char
VINT88-bitsvolatile signed char
UINT88-bitsunsigned char
VUINT88-bitsvolatile unsigned char
INT1616-bitssigned short
VINT1616-bitsvolatile signed short
UINT1616-bitsunsigned short
VUINT1616-bitsvolatile unsigned short
INT3232-bitssigned long
VINT3232-bitsvolatile signed long
UINT3232-bitsunsigned long
VUINT3232-bitsvolatile 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 nameTypeParameter description
c90flRegBaseUINT32The base address of C90FL and BIU control registers.
mainArrayBaseUINT32The base address of Flash main array.
mainArraySizeUINT32The size of Flash main array in byte.
Table 2. SSD configuration structure field definition
UM1620 Rev 47/41
API specificationUM1620
Table 2. SSD configuration structure field definition (continued)
Parameter nameTypeParameter description
shadowRowBaseUINT32The base address of shadow row
shadowRowSizeUINT32The size of shadow row in byte.
shadowRowSizeUINT32Number of blocks of the large address space (128K or 256K).
lowBlockNumUINT32Block number of the low address space.
midBlockNumUINT32Block number of the mid address space.
highBlockNumUINT32Block number of the high address space.
pageSizeUINT32The page size of the C90FL Flash
BDMEnableUINT32
Defines the state of background debug mode (enable
/disable)
The type definition for the structure is given below.
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/41UM1620 Rev 4
UM1620API 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:
NameValueDescription
C90FL_OK0x00000000The requested operation is successful.
C90FL_INFO_RWE 0x00000001RWE bit is set before Flash operations.
C90FL_INFO_EER0x00000002EER bit is set before Flash operations.
C90FL_ERROR_ALIGNMENT0x00000100Alignment error.
C90FL_ERROR_RANGE0x00000200Address range error.
C90FL_ERROR_BUSY0x00000300
C90FL_ERROR_PGOOD0x00000400The program operation is unsuccessful.
C90FL_ERROR_EGOOD0x00000500The erase operation is unsuccessful.
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_MISMATCH0x00000B00
C90FL_ERROR_AIC_NO_BLOCK0x00000C00
C90FL_ERROR_FMR_MISMATCH0x00000D00
C90FL_ERROR_FMR_NO_BLOCK0x00000E00
C90FL_ERROR_ECC_LOGIC0x00000F00
UM1620 Rev 49/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 specificationUM1620
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
ArgumentDescriptionRange
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
TypeDescriptionPossible 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/41UM1620 Rev 4
.
UM1620API 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.
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 411/41
Any addressable void function address. To disable it
use NULL_CALLBACK macro.
API specificationUM1620
Return values
TypeDescriptionPossible values
UINT32Successful completion or error value.
Table 7. Return values for FlashErase()
C90FL_OK
C90FL_ERROR_BUSY
C90FL_ERROR_EGOOD
Troubleshooting
Error codesPossible causesSolution
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/41UM1620 Rev 4
UM1620API specification
For example, below are bit allocations for blocks in Low/Mid/High Address Space of
SPC564A70:
MSBLSB
bit 31…bit 10bit 9bit 8…bit 1bit 0
reserved…reservedblock 9block 8…block 1block 0
Table 9. Bit allocation for blocks in low address space
MSBLSB
bit 31…bit 4bit 3bit 2bit 1bit 0
reserved…reservedreservedreservedblock 1block 0
MSBLSB
bit 31…bit 6bit 5bit 4…bit 1bit 0
reserved…reservedblock 5block 4…Block 1Block 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.
If the blank checking fails, the first failing address is saved to *pFailAddress, 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 ‘FlashInit()’ API.
2.6.4 FlashProgram()
Description
This function 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.
The dest/size are not
properly aligned.
The area specified by dest
and size is out of the valid
C90FL array ranges.
There is a non-blank
double word within the
area to be checked.
Check if dest and size are aligned on
double word (64-bit) boundary.
Check dest and dest+size. The area
to be checked must be within main
array space or shadow space.
Wait until the current operations finish.
Conditions that program cannot start
C90FL_ERROR_BUSY
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.
are:
1. program in progress (MCR-PGM
high);
2. program not in progress (MCR-PGM
low), but:
– erase in progress but not suspended;
– erase on main array is suspended but
program is targeted to shadow row;
– erase on shadow row is suspended.
C90FL_ERROR_ALIGNMENT
C90FL_ERROR_RANGE
C90FL_ERROR_PGOOD
This error indicates that
dest/size/source isn’t
properly aligned
The area specified by
dest and size is out of th e
valid C90FL address
range.
Program operation failed
because this operation
cannot pass PEG check.
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 should
fall in the same C90FL address ranges,
i.e. both in main array or both in shadow
row
Repeat the program operation. Check if
the C90FL is invalid or high voltage
applied to C90FL is unsuitable.
16/41UM1620 Rev 4
UM1620API specification
Comments
If the selected main array blocks or the shadow row is locked for programming, those blocks
or the shadow row are not programmed, and ‘FlashProgram()’ still returns C90FL_OK. 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. The user has begun an erase operation on the main array or
shadow row, it may be suspended to program on both main array and shadow row.
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.
Assumptions
It assumes that the Flash block is initialized using a ‘FlashInit()’ API.
2.6.5 ProgramVerify()
Description
This function 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.
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.
0x00000000 - 0xFFFFFFFF. Note that this value is
only valid when the function returns C90FL_OK.
Any addressable void function address. To disable it
use NULL_CALLBACK macro.
Return values
TypeDescriptionPossible values
UINT32Successful completion or error value.
Table 22. Return values for CheckSum()
C90FL_OK
C90FL_ERROR_ALIGNMENT
C90FL_ERROR_RANGE
UM1620 Rev 419/41
API specificationUM1620
Troubleshooting
Returned error bits DescriptionSolution
Table 23. Troubleshooting for CheckSum()
C90FL_ERROR_ALIGNMENT
C90FL_ERROR_RANGE
Comments
None.
Assumptions
It assumes that the Flash block is initialized using a ‘FlashInit()’ API
2.6.7 FlashSuspend()
Description
This function checks if there is any high voltage operation, erase 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
This error indicates that
dest/size isn’t properly
aligned.
The area specified by
dest and size is out of
the valid C90FL address
range.
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 should
fall in the same C90FL address ranges,
i.e. both in main array or both in shadow
row.
Indicate the suspend state
of C90FL module after the
function being called.
Return whether the
suspended operation, if
there is any, is suspended
by this call.
The values in this structure are chip-dependent.
Please refer to Section 2.3 for more details.
All return values are enumerated inTable 27.
TRUE: the operation is suspended by this call;
FALSE: either no operation to be suspended or the
operation is suspended not by this call.
20/41UM1620 Rev 4
UM1620API specification
Return values
TypeDescriptionPossible values
UINT32Successful completion.C90FL_OK
Table 25. Return values for FlashSuspend()
Troubleshooting
None.
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, ‘FlashResume()’ must be called symmetrically to resume the
suspended operation.
Following table defines and describes various suspend states and associated suspend
codes.
ArgumentCodeDescriptionValid operation after suspend
NO_OPERTION0
PGM_WRITE1
ERS_WRITE2
ERS_SUS_PGM_WRITE3
PGM_SUS4
ERS_SUS5
Table 26. suspendState definitions
Erasing operation, programming
There is no program/erase
operation.
There is a program
sequence in interlock write
stage.
There is an erase sequence
in interlock write stage.
There is an erase-suspend
program sequence in
interlock write stage.
The program operation is in
suspended state.
The erase operation on
main array is in suspended
state.
operation and read are valid on
both main array space and
shadow row.
Only read is valid on both main
array space and shadow row.
Only read is valid on both main
array space and shadow row.
Only read is valid on both main
array space and shadow row.
Only read is valid on both main
array space and shadow row.
Programming operation is valid
only on main array space. Read
is valid on both main array space
and shadow row.
UM1620 Rev 421/41
API specificationUM1620
Table 26. suspendState definitions (continued)
ArgumentCodeDescriptionValid operation after suspend
SHADOW_ERS_SUS6
ERS_SUS_PGM_SUS7
The erase operation on
shadow row is in suspended
state.
The erase-suspended
program operation is in
suspended state.
Read is valid on both main array
space and shadow space.
Only read is valid on both main
array space and shadow row.
The table below lists the Suspend Flag values returned against the Suspend State and the
Flash block status.
suspendStateEHVERS ESUSPGMPSUSPEASsuspendFlag
NO_OPERATIONX0X0XXFALSE
PGM_WRITE00X10XFALSE
ERS_WRITE0100XXFALSE
ESUS_PGM_WRITE01110XFALSE
PGM_SUS
ERS_SUS
SHADOW_ERS_SUS
Table 27. Suspending state and flag vs. C90FL status
10X10XTRUE
X0 X 1 1 XFALSE
1100X0TRUE
X1 1 0 X 0FALSE
1100X1TRUE
X1 1 0 X 1FALSE
ERS_SUS_PGM_SUS
11110XTRUE
X1 1 1 1 XFALSE
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
.
Assumptions
It assumes that the Flash block is initialized using a ‘FlashInit()’ API.
2.6.8 FlashResume()
Description
This function checks if there is any suspended erase or program operation on the C90FL
module, and resumes the suspended operation if there is any.
Indicate the resume state of
C90FL module after the
function being called.
The values in this structure are chip-dependent.
Please refer to Section 2.3 for more details.
All return values are listed in Table 29.
Return values
TypeDescriptionPossible values
UINT32Successful completion.C90FL_OK
Table 29. Return values for FlashResume()
Troubleshooting
None.
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 states and associated resume codes.
Code nameValueDescription
RES_NOTHING0No program/erase operation to be resumed
RES_PGM1A program operation is resumed
RES_ERS2A erase operation is resumed
RES_ERS_PGM3
Table 30. resumeState definitions
A suspended erase-suspended program operation is
resumed
Assumptions
It assumes that the Flash block is initialized using a ‘FlashInit()’ API.
UM1620 Rev 423/41
API specificationUM1620
2.6.9 GetLock()
Description
This function checks the block locking status of Shadow/Low/Middle/High address spaces in
the C90FL module.
and the block locking level,
which determines the address
space block locking register
Refer to Table 34 for valid values for this
parameter.
to be checked.
TRUE – The address space block locking register
is enabled for register writes.
FALSE – The address space block locking
register is disabled for register writes.
Bit mapped value indicating the locking status of
the specified locking level and address space.
1: The block is locked from program/erase.
0: The block is ready for program/erase
blkLockEnabled
blkLockState
Indicate whether the address
space block locking register is
enabled for register writes
Returns the blocks’ locking
status of indicated locking
level in the given address
space
Return values
Table 32. Return values for GetLock()
TypeDescriptionPossible values
UINT32Successful completion or error value.
Troubleshooting
Returned error bits Possible causesSolution
C90FL_ERROR_LOCK_INDICATOR
24/41UM1620 Rev 4
Table 33. Troubleshooting for GetLock()
The input blkLockIndicator
is invalid.
C90FL_OK
C90FL_ERROR_LOCK_INDICATOR
Set this argument to correct
value listed in Table 34.
UM1620API specification
Comments
Following table defines and describes various blkLockIndicator values.
Code NameValueDescription
LOCK_SHADOW_PRIMARY0Primary block lock protection of shadow address space
LOCK_SHADOW_SECONDARY1
LOCK_LOW_PRIMARY2Primary block lock protection of low address space
LOCK_LOW_SECONDARY3Secondary block lock protection of low address space
LOCK_MID_PRIMARY4Primary block lock protection of mid address space
LOCK_MID_SECONDARY5Secondary block lock protection of mid address space
LOCK_HIGH6Block 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.
Table 34. blkLockIndicator definitions
Secondary block lock protection of shadow address
space
The output parameter blkLockState 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 program/erase if its corresponding bit is set.
The indicated address space determines the valid bits of blkLockState. The following
diagrams show the block bitmap definitions of blkLockState for shadow/Low/Mid/High
address spaces.
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();
For shadow row valid bit is bit 0;
For example, below are bit allocations for blocks in Low/Mid/High Address Space of
SPC564A70:
MSBLSB
bit 31…bit 1bit 0
reserved …reservedshadow row
Table 35. blkLockState bit allocation for shadow address space
UM1620 Rev 425/41
API specificationUM1620
Table 36. blkLockState bit allocation for low address space
MSBLSB
bit 31…bit 10bit 9bit 8…bit 1bit 0
reserved…reservedblock 9block 8…block 1block 0
Table 37. blkLockState bit allocation for mid address space
MSBLSB
bit 31…bit 4bit 3bit 2bit 1bit 0
reserved…reserved reserved reservedblock 1block 0
Table 38. blkLockState bit allocation for high address space
MSBLSB
bit 31…bit 6bit 5bit 4…bit 1bit 0
reserved…reservedblock 5block 4…block 1block 0
Assumptions
It assumes that the Flash block is initialized using a ‘FlashInit()’ API.
2.6.10 SetLock()
Description
This function 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.
The troubleshooting mentioned below comprises of hardware errors due to both P Flash
block erase verify and P Flash section erase verify command. Apart from these the input
based error handling is also mentioned.
Returned error bits Possible causesSolution
C90FL_ERROR_LOCK_INDICATOR
C90FL_ERROR_PASSWORD
Table 41. Troubleshooting for SetLock()
The input blkLockIndicator
is invalid.
The given password cannot
enable the block lock
register for register writes.
Set this argument to correct
value listed in Table 34.
Pass in a correct password.
Comments
The bit field allocation for blkLockState is same as that in ‘GetLock()’ function.
UM1620 Rev 427/41
API specificationUM1620
Assumptions
It assumes that the Flash block is initialized using a ‘FlashInit()’ API.
2.7 User test mode functions
2.7.1 FlashArrayIntegrityCheck()
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.
The trouble shooting given here comprises of hardware errors and input parameter error.
Returned error bits Possible causesSolution
C90FL_ERROR_AIC_MISMATCH
C90FL_ERROR_AIC_NO_BLOCK
Table 44. Troubleshooting for FlashArrayIntegrityCheck()
The MISR value calculated
by the user is incorrect.
The MISR calculated by the
Hardware is incorrect.
None of the Blocks are
enabled for Array Integrity
Check
Re-calculate the MISR values
using the correct Data and
addrSeq.
Hardware Error.
Enable any of the blocks using
variables lowEnabledBlocks,
midEnabledBlocks and
highEnabledBlock.
Comments
The inputs lowEnabledBlocks, midEnabledBlocks and highEnabledBlocks are bit-mapped
arguments that are used to select the blocks to be evaluated in the Low/Mid/High address
UM1620 Rev 429/41
API specificationUM1620
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();
For example, below are bit allocations for blocks in Low/Mid/High Address Space of
SPC564A70:
MSBLSB
bit 31…bit 10bit 9bit 8…bit 1bit 0
Table 45. Bit allocation for blocks in low address space
reserved…reservedblock 9block 8…block 1block 0
MSBLSB
bit 31…bit 4bit 3bit 2bit 1bit 0
reserved…reservedreservedreservedblock 1block 0
MSBLSB
bit 31…bit 6bit 5bit 4…bit 1bit 0
reserved…reservedblock 5block 4…Block 1Block 0
Table 46. Bit allocation for blocks in middle address space
Table 47. Bit Allocation for Blocks in High Address Space
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 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 ‘FlashInit()’ API.
30/41UM1620 Rev 4
UM1620API specification
2.7.2 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_ECC_LOGIC is returned.
The 64 bits of data for which
the ECC is calculated. The
bits of dataValue are flipped
to generate single or double
bit faults.
Is a 64-bit mask of the bits
at which the user intends to
inject error.
It’s a 32 bit value which has
to be passed by user. This
is calculated ny using an
offline ECC Calculator.
The values in this structure are chip-dependent.
Please refer to Section 2.3 for more details.
Any 64-bit value.
Any 64-bit value, except zero.
This is a corresponding ECC value for the data
value passed by the user.
Note: Same data words should be used in off line
ECC calculator and Flash ECC logic check API.
Return values
TypeDescriptionPossible values
Table 49. Return values for FlashECCLogicCheck()
UINT32Successful completion or error value.
C90FL_OK
C90FL_ERROR_ECC_LOGIC
Troubleshooting
The trouble shooting given here comprises of hardware errors and input parameter error.
UM1620 Rev 431/41
API specificationUM1620
Returned error bits Possible causesSolution
C90FL_ERROR_ECC_LOGIC
Table 50. Troubleshooting for FlashECCLogicCheck()
The ECC value calculated by
the user is incorrect.
Hardware Failure.Hardware error.
Comments
Depending on the errBits value, a single or double bit faults are simulated. When a Flash
read is done, if the simulated error has not occurred, then the API returns the error code
C90FL_ERROR_ECC_LOGIC.
Assumptions
It assumes that the Flash block is initialized using a ‘FlashInit()’ API.
2.7.3 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.
Re-calculate the ECC values
using the correct Data.
The trouble shooting given here comprises of hardware errors and input parameter error.
UM1620 Rev 433/41
API specificationUM1620
C90FL_ERROR_FMR_MISMATCH
C90FL_ERROR_FMR_NO_BLOCK
Table 53. Troubleshooting for FactoryMarginReadCheck()
Returned error bits Possible causesSolution
The MISR value
calculated by the user is
incorrect.
The MISR calculated by
the Hardware is incorrect.
None of the Blocks are
enabled for Factory
Margin Read Check
Re-calculate the MISR values
using the correct Data and
address.
Hardware Error.
Enable any of the blocks using
variables lowEnabledBlocks,
midEnabledBlocks and
highEnabledBlock.
Comments
The inputs lowEnabledBlocks, 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 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();
For example, below are bit allocations for blocks in Low/Mid/High Address Space of
SPC564A70:
MSBLSB
bit 31…bit 10bit 9bit 8…bit 1bit 0
reserved…reservedblock 9block 8…block 1block 0
MSBLSB
bit 31…bit 4bit 3bit 2bit 1bit 0
reserved…reservedreservedreservedblock 1block 0
Table 54. Bit allocation for blocks in low address space
Table 55. Bit allocation for blocks in middle address space
34/41UM1620 Rev 4
UM1620API specification
MSBLSB
bit 31…bit 6bit 5bit 4…bit 1bit 0
reserved…reservedblock 5block 4…Block 1Block 0
Table 56. Bit allocation for blocks in high address space
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 ‘FlashInit()’ API.
Note:Callback time period for ‘CheckSum()’ is measured with CALLBACK_CS (CallBack function
period for checksum)
Callback time period for ‘ProgramVerify()’ is measured with CALLBACK_PV (CallBack
function period for program verify)
Callback time period for ‘BlankCheck()’ is measured with CALLBACK_BC (CallBack
function period for program verify)
36/41UM1620 Rev 4
UM1620System requirements
Appendix B System requirements
The C90FL SSD is designed to support a single C90FL Flash module embedded on
microcontrollers. Before using this SSD on a different derivative microcontroller, user has to
provide the information specific to the derivative through a configuration structure.
Tool nameDescriptionVersion number
CodeWarrior IDEDevelopment tool2.7
Diab PowerPC compilerCompiler5.7.0.0
GreenHillsDevelopment tool6.1.4
P/EDebugger
Table 58. System requirements
UM1620 Rev 437/41
AcronymsUM1620
Appendix C Acronyms
AbbreviationComplete name
APIApplication Programming Interface
BIUBus Interface Unit
ECCError Correction Code
EVBEvaluation Board
RWWRead While Write
SSDStandard Software Driver
Table 59. Acronyms
38/41UM1620 Rev 4
UM1620Document reference
Appendix D Document reference
1.SPC564A70B4, SPC564A70L7 32-bit MCU family built on the embedded Power
Architecture
®
(RM0068, Doc ID 18132)
UM1620 Rev 439/41
Revision historyUM1620
Revision history
DateRevisionChanges
18-Mar-20131Initial release.
02-May-20132
18-Sep-20133Updated Disclaimer.
13-Jul-20204Updated title.
Table 60. Document revision history
Removed Table: CallBack timings period for SPC56EL60x,
SPC56XL70xx
Updated Appendix D: Document reference
40/41UM1620 Rev 4
UM1620
IMPORTANT NOTICE – PLEASE READ CAREFULLY
STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and
improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on
ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order
acknowledgement.
Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or
the design of Purchasers’ products.
No license, express or implied, to any intellectual property right is granted by ST herein.
Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.
ST and the ST logo are trademarks of ST. For additional information about ST trademarks, please refer to www.st.com/trademarks. All other
product or service names are the property of their respective owners.
Information in this document supersedes and replaces information previously supplied in any prior versions of this document.