---------------------------------------------------------------------
!! Add below code in app_drv_sdcard.h !!
---------------------------------------------------------------------
    // APP_DRV_SDCARD_STATE_SERVICE_TASKS,
    APP_DRV_SDCARD_STATE_WAIT_ATTACH,
    APP_DRV_SDCARD_STATE_READ,
    APP_DRV_SDCARD_STATE_READ_WAIT_COMPLETE,
    APP_DRV_SDCARD_STATE_WRITE,
    APP_DRV_SDCARD_STATE_WRITE_WAIT_COMPLETE,
    APP_DRV_SDCARD_STATE_ERROR,
    APP_DRV_SDCARD_STATE_IDLE,

---------------------------------------------------------------------


---------------------------------------------------------------------
!! Add below code in app_drv_sdcard.c !!
---------------------------------------------------------------------
    switch ( app_drv_sdcardData.state )
    {
    case APP_DRV_SDCARD_STATE_INIT:
        app_drv_sdcardData.state = APP_DRV_SDCARD_STATE_WAIT_ATTACH;
        break;

    case APP_DRV_SDCARD_STATE_WAIT_ATTACH:
        app_drv_sdcardData.state = APP_DRV_SDCARD_STATE_READ;
        break;
        
    case APP_DRV_SDCARD_STATE_READ:
        app_drv_sdcardData.state = APP_DRV_SDCARD_STATE_READ_WAIT_COMPLETE;
        break;
        
    case APP_DRV_SDCARD_STATE_READ_WAIT_COMPLETE:
        app_drv_sdcardData.state = APP_DRV_SDCARD_STATE_WRITE;
        break;
        
    case APP_DRV_SDCARD_STATE_WRITE:
        app_drv_sdcardData.state = APP_DRV_SDCARD_STATE_WRITE_WAIT_COMPLETE;
        break;
        
    case APP_DRV_SDCARD_STATE_WRITE_WAIT_COMPLETE:
        app_drv_sdcardData.state = APP_DRV_SDCARD_STATE_IDLE;
        break;

    case APP_DRV_SDCARD_STATE_ERROR:
        app_drv_sdcardData.state = APP_DRV_SDCARD_STATE_IDLE;
        break;

    case APP_DRV_SDCARD_STATE_IDLE:
        break;
    }

---------------------------------------------------------------------
#include "app_drv_usart1.h"
#include "driver/sdspi/drv_sdspi.h"
#include <stdio.h>
#include <string.h>

---------------------------------------------------------------------
#define SDCARD_BLOCK_START                 0x2000
#define SDCARD_BUFFER_SIZE                 (4096U)
#define SDCARD_GEOMETRY_TABLE_READ_ENTRY   (0)
#define SDCARD_GEOMETRY_TABLE_WRITE_ENTRY  (1)
#define SDCARD_GEOMETRY_TABLE_ERASE_ENTRY  (2)
SYS_MEDIA_GEOMETRY *SDCardGeometry = NULL;
int SDCardReadBlocks;
int SDCardWriteBlocks;
int SDCardEraseBlocks;

DRV_HANDLE SDCardHandle;
DRV_SDSPI_COMMAND_HANDLE SDCardReadHandle;
DRV_SDSPI_COMMAND_HANDLE SDCardWriteHandle;
volatile int SDCardWriteComplete = false;
volatile int SDCardReadComplete = false;
char SDCardWriteBuf[SDCARD_BUFFER_SIZE];
char SDCardReadBuf[SDCARD_BUFFER_SIZE];
int SDCardResetCount = 1;

---------------------------------------------------------------------
void SDCardTransferHandler( SYS_MEDIA_BLOCK_EVENT event, SYS_MEDIA_BLOCK_COMMAND_HANDLE commandHandle, uintptr_t context )
{
    switch( event )
    {
    case SYS_MEDIA_EVENT_BLOCK_COMMAND_COMPLETE:
        if     (commandHandle == SDCardReadHandle)
        { SDCardReadComplete = true; }
        else if(commandHandle == SDCardWriteHandle)
        { SDCardWriteComplete = true; }
        break;

    case SYS_MEDIA_EVENT_BLOCK_COMMAND_ERROR:
        app_drv_sdcardData.state = APP_DRV_SDCARD_STATE_ERROR;
        break;
    }
}

---------------------------------------------------------------------
        SDCardHandle = DRV_SDSPI_Open(DRV_SDSPI_INDEX_0, DRV_IO_INTENT_READWRITE);
        if(SDCardHandle == DRV_HANDLE_INVALID)
        {
            app_drv_sdcardData.state = APP_DRV_SDCARD_STATE_ERROR;
            break;
        }

        DRV_SDSPI_EventHandlerSet(SDCardHandle, SDCardTransferHandler, 0);

---------------------------------------------------------------------
        USART1printf("DRV_SDCARD error!\r\n");

---------------------------------------------------------------------
        if( DRV_SDSPI_IsAttached(SDCardHandle) == false )
            break;
		
        USART1printf("\r\nSDCard attached!\r\n");
		
        SDCardGeometry = DRV_SDSPI_GeometryGet(SDCardHandle);
        if (SDCardGeometry == NULL)
        {
            app_drv_sdcardData.state = APP_DRV_SDCARD_STATE_ERROR;
            break;
        }
        SDCardReadBlocks  = (SDCARD_BUFFER_SIZE / SDCardGeometry->geometryTable[SDCARD_GEOMETRY_TABLE_READ_ENTRY].blockSize);
        SDCardWriteBlocks = (SDCARD_BUFFER_SIZE / SDCardGeometry->geometryTable[SDCARD_GEOMETRY_TABLE_WRITE_ENTRY].blockSize);
        SDCardEraseBlocks = (SDCARD_BUFFER_SIZE / SDCardGeometry->geometryTable[SDCARD_GEOMETRY_TABLE_ERASE_ENTRY].blockSize);

---------------------------------------------------------------------
        DRV_SDSPI_AsyncRead(SDCardHandle, &SDCardReadHandle, SDCardReadBuf, SDCARD_BLOCK_START, SDCardReadBlocks);
        if(SDCardReadHandle == DRV_SDSPI_COMMAND_HANDLE_INVALID)
        {
            app_drv_sdcardData.state = APP_DRV_SDCARD_STATE_ERROR;
            break;
        }

---------------------------------------------------------------------
        if(SDCardReadComplete == true)
        {
            SDCardReadComplete = false;

            if( !strncmp((char*)SDCardReadBuf, "Count SDCard: ", 14) )
            {
                USART1printf("%s\r\n", SDCardReadBuf);
                sscanf(SDCardReadBuf, "Count SDCard: %d", &SDCardResetCount);
                SDCardResetCount = (SDCardResetCount+1)%10;
            }
            else
            {
                USART1printf("Geometry SDCard: Buff(%d), R(%d), W(%d), E(%d)\r\n",
                                  SDCARD_BUFFER_SIZE, SDCardReadBlocks, SDCardWriteBlocks, SDCardEraseBlocks);
            }

            app_drv_sdcardData.state = APP_DRV_SDCARD_STATE_WRITE;				
        }

---------------------------------------------------------------------
        sprintf( SDCardWriteBuf, "Count SDCard: %d", SDCardResetCount);
        DRV_SDSPI_AsyncWrite(SDCardHandle, &SDCardWriteHandle, SDCardWriteBuf, SDCARD_BLOCK_START, SDCardWriteBlocks);

        if(SDCardWriteHandle == DRV_SDSPI_COMMAND_HANDLE_INVALID)
        {
            app_drv_sdcardData.state = APP_DRV_SDCARD_STATE_ERROR;
        }
        else
        {
            app_drv_sdcardData.state = APP_DRV_SDCARD_STATE_WRITE_WAIT_COMPLETE;
        }

---------------------------------------------------------------------
        if(SDCardWriteComplete == true)
        {
            SDCardWriteComplete = false;

            DRV_SDSPI_Close( SDCardHandle );

            app_drv_sdcardData.state = APP_DRV_SDCARD_STATE_IDLE;
        }

---------------------------------------------------------------------



---------------------------------------------------------------------
=====================================================================
---------------------------------------------------------------------
!! Add below code in app_drv_spi1.c !!
---------------------------------------------------------------------			
            SYS_TIME_DelayMS(200, &SplashTimerHandle);

---------------------------------------------------------------------
        if( SYS_TIME_DelayIsComplete(SplashTimerHandle) == false )
            break;
        SYS_TIME_DelayMS(200, &SplashTimerHandle);

---------------------------------------------------------------------