Problem With UART2


#1

I have written the following code to access the UART2.It should give an at response “OK” when I am fetching the “AT” command.But it’s not working.Please help me to solve the problem with proper code and suggestion.

bool Res_AT_Handler(void)
{
	return TRUE;
}
//////////////////////////////////////
void My_TimerHandler ( u8 ID )
{
    
    TRACE (( 1, "Embedded : Hello DEBMALYA" ));
    adl_atSendResponse ( ADL_AT_UNS, "\r\nHello DEBMALYA\r\n" );
	adl_atCmdCreate( "AT", ADL_AT_PORT_TYPE( ADL_AT_UART2, FALSE ), Res_AT_Handler, "*", NULL );
}
////////////////////////////////////////////
void adl_main ( adl_InitType_e InitType )
{
    TRACE (( 1, "Embedded Application : Main" ));
    //adl_portSubscribe(ADL_PORT_UART2);

    // /////////////////////////////////////////
UART2_Enable();
adl_tmrSubscribe ( TRUE, 10, ADL_TMR_TYPE_100MS, My_TimerHandler );
}
void fcmCtrlH ( u8 event )
{
    switch ( event )
    {
        case ADL_FCM_RET_ERROR_GSM_GPRS_ALREADY_OPENNED :
            TRACE (( 1, "Flow GSM already Opened"));
        break;
   }
}

void fcmDataH ( u16 DataLen, u8 * Data )
{
    u8 result;

    adl_atSendResponse(ADL_AT_UNS, "\r\n<- Receive FCM Data Blocks \r\n");
    DUMP ( 1, Data, DataLen );

}

bool Res_WMFM1_Handler ( void )
{
   return TRUE;
}

bool Res_IPR_Handler ( void )
{
   return TRUE;
}

void UART2_Enable ( void )
{

   adl_atCmdCreate( "AT+WMFM=0,1,2", FALSE, Res_WMFM1_Handler, "*", NULL );

   adl_atCmdCreate( "AT+IPR=4800", ADL_AT_PORT_TYPE( ADL_AT_UART2, FALSE ), Res_IPR_Handler, "*", NULL );

   adl_fcmSubscribe( ADL_FCM_FLOW_V24_UART2, fcmCtrlH, fcmDataH );
   
 }

#2

Hi DIP.

  1. Does it make a change if you set TRUE in ADL_PORT_TYPE() in adl_atCmdCreate() ?

  2. Is UART2 connected to Terminal Emulator (or any other terminal soft) ?

  3. As said in Wavecom AT commands documentation, UART2 does not provide all serial signals (only Tx, Rx, RTS, CTS). Could this be the problem ?

  4. What are the result for commands AT+WMFM=0,1,2 and AT+IPR=4800 ? And what does adl_fcmSubscribe() return ?

  5. Does the event ADL_FCM_EVENT_FLOW_OPENNED occur before you send the “AT” command with the timer ?

Well that’s all i can think about for the moment…