S32 SDK
Flash Memory (Flash)

Detailed Description

This section describes the programming interface of the Flash Peripheral Driver.

Data Structures

struct  flash_user_config_t
 Flash User Configuration Structure. More...
 
struct  flash_ssd_config_t
 Flash SSD Configuration Structure. More...
 
struct  flash_eeprom_status_t
 EEPROM status structure. More...
 

Macros

#define CLEAR_FTFx_FSTAT_ERROR_BITS   FTFx_FSTAT = (uint8_t)(FTFx_FSTAT_FPVIOL_MASK | FTFx_FSTAT_ACCERR_MASK | FTFx_FSTAT_RDCOLERR_MASK)
 
#define FTFx_WORD_SIZE   0x0002U
 
#define FTFx_LONGWORD_SIZE   0x0004U
 
#define FTFx_PHRASE_SIZE   0x0008U
 
#define FTFx_DPHRASE_SIZE   0x0010U
 
#define FTFx_RSRC_CODE_REG   FTFx_FCCOB8
 
#define FTFx_VERIFY_BLOCK   0x00U
 
#define FTFx_VERIFY_SECTION   0x01U
 
#define FTFx_PROGRAM_CHECK   0x02U
 
#define FTFx_READ_RESOURCE   0x03U
 
#define FTFx_PROGRAM_LONGWORD   0x06U
 
#define FTFx_PROGRAM_PHRASE   0x07U
 
#define FTFx_ERASE_BLOCK   0x08U
 
#define FTFx_ERASE_SECTOR   0x09U
 
#define FTFx_PROGRAM_SECTION   0x0BU
 
#define FTFx_VERIFY_ALL_BLOCK   0x40U
 
#define FTFx_READ_ONCE   0x41U
 
#define FTFx_PROGRAM_ONCE   0x43U
 
#define FTFx_ERASE_ALL_BLOCK   0x44U
 
#define FTFx_SECURITY_BY_PASS   0x45U
 
#define FTFx_PFLASH_SWAP   0x46U
 
#define FTFx_ERASE_ALL_BLOCK_UNSECURE   0x49U
 
#define FTFx_PROGRAM_PARTITION   0x80U
 
#define FTFx_SET_EERAM   0x81U
 
#define RESUME_WAIT_CNT   0x20U
 Resume wait count used in FLASH_DRV_EraseResume function. More...
 
#define SUSPEND_WAIT_CNT   0x40U
 Suspend wait count used in FLASH_DRV_EraseSuspend function. More...
 
#define DFLASH_IFR_READRESOURCE_ADDRESS   0x8000FCU
 
#define GET_BIT_0_7(value)    ((uint8_t)(((uint32_t)(value)) & 0xFFU))
 
#define GET_BIT_8_15(value)   ((uint8_t)((((uint32_t)(value)) >> 8) & 0xFFU))
 
#define GET_BIT_16_23(value)   ((uint8_t)((((uint32_t)(value)) >> 16) & 0xFFU))
 
#define GET_BIT_24_31(value)   ((uint8_t)(((uint32_t)(value)) >> 24))
 
#define FLASH_SECURITY_STATE_KEYEN   0x80U
 
#define FLASH_SECURITY_STATE_UNSECURED   0x02U
 
#define CSE_KEY_SIZE_CODE_MAX   0x03U
 
#define FLASH_CALLBACK_CS   0x0AU
 Callback period count for FlashCheckSum. More...
 

Typedefs

typedef void(* flash_callback_t) (void)
 Call back function pointer data type. More...
 

Enumerations

enum  flash_flexRam_function_control_code_t {
  EEE_ENABLE = 0x00U, EEE_QUICK_WRITE = 0x55U, EEE_STATUS_QUERY = 0x77U, EEE_COMPLETE_INTERRUPT_QUICK_WRITE = 0xAAU,
  EEE_DISABLE = 0xFFU
}
 FlexRAM Function control Code. More...
 

Variables

uint32_t PFlashBase
 
uint32_t PFlashSize
 
uint32_t DFlashBase
 
uint32_t EERAMBase
 
flash_callback_t CallBack
 
uint32_t PFlashBase
 
uint32_t PFlashSize
 
uint32_t DFlashBase
 
uint32_t DFlashSize
 
uint32_t EERAMBase
 
uint32_t EEESize
 
flash_callback_t CallBack
 
uint8_t brownOutCode
 
uint16_t numOfRecordReqMaintain
 
uint16_t sectorEraseCount
 

PFlash swap control codes

#define FTFx_SWAP_SET_INDICATOR_ADDR   0x01U
 Initialize Swap System control code. More...
 
#define FTFx_SWAP_SET_IN_PREPARE   0x02U
 Set Swap in Update State. More...
 
#define FTFx_SWAP_SET_IN_COMPLETE   0x04U
 Set Swap in Complete State. More...
 
#define FTFx_SWAP_REPORT_STATUS   0x08U
 Report Swap Status. More...
 

PFlash swap states

#define FTFx_SWAP_UNINIT   0x00U
 Uninitialized swap mode. More...
 
#define FTFx_SWAP_READY   0x01U
 Ready swap mode. More...
 
#define FTFx_SWAP_UPDATE   0x02U
 Update swap mode. More...
 
#define FTFx_SWAP_UPDATE_ERASED   0x03U
 Update-Erased swap mode. More...
 
#define FTFx_SWAP_COMPLETE   0x04U
 Complete swap mode. More...
 

Flash security status

#define FLASH_NOT_SECURE   0x01U
 Flash currently not in secure state. More...
 
#define FLASH_SECURE_BACKDOOR_ENABLED   0x02U
 Flash is secured and backdoor key access enabled. More...
 
#define FLASH_SECURE_BACKDOOR_DISABLED   0x04U
 Flash is secured and backdoor key access disabled. More...
 

Null Callback function definition

#define NULL_CALLBACK   ((flash_callback_t)0xFFFFFFFFU)
 Null callback. More...
 

Flash driver APIs

status_t FLASH_DRV_Init (const flash_user_config_t *const pUserConf, flash_ssd_config_t *const pSSDConfig)
 Initializes Flash. More...
 
void FLASH_DRV_GetPFlashProtection (uint32_t *protectStatus)
 P-Flash get protection. More...
 
status_t FLASH_DRV_SetPFlashProtection (uint32_t protectStatus)
 P-Flash set protection. More...
 
void FLASH_DRV_GetSecurityState (uint8_t *securityState)
 Flash get security state. More...
 
status_t FLASH_DRV_SecurityBypass (const flash_ssd_config_t *pSSDConfig, const uint8_t *keyBuffer)
 Flash security bypass. More...
 
status_t FLASH_DRV_EraseAllBlock (const flash_ssd_config_t *pSSDConfig)
 Flash erase all blocks. More...
 
status_t FLASH_DRV_VerifyAllBlock (const flash_ssd_config_t *pSSDConfig, uint8_t marginLevel)
 Flash verify all blocks. More...
 
status_t FLASH_DRV_EraseSector (const flash_ssd_config_t *pSSDConfig, uint32_t dest, uint32_t size)
 Flash erase sector. More...
 
status_t FLASH_DRV_VerifySection (const flash_ssd_config_t *pSSDConfig, uint32_t dest, uint16_t number, uint8_t marginLevel)
 Flash verify section. More...
 
void FLASH_DRV_EraseSuspend (void)
 Flash erase suspend. More...
 
void FLASH_DRV_EraseResume (void)
 Flash erase resume. More...
 
status_t FLASH_DRV_ReadOnce (const flash_ssd_config_t *pSSDConfig, uint8_t recordIndex, uint8_t *pDataArray)
 Flash read once. More...
 
status_t FLASH_DRV_ProgramOnce (const flash_ssd_config_t *pSSDConfig, uint8_t recordIndex, const uint8_t *pDataArray)
 Flash program once. More...
 
status_t FLASH_DRV_Program (const flash_ssd_config_t *pSSDConfig, uint32_t dest, uint32_t size, const uint8_t *pData)
 Flash program. More...
 
status_t FLASH_DRV_ProgramCheck (const flash_ssd_config_t *pSSDConfig, uint32_t dest, uint32_t size, const uint8_t *pExpectedData, uint32_t *pFailAddr, uint8_t marginLevel)
 Flash program check. More...
 
status_t FLASH_DRV_CheckSum (const flash_ssd_config_t *pSSDConfig, uint32_t dest, uint32_t size, uint32_t *pSum)
 Calculates check sum. More...
 

Macro Definition Documentation

#define CLEAR_FTFx_FSTAT_ERROR_BITS   FTFx_FSTAT = (uint8_t)(FTFx_FSTAT_FPVIOL_MASK | FTFx_FSTAT_ACCERR_MASK | FTFx_FSTAT_RDCOLERR_MASK)

Definition at line 377 of file flash_driver.h.

#define CSE_KEY_SIZE_CODE_MAX   0x03U

Definition at line 469 of file flash_driver.h.

#define DFLASH_IFR_READRESOURCE_ADDRESS   0x8000FCU

Definition at line 456 of file flash_driver.h.

#define FLASH_CALLBACK_CS   0x0AU

Callback period count for FlashCheckSum.

This value is only relevant for FlashCheckSum operation, where a high rate of calling back can impair performance. The rest of the flash operations invoke the callback as often as possible while waiting for the flash controller to finish the requested operation.

Definition at line 512 of file flash_driver.h.

#define FLASH_NOT_SECURE   0x01U

Flash currently not in secure state.

Definition at line 495 of file flash_driver.h.

#define FLASH_SECURE_BACKDOOR_DISABLED   0x04U

Flash is secured and backdoor key access disabled.

Definition at line 499 of file flash_driver.h.

#define FLASH_SECURE_BACKDOOR_ENABLED   0x02U

Flash is secured and backdoor key access enabled.

Definition at line 497 of file flash_driver.h.

#define FLASH_SECURITY_STATE_KEYEN   0x80U

Definition at line 465 of file flash_driver.h.

#define FLASH_SECURITY_STATE_UNSECURED   0x02U

Definition at line 466 of file flash_driver.h.

#define FTFx_DPHRASE_SIZE   0x0010U

Definition at line 386 of file flash_driver.h.

#define FTFx_ERASE_ALL_BLOCK   0x44U

Definition at line 410 of file flash_driver.h.

#define FTFx_ERASE_ALL_BLOCK_UNSECURE   0x49U

Definition at line 413 of file flash_driver.h.

#define FTFx_ERASE_BLOCK   0x08U

Definition at line 404 of file flash_driver.h.

#define FTFx_ERASE_SECTOR   0x09U

Definition at line 405 of file flash_driver.h.

#define FTFx_LONGWORD_SIZE   0x0004U

Definition at line 382 of file flash_driver.h.

#define FTFx_PFLASH_SWAP   0x46U

Definition at line 412 of file flash_driver.h.

#define FTFx_PHRASE_SIZE   0x0008U

Definition at line 384 of file flash_driver.h.

#define FTFx_PROGRAM_CHECK   0x02U

Definition at line 400 of file flash_driver.h.

#define FTFx_PROGRAM_LONGWORD   0x06U

Definition at line 402 of file flash_driver.h.

#define FTFx_PROGRAM_ONCE   0x43U

Definition at line 409 of file flash_driver.h.

#define FTFx_PROGRAM_PARTITION   0x80U

Definition at line 414 of file flash_driver.h.

#define FTFx_PROGRAM_PHRASE   0x07U

Definition at line 403 of file flash_driver.h.

#define FTFx_PROGRAM_SECTION   0x0BU

Definition at line 406 of file flash_driver.h.

#define FTFx_READ_ONCE   0x41U

Definition at line 408 of file flash_driver.h.

#define FTFx_READ_RESOURCE   0x03U

Definition at line 401 of file flash_driver.h.

#define FTFx_RSRC_CODE_REG   FTFx_FCCOB8

Definition at line 392 of file flash_driver.h.

#define FTFx_SECURITY_BY_PASS   0x45U

Definition at line 411 of file flash_driver.h.

#define FTFx_SET_EERAM   0x81U

Definition at line 415 of file flash_driver.h.

#define FTFx_SWAP_COMPLETE   0x04U

Complete swap mode.

Definition at line 445 of file flash_driver.h.

#define FTFx_SWAP_READY   0x01U

Ready swap mode.

Definition at line 439 of file flash_driver.h.

#define FTFx_SWAP_REPORT_STATUS   0x08U

Report Swap Status.

Definition at line 429 of file flash_driver.h.

#define FTFx_SWAP_SET_IN_COMPLETE   0x04U

Set Swap in Complete State.

Definition at line 427 of file flash_driver.h.

#define FTFx_SWAP_SET_IN_PREPARE   0x02U

Set Swap in Update State.

Definition at line 425 of file flash_driver.h.

#define FTFx_SWAP_SET_INDICATOR_ADDR   0x01U

Initialize Swap System control code.

Definition at line 423 of file flash_driver.h.

#define FTFx_SWAP_UNINIT   0x00U

Uninitialized swap mode.

Definition at line 437 of file flash_driver.h.

#define FTFx_SWAP_UPDATE   0x02U

Update swap mode.

Definition at line 441 of file flash_driver.h.

#define FTFx_SWAP_UPDATE_ERASED   0x03U

Update-Erased swap mode.

Definition at line 443 of file flash_driver.h.

#define FTFx_VERIFY_ALL_BLOCK   0x40U

Definition at line 407 of file flash_driver.h.

#define FTFx_VERIFY_BLOCK   0x00U

Definition at line 398 of file flash_driver.h.

#define FTFx_VERIFY_SECTION   0x01U

Definition at line 399 of file flash_driver.h.

#define FTFx_WORD_SIZE   0x0002U

Definition at line 380 of file flash_driver.h.

#define GET_BIT_0_7 (   value)    ((uint8_t)(((uint32_t)(value)) & 0xFFU))

Definition at line 459 of file flash_driver.h.

#define GET_BIT_16_23 (   value)    ((uint8_t)((((uint32_t)(value)) >> 16) & 0xFFU))

Definition at line 461 of file flash_driver.h.

#define GET_BIT_24_31 (   value)    ((uint8_t)(((uint32_t)(value)) >> 24))

Definition at line 462 of file flash_driver.h.

#define GET_BIT_8_15 (   value)    ((uint8_t)((((uint32_t)(value)) >> 8) & 0xFFU))

Definition at line 460 of file flash_driver.h.

#define NULL_CALLBACK   ((flash_callback_t)0xFFFFFFFFU)

Null callback.

Definition at line 523 of file flash_driver.h.

#define RESUME_WAIT_CNT   0x20U

Resume wait count used in FLASH_DRV_EraseResume function.

Definition at line 449 of file flash_driver.h.

#define SUSPEND_WAIT_CNT   0x40U

Suspend wait count used in FLASH_DRV_EraseSuspend function.

Definition at line 451 of file flash_driver.h.

Typedef Documentation

typedef void(* flash_callback_t) (void)

Call back function pointer data type.

If using callback in the application, any code reachable from this function must not be placed in a Flash block targeted for a program/erase operation. Functions can be placed in RAM section by using the START/END_FUNCTION_DEFINITION/DECLARATION_RAMSECTION macros.

Definition at line 540 of file flash_driver.h.

Enumeration Type Documentation

FlexRAM Function control Code.

Implements : flash_flexRAM_function_control_code_t_Class

Enumerator
EEE_ENABLE 

Make FlexRAM available for emulated EEPROM

EEE_QUICK_WRITE 

Make FlexRAM available for EEPROM quick writes

EEE_STATUS_QUERY 

EEPROM quick write status query

EEE_COMPLETE_INTERRUPT_QUICK_WRITE 

Complete interrupted EEPROM quick write process

EEE_DISABLE 

Make FlexRAM available as RAM

Definition at line 481 of file flash_driver.h.

Function Documentation

status_t FLASH_DRV_CheckSum ( const flash_ssd_config_t pSSDConfig,
uint32_t  dest,
uint32_t  size,
uint32_t *  pSum 
)

Calculates check sum.

This API performs 32 bit sum of each byte data over a specified Flash memory range without carry which provides rapid method for checking data integrity. The callback time period of this API is determined via FLASH_CALLBACK_CS macro in flash_driver.h which is used as a counter value for the CallBack() function calling in this API. This value can be changed as per the user requirement. User can change this value to obtain the maximum permissible callback time period. This API always returns STATUS_SUCCESS if size provided by user is zero regardless of the input validation.

Parameters
[in]pSSDConfigThe SSD configuration structure pointer.
[in]destStart address of the Flash range to be summed.
[in]sizeSize in byte of the Flash range to be summed.
[in]pSumTo return the sum value.
Returns
operation status
  • STATUS_SUCCESS: Operation was successful.
  • STATUS_ERROR: Operation failure was occurred.
status_t FLASH_DRV_EraseAllBlock ( const flash_ssd_config_t pSSDConfig)

Flash erase all blocks.

This API erases all Flash memory, initializes the FlexRAM, verifies all memory contents, and then releases the MCU security.

Parameters
[in]pSSDConfigThe SSD configuration structure pointer.
Returns
operation status
  • STATUS_SUCCESS: Operation was successful.
  • STATUS_ERROR: Operation failure was occurred.
  • STATUS_BUSY: Operation was busy.
void FLASH_DRV_EraseResume ( void  )

Flash erase resume.

This API is used to resume a previous suspended operation of Flash erase sector command This function must be located in RAM memory or different Flash blocks which are targeted for writing to avoid RWW error.

status_t FLASH_DRV_EraseSector ( const flash_ssd_config_t pSSDConfig,
uint32_t  dest,
uint32_t  size 
)

Flash erase sector.

This API erases one or more sectors in P-Flash or D-Flash memory. This API always returns FTFx_OK if size provided by the user is zero regardless of the input validation.

Parameters
[in]pSSDConfigThe SSD configuration structure pointer.
[in]destAddress in the first sector to be erased.
[in]sizeSize to be erased in bytes. It is used to determine number of sectors to be erased.
Returns
operation status
  • STATUS_SUCCESS: Operation was successful.
  • STATUS_ERROR: Operation failure was occurred.
  • STATUS_UNSUPPORTED: Operation was unsupported.
  • STATUS_BUSY: Operation was busy.
void FLASH_DRV_EraseSuspend ( void  )

Flash erase suspend.

This API is used to suspend a current operation of Flash erase sector command. This function must be located in RAM memory or different Flash blocks which are targeted for writing to avoid the RWW error.

void FLASH_DRV_GetPFlashProtection ( uint32_t *  protectStatus)

P-Flash get protection.

This API retrieves the current P-Flash protection status. Considering the time consumption for getting protection is very low and even can be ignored. It is not necessary to utilize the Callback function to support the time-critical events.

Parameters
[out]protectStatusTo return the current value of the P-Flash Protection. Each bit is corresponding to protection of 1/32 of the total P-Flash. The least significant bit is corresponding to the lowest address area of P-Flash. The most significant bit is corresponding to the highest address area of P-Flash and so on. There are two possible cases as below:
  • 0: this area is protected.
  • 1: this area is unprotected.
void FLASH_DRV_GetSecurityState ( uint8_t *  securityState)

Flash get security state.

This API retrieves the current Flash security status, including the security enabling state and the back door key enabling state.

Parameters
[out]securityStateTo return the current security status code.
  • FLASH_NOT_SECURE (0x01U): Flash currently not in secure state
  • FLASH_SECURE_BACKDOOR_ENABLED (0x02U): Flash is secured and back door key access enabled
  • FLASH_SECURE_BACKDOOR_DISABLED (0x04U): Flash is secured and back door key access disabled.
status_t FLASH_DRV_Init ( const flash_user_config_t *const  pUserConf,
flash_ssd_config_t *const  pSSDConfig 
)

Initializes Flash.

This API initializes Flash module by clearing status error bit and reporting the memory configuration via SSD configuration structure.

Parameters
[in]pUserConfThe user configuration structure pointer.
[in]pSSDConfigThe SSD configuration structure pointer.
Returns
operation status
  • STATUS_SUCCESS: Operation was successful.
status_t FLASH_DRV_Program ( const flash_ssd_config_t pSSDConfig,
uint32_t  dest,
uint32_t  size,
const uint8_t *  pData 
)

Flash program.

This API is used to program 4 consecutive bytes (for program long word command) and 8 consecutive bytes (for program phrase command) on P-Flash or D-Flash block. This API always returns FTFx_OK if size provided by user is zero regardless of the input validation

Parameters
[in]pSSDConfigThe SSD configuration structure pointer.
[in]destStart address for the intended program operation.
[in]sizeSize in byte to be programmed
[in]pDataPointer of source address from which data has to be taken for program operation.
Returns
operation status
  • STATUS_SUCCESS: Operation was successful.
  • STATUS_ERROR: Operation failure was occurred.
  • STATUS_UNSUPPORTED: Operation was unsupported.
  • STATUS_BUSY: Operation was busy.
status_t FLASH_DRV_ProgramCheck ( const flash_ssd_config_t pSSDConfig,
uint32_t  dest,
uint32_t  size,
const uint8_t *  pExpectedData,
uint32_t *  pFailAddr,
uint8_t  marginLevel 
)

Flash program check.

This API tests a previously programmed P-Flash or D-Flash long word to see if it reads correctly at the specified margin level. This API always returns FTFx_OK if size provided by user is zero regardless of the input validation

Parameters
[in]pSSDConfigThe SSD configuration structure pointer.
[in]destStart address for the intended program check operation.
[in]sizeSize in byte to check accuracy of program operation
[in]pExpectedDataThe pointer to the expected data.
[in]pFailAddrReturned the first aligned failing address.
[in]marginLevelRead margin choice as follows:
  • marginLevel = 0x1U: read at User margin 1/0 level.
  • marginLevel = 0x2U: read at Factory margin 1/0 level.
Returns
operation status
  • STATUS_SUCCESS: Operation was successful.
  • STATUS_ERROR: Operation failure was occurred.
  • STATUS_BUSY: Operation was busy.
status_t FLASH_DRV_ProgramOnce ( const flash_ssd_config_t pSSDConfig,
uint8_t  recordIndex,
const uint8_t *  pDataArray 
)

Flash program once.

This API is used to program to a reserved 64 byte field located in the P-Flash IFR via given number of record. See the corresponding reference manual to get correct value of this number.

Parameters
[in]pSSDConfigThe SSD configuration structure pointer.
[in]recordIndexThe record index will be read. It can be from 0x0U to 0x7U or from 0x0U to 0xF according to specific derivative.
[in]pDataArrayPointer to the array from which data will be taken for program once command.
Returns
operation status
  • STATUS_SUCCESS: Operation was successful.
  • STATUS_ERROR: Operation failure was occurred.
  • STATUS_BUSY: Operation was busy.
status_t FLASH_DRV_ReadOnce ( const flash_ssd_config_t pSSDConfig,
uint8_t  recordIndex,
uint8_t *  pDataArray 
)

Flash read once.

This API is used to read out a reserved 64 byte field located in the P-Flash IFR via given number of record. See the corresponding reference manual to get the correct value of this number.

Parameters
[in]pSSDConfigThe SSD configuration structure pointer.
[in]recordIndexThe record index will be read. It can be from 0x0U to 0x7U or from 0x0U to 0xF according to specific derivative.
[in]pDataArrayPointer to the array to return the data read by the read once command.
Returns
operation status
  • STATUS_SUCCESS: Operation was successful.
  • STATUS_ERROR: Operation failure was occurred.
  • STATUS_BUSY: Operation was busy.
status_t FLASH_DRV_SecurityBypass ( const flash_ssd_config_t pSSDConfig,
const uint8_t *  keyBuffer 
)

Flash security bypass.

This API un-secures the device by comparing the user's provided back door key with the ones in the Flash Configuration Field. If they are matched, the security is released. Otherwise, an error code is returned.

Parameters
[in]pSSDConfigThe SSD configuration structure pointer.
[in]keyBufferPoint to the user buffer containing the back door key.
Returns
operation status
  • STATUS_SUCCESS: Operation was successful.
  • STATUS_ERROR: Operation failure was occurred.
  • STATUS_BUSY: Operation was busy.
status_t FLASH_DRV_SetPFlashProtection ( uint32_t  protectStatus)

P-Flash set protection.

This API sets the P-Flash protection to the intended protection status. Setting P-Flash protection status is subject to a protection, transition restriction. If there is a setting violation, it returns an error code and the current protection status will not be changed.

Parameters
[in]protectStatusThe expected protect status user wants to set to P-Flash protection register. Each bit is corresponding to protection of 1/32 of the total P-Flash. The least significant bit is corresponding to the lowest address area of P-Flash. The most significant bit is corresponding to the highest address area of P- Flash, and so on. There are two possible cases as shown below:
  • 0: this area is protected.
  • 1: this area is unprotected.
Returns
operation status
  • STATUS_SUCCESS: Operation was successful.
  • STATUS_ERROR: Operation failure was occurred.
status_t FLASH_DRV_VerifyAllBlock ( const flash_ssd_config_t pSSDConfig,
uint8_t  marginLevel 
)

Flash verify all blocks.

This function checks to see if the P-Flash and/or D-Flash, EEPROM backup area, and D-Flash IFR have been erased to the specified read margin level, if applicable, and releases security if the readout passes.

Parameters
[in]pSSDConfigThe SSD configuration structure pointer.
[in]marginLevelRead Margin Choice as follows:
  • marginLevel = 0x0U: use the Normal read level
  • marginLevel = 0x1U: use the User read
  • marginLevel = 0x2U: use the Factory read
Returns
operation status
  • STATUS_SUCCESS: Operation was successful.
  • STATUS_ERROR: Operation failure was occurred.
  • STATUS_BUSY: Operation was busy.
status_t FLASH_DRV_VerifySection ( const flash_ssd_config_t pSSDConfig,
uint32_t  dest,
uint16_t  number,
uint8_t  marginLevel 
)

Flash verify section.

This API checks if a section of the P-Flash or the D-Flash memory is erased to the specified read margin level.

Parameters
[in]pSSDConfigThe SSD configuration structure pointer.
[in]destStart address for the intended verify operation.
[in]numberNumber of alignment unit to be verified. Refer to corresponding reference manual to get correct information of alignment constrain.
[in]marginLevelRead Margin Choice as follows:
  • marginLevel = 0x0U: use Normal read level
  • marginLevel = 0x1U: use the User read
  • marginLevel = 0x2U: use the Factory read
Returns
operation status
  • STATUS_SUCCESS: Operation was successful.
  • STATUS_ERROR: Operation failure was occurred.
  • STATUS_BUSY: Operation was busy.

Variable Documentation

uint8_t brownOutCode

Brown-out detection code

Definition at line 602 of file flash_driver.h.

flash_callback_t CallBack

Call back function to service the time critical events. Any code reachable from this function must not be placed in a Flash block targeted for a program/erase operation

Definition at line 562 of file flash_driver.h.

flash_callback_t CallBack

Call back function to service the time critical events. Any code reachable from this function must not be placed in a Flash block targeted for a program/erase operation

Definition at line 591 of file flash_driver.h.

uint32_t DFlashBase

For FlexNVM device, this is the base address of D-Flash memory (FlexNVM memory); For non-FlexNVM device, this field is unused

Definition at line 558 of file flash_driver.h.

uint32_t DFlashBase

For FlexNVM device, this is the base address of D-Flash memory (FlexNVM memory); For non-FlexNVM device, this field is unused

Definition at line 582 of file flash_driver.h.

uint32_t DFlashSize

For FlexNVM device, this is the size in byte of area which is used as D-Flash from FlexNVM memory; For non-FlexNVM device, this field is unused

Definition at line 584 of file flash_driver.h.

uint32_t EEESize

For FlexNVM device, this is the size in byte of EEPROM area which was partitioned from FlexRAM; For non-FlexNVM device, this field is unused

Definition at line 589 of file flash_driver.h.

uint32_t EERAMBase

The base address of FlexRAM (for FlexNVM device) or acceleration RAM memory (for non-FlexNVM device)

Definition at line 560 of file flash_driver.h.

uint32_t EERAMBase

The base address of FlexRAM (for FlexNVM device) or acceleration RAM memory (for non-FlexNVM device)

Definition at line 587 of file flash_driver.h.

uint16_t numOfRecordReqMaintain

Number of EEPROM quick write records requiring maintenance

Definition at line 603 of file flash_driver.h.

uint32_t PFlashBase

The base address of P-Flash memory

Definition at line 556 of file flash_driver.h.

uint32_t PFlashBase

The base address of P-Flash memory

Definition at line 580 of file flash_driver.h.

uint32_t PFlashSize

The size in byte of P-Flash memory

Definition at line 557 of file flash_driver.h.

uint32_t PFlashSize

The size in byte of P-Flash memory

Definition at line 581 of file flash_driver.h.

uint16_t sectorEraseCount

EEPROM sector erase count

Definition at line 604 of file flash_driver.h.