!! Add below code in app_drv_usart2.h !!
---------------------------------------------------------------------
    // APP_DRV_USART2_STATE_SERVICE_TASKS,
    APP_DRV_USART2_STATE_READ,
    APP_DRV_USART2_STATE_READ_WAIT_COMPLETE,
    APP_DRV_USART2_STATE_WRITE,
    APP_DRV_USART2_STATE_WRITE_WAIT_COMPLETE,
    APP_DRV_USART2_STATE_ERROR,
    APP_DRV_USART2_STATE_IDLE,

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


!! Add below code in app_drv_usart1.c !!
---------------------------------------------------------------------
    switch ( app_drv_usart2Data.state )
    {
    case APP_DRV_USART2_STATE_INIT:
        app_drv_usart2Data.state = APP_DRV_USART2_STATE_READ;
        break;

    case APP_DRV_USART2_STATE_READ:
        app_drv_usart2Data.state = APP_DRV_USART2_STATE_READ_WAIT_COMPLETE;
        break;

    case APP_DRV_USART2_STATE_READ_WAIT_COMPLETE:
        app_drv_usart2Data.state = APP_DRV_USART2_STATE_WRITE;
        break;

    case APP_DRV_USART2_STATE_WRITE:
        app_drv_usart2Data.state = APP_DRV_USART2_STATE_WRITE_WAIT_COMPLETE;
        break;

    case APP_DRV_USART2_STATE_WRITE_WAIT_COMPLETE:
        app_drv_usart2Data.state = APP_DRV_USART2_STATE_READ;
        break;

    case APP_DRV_USART2_STATE_ERROR:
        app_drv_usart2Data.state = APP_DRV_USART2_STATE_IDLE;
        break;

    case APP_DRV_USART2_STATE_IDLE:
        break;
    }

---------------------------------------------------------------------
#include "driver/usart/drv_usart.h"
#include <stdio.h>
#include <string.h>

---------------------------------------------------------------------
DRV_HANDLE  Uart2Handle;
DRV_USART_BUFFER_HANDLE Uart2WriteTransferHandle;
DRV_USART_BUFFER_HANDLE Uart2ReadTransferHandle;
volatile int Uart2WriteComplete = false;
volatile int Uart2ReadComplete = false;
char Uart2WriteBuf[50];
char Uart2ReadBuf[50];

---------------------------------------------------------------------
        Uart2Handle = DRV_USART_Open(DRV_USART_INDEX_1, DRV_IO_INTENT_READWRITE);
        if(Uart2Handle == DRV_HANDLE_INVALID)
        {
            app_drv_usart2Data.state = APP_DRV_USART2_STATE_ERROR;
        }
        else
        {
            sprintf(Uart2WriteBuf, "DRV_USART2: Hello world\r\n");
            DRV_USART_WriteBufferAdd(Uart2Handle, Uart2WriteBuf, strlen(Uart2WriteBuf), &Uart2WriteTransferHandle);
            while( DRV_USART_BufferStatusGet(Uart2WriteTransferHandle)!=DRV_USART_BUFFER_EVENT_COMPLETE )
            {}

            app_drv_usart2Data.state = APP_DRV_USART2_STATE_READ;
        }

=====================================================================
void Uart2TransferHandler( DRV_USART_BUFFER_EVENT event, DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t context )
{
    switch( event )
    {
    case DRV_USART_BUFFER_EVENT_PENDING: break;
    case DRV_USART_BUFFER_EVENT_COMPLETE:
        break;
    case DRV_USART_BUFFER_EVENT_HANDLE_EXPIRED:
    case DRV_USART_BUFFER_EVENT_ERROR:
    case DRV_USART_BUFFER_EVENT_HANDLE_INVALID:
        app_drv_usart2Data.state = APP_DRV_USART2_STATE_ERROR;
        break;
    }
}

---------------------------------------------------------------------
            DRV_USART_BufferEventHandlerSet(Uart2Handle, Uart2TransferHandler, 0);

---------------------------------------------------------------------
        if(bufferHandle == Uart2ReadTransferHandle)
            Uart2ReadComplete = true;

---------------------------------------------------------------------
        DRV_USART_ReadBufferAdd(Uart2Handle, Uart2ReadBuf, 1, &Uart2ReadTransferHandle);
        if(Uart2ReadTransferHandle == DRV_USART_BUFFER_HANDLE_INVALID)
        {
            app_drv_usart2Data.state = APP_DRV_USART2_STATE_ERROR;
        }
        else
        {
            app_drv_usart2Data.state = APP_DRV_USART2_STATE_READ_WAIT_COMPLETE;
        }

---------------------------------------------------------------------
        if(Uart2ReadComplete == true)
        {
            Uart2ReadComplete = false;
            app_drv_usart2Data.state = APP_DRV_USART2_STATE_WRITE;				
        }

---------------------------------------------------------------------
        if(bufferHandle == Uart2WriteTransferHandle)
            Uart2WriteComplete = true;

---------------------------------------------------------------------
        sprintf(Uart2WriteBuf, "Receive : %s (DRV_USART2)\r\n", Uart2ReadBuf);
        DRV_USART_WriteBufferAdd(Uart2Handle, Uart2WriteBuf, strlen(Uart2WriteBuf), &Uart2WriteTransferHandle);
        if(Uart2WriteTransferHandle == DRV_USART_BUFFER_HANDLE_INVALID)
        {
            app_drv_usart2Data.state = APP_DRV_USART2_STATE_ERROR;
        }
        else
        {
            app_drv_usart2Data.state = APP_DRV_USART2_STATE_WRITE_WAIT_COMPLETE;
        }

---------------------------------------------------------------------
        if(Uart2WriteComplete == true)
        {
            Uart2WriteComplete = false;
            app_drv_usart2Data.state = APP_DRV_USART2_STATE_READ;				
        }

=====================================================================



!! Add below code in app_drv_usart1.h !!
---------------------------------------------------------------------
extern APP_DRV_USART1_DATA app_drv_usart1Data;
extern char Uart1ReadBuf[50];

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

!! Add below code in app_drv_usart2.h !!
---------------------------------------------------------------------
extern APP_DRV_USART2_DATA app_drv_usart2Data;
extern char Uart2ReadBuf[50];

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



!! Add below code in app_drv_usart1.c !!
---------------------------------------------------------------------
#include "app_drv_usart2.h"

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

!! Add below code in app_drv_usart2.c !!
---------------------------------------------------------------------
#include "app_drv_usart1.h"

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



!! Add below code in state READ_WAIT_COMPLETE of app_drv_usart1.c !!
---------------------------------------------------------------------
            app_drv_usart1Data.state = APP_DRV_USART1_STATE_READ; // Modify this Line
            app_drv_usart2Data.state = APP_DRV_USART2_STATE_WRITE;

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

!! Add below code in state READ_WAIT_COMPLETE of app_drv_usart2.c !!
---------------------------------------------------------------------
            app_drv_usart2Data.state = APP_DRV_USART2_STATE_READ; // Modify this Line
            app_drv_usart1Data.state = APP_DRV_USART1_STATE_WRITE;

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



!! Add below code in state WRITE of app_drv_usart1.c !!
---------------------------------------------------------------------
        sprintf(Uart1WriteBuf, "Receive : %s (DRV_USART2)\r\n", Uart2ReadBuf); // Modify this Line

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

!! Add below code in state WRITE of app_drv_usart2.c !!
---------------------------------------------------------------------
        sprintf(Uart2WriteBuf, "Receive : %s (DRV_USART1)\r\n", Uart1ReadBuf); // Modify this Line

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



!! Add below code in state WRITE_WAIT_COMPLETE of app_drv_usart1.c !!
---------------------------------------------------------------------
            app_drv_usart1Data.state = APP_DRV_USART1_STATE_READ_WAIT_COMPLETE; // Modify this Line

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

!! Add below code in state WRITE_WAIT_COMPLETE of app_drv_usart2.c !!
---------------------------------------------------------------------
            app_drv_usart2Data.state = APP_DRV_USART2_STATE_READ_WAIT_COMPLETE; // Modify this Line

=====================================================================



!! Add below code in app_drv_usart2.c !!
---------------------------------------------------------------------
void USART2write( unsigned char *pdata, int len )
{
    if( len > 0 && len < sizeof(Uart2WriteBuf) )
    {
        memcpy(Uart2WriteBuf, pdata, len);

        DRV_USART_WriteBufferAdd(Uart2Handle, Uart2WriteBuf, len, &Uart2WriteTransferHandle);

        while( DRV_USART_BufferStatusGet(Uart2WriteTransferHandle)!=DRV_USART_BUFFER_EVENT_COMPLETE )
        {}
    }
}

---------------------------------------------------------------------
            USART2write((unsigned char*)"DRV_USART2: Hello world\r\n", 25);
            // sprintf(Uart2WriteBuf, "DRV_USART2: Hello world\r\n");
            // DRV_USART_WriteBufferAdd(Uart2Handle, Uart2WriteBuf, strlen(Uart2WriteBuf), &Uart2WriteTransferHandle);
            // while( DRV_USART_BufferStatusGet(Uart2WriteTransferHandle)!=DRV_USART_BUFFER_EVENT_COMPLETE )
            // {}

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



!! Add below code in app_drv_usart2.h !!
---------------------------------------------------------------------
void USART2write( unsigned char *pdata, int len );

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