mcu/drv/fsl_flash_driver_c90tfs.c
/*FUNCTION**********************************************************************
 *
 * Function Name : FlashSecurityBypass
 * Description   : 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.
 *
 * Implements    : FlashSecurityBypass_Activity
 *END**************************************************************************/
FUNCTION

Function Name : FlashSecurityBypass
Description   : 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.

Implements    : FlashSecurityBypass_Activity
END
FUNCTION Function Name : FlashSecurityBypass Description : 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 . Implements : FlashSecurityBypass_Activity END
flash_drv_status_t FlashSecurityBypass(const flash_ssd_config_t * pSSDConfig, \
                                       const uint8_t* keyBuffer, \
                                       flash_command_sequence_t pFlashCommandSequence)
{
#ifdef DEV_ERROR_DETECT
    DEV_ASSERT(pSSDConfig != NULL);
    DEV_ASSERT(keyBuffer != NULL);
    DEV_ASSERT(pFlashCommandSequence != NULL);
#endif
    flash_drv_status_t ret;    
    uint32_t temp;             
    uint8_t i;
    CLEAR_FTFx_FSTAT_ERROR_BITS;
    FTFx_FCCOB0 = FTFx_SECURITY_BY_PASS;
    for (i = 0U; i < 8U; i++)
    {
        temp = FTFx_BASE + i + 0x08U;
        *(uint8_t *)temp = keyBuffer[i];
    }
    ret = pFlashCommandSequence(pSSDConfig);
    return (ret);
}
flash_drv_status_t FlashSecurityBypass ( const flash_ssd_config_t * pSSDConfig , const uint8_t * keyBuffer , flash_command_sequence_t pFlashCommandSequence ) { #ifdef DEV_ERROR_DETECT DEV_ASSERT ( pSSDConfig != NULL ) ; DEV_ASSERT ( keyBuffer != NULL ) ; DEV_ASSERT ( pFlashCommandSequence != NULL ) ; #endif flash_drv_status_t ret ; uint32_t temp ; uint8_t i ; CLEAR_FTFx_FSTAT_ERROR_BITS ; FTFx_FCCOB0 = FTFx_SECURITY_BY_PASS ; for ( i = 0U ; i < 8U ; i ++ ) { temp = FTFx_BASE + i + 0x08U ; * ( uint8_t * ) temp = keyBuffer [ i ] ; } ret = pFlashCommandSequence ( pSSDConfig ) ; return ( ret ) ; }
FUNCTION
FUNCTION
/* Return code variable */ /* Temporary variable */ /* Clear RDCOLERR & ACCERR & FPVIOL flag in flash status register. Write 1 to clear */ /* Passing parameter to the command */