STM32H735xx HAL User Manual
Functions
Peripheral Erase management
MMC Exported Functions

Functions

HAL_StatusTypeDef HAL_MMC_EraseSequence (MMC_HandleTypeDef *hmmc, uint32_t EraseType, uint32_t BlockStartAdd, uint32_t BlockEndAdd)
 Perform specific commands sequence for the different type of erase.
HAL_StatusTypeDef HAL_MMC_Sanitize (MMC_HandleTypeDef *hmmc)
 Perform sanitize operation on the device.
HAL_StatusTypeDef HAL_MMC_ConfigSecRemovalType (MMC_HandleTypeDef *hmmc, uint32_t SRTMode)
 Configure the Secure Removal Type (SRT) in the Extended CSD register.
HAL_StatusTypeDef HAL_MMC_GetSupportedSecRemovalType (MMC_HandleTypeDef *hmmc, uint32_t *SupportedSRT)
 Gets the supported values of the the Secure Removal Type (SRT).

Function Documentation

HAL_StatusTypeDef HAL_MMC_ConfigSecRemovalType ( MMC_HandleTypeDef hmmc,
uint32_t  SRTMode 
)

Configure the Secure Removal Type (SRT) in the Extended CSD register.

Note:
This API should be followed by a check on the card state through HAL_MMC_GetCardState().
Parameters:
hmmcPointer to MMC handle
SRTModeSpecifies the type of erase to be performed This parameter can be one of the following values:
  • HAL_MMC_SRT_ERASE Information removed by an erase
  • HAL_MMC_SRT_WRITE_CHAR_ERASE Information removed by an overwriting with a character followed by an erase
  • HAL_MMC_SRT_WRITE_CHAR_COMPL_RANDOM Information removed by an overwriting with a character, its complement then a random character
  • HAL_MMC_SRT_VENDOR_DEFINED Information removed using a vendor defined
Return values:
HALstatus

Definition at line 3028 of file stm32h7xx_hal_mmc.c.

References __HAL_MMC_CLEAR_FLAG, assert_param, __MMC_HandleTypeDef::ErrorCode, HAL_MMC_ERROR_NONE, HAL_MMC_GetSupportedSecRemovalType(), HAL_MMC_STATE_BUSY, HAL_MMC_STATE_READY, __MMC_HandleTypeDef::Instance, IS_MMC_SRT_TYPE, __MMC_HandleTypeDef::MmcCard, HAL_MMC_CardInfoTypeDef::RelCardAdd, and __MMC_HandleTypeDef::State.

HAL_StatusTypeDef HAL_MMC_EraseSequence ( MMC_HandleTypeDef hmmc,
uint32_t  EraseType,
uint32_t  BlockStartAdd,
uint32_t  BlockEndAdd 
)

Perform specific commands sequence for the different type of erase.

Note:
This API should be followed by a check on the card state through HAL_MMC_GetCardState().
Parameters:
hmmcPointer to MMC handle
EraseTypeSpecifies the type of erase to be performed This parameter can be one of the following values:
  • HAL_MMC_TRIM Erase the write blocks identified by CMD35 & 36
  • HAL_MMC_ERASE Erase the erase groups identified by CMD35 & 36
  • HAL_MMC_DISCARD Discard the write blocks identified by CMD35 & 36
  • HAL_MMC_SECURE_ERASE Perform a secure purge according SRT on the erase groups identified by CMD35 & 36
  • HAL_MMC_SECURE_TRIM_STEP1 Mark the write blocks identified by CMD35 & 36 for secure erase
  • HAL_MMC_SECURE_TRIM_STEP2 Perform a secure purge according SRT on the write blocks previously identified
BlockStartAddStart Block address
BlockEndAddEnd Block address
Return values:
HALstatus

Definition at line 2786 of file stm32h7xx_hal_mmc.c.

References __HAL_MMC_CLEAR_FLAG, __HAL_MMC_GET_FLAG, assert_param, HAL_MMC_CardInfoTypeDef::CardType, HAL_MMC_CardInfoTypeDef::Class, __MMC_HandleTypeDef::ErrorCode, __MMC_HandleTypeDef::Ext_CSD, HAL_GetTick(), HAL_MMC_ERROR_ADDR_MISALIGNED, HAL_MMC_ERROR_ADDR_OUT_OF_RANGE, HAL_MMC_ERROR_LOCK_UNLOCK_FAILED, HAL_MMC_ERROR_NONE, HAL_MMC_ERROR_PARAM, HAL_MMC_ERROR_REQUEST_NOT_APPLICABLE, HAL_MMC_ERROR_TIMEOUT, HAL_MMC_SECURE_ERASE, HAL_MMC_SECURE_TRIM_STEP2, HAL_MMC_STATE_BUSY, HAL_MMC_STATE_READY, __MMC_HandleTypeDef::Instance, IS_MMC_ERASE_TYPE, HAL_MMC_CardInfoTypeDef::LogBlockNbr, MMC_EXT_CSD_DATA_SEC_SIZE_INDEX, MMC_EXT_CSD_DATA_SEC_SIZE_POS, MMC_HIGH_CAPACITY_CARD, __MMC_HandleTypeDef::MmcCard, and __MMC_HandleTypeDef::State.

HAL_StatusTypeDef HAL_MMC_GetSupportedSecRemovalType ( MMC_HandleTypeDef hmmc,
uint32_t *  SupportedSRT 
)

Gets the supported values of the the Secure Removal Type (SRT).

Parameters:
hmmcpointer to MMC handle
SupportedSRTpointer for supported SRT value This parameter is a bit field of the following values:
  • HAL_MMC_SRT_ERASE Information removed by an erase
  • HAL_MMC_SRT_WRITE_CHAR_ERASE Information removed by an overwriting with a character followed by an erase
  • HAL_MMC_SRT_WRITE_CHAR_COMPL_RANDOM Information removed by an overwriting with a character, its complement then a random character
  • HAL_MMC_SRT_VENDOR_DEFINED Information removed using a vendor defined
Return values:
HALstatus

Definition at line 3134 of file stm32h7xx_hal_mmc.c.

References __MMC_HandleTypeDef::Ext_CSD, HAL_MMC_STATE_BUSY, HAL_MMC_STATE_READY, and __MMC_HandleTypeDef::State.

Referenced by HAL_MMC_ConfigSecRemovalType().

HAL_StatusTypeDef HAL_MMC_Sanitize ( MMC_HandleTypeDef hmmc)

Perform sanitize operation on the device.

Note:
This API should be followed by a check on the card state through HAL_MMC_GetCardState().
Parameters:
hmmcPointer to MMC handle
Return values:
HALstatus

Definition at line 2917 of file stm32h7xx_hal_mmc.c.

References __HAL_MMC_CLEAR_FLAG, __HAL_MMC_GET_FLAG, __MMC_HandleTypeDef::ErrorCode, HAL_GetTick(), HAL_MMC_ERROR_NONE, HAL_MMC_ERROR_TIMEOUT, HAL_MMC_STATE_BUSY, HAL_MMC_STATE_READY, __MMC_HandleTypeDef::Instance, __MMC_HandleTypeDef::MmcCard, HAL_MMC_CardInfoTypeDef::RelCardAdd, and __MMC_HandleTypeDef::State.