UART2 problem


#1

Hi,

My problem with UART2 is that I can’t see the data in Terminal Emulator. I saw the other threads with regard to UART2 but i can’t find the answer.
ADL_FCM_EVENT_MEM_RELEASE is the case in which the data is sent, but i don’t see the data in Terminal Emulator. I’ m using Fast Track SUpreme 20.
This my code:
static s8 FCM;
static s8 FCMV24;
static s8 fcmData;
static s8 Ipr, Wmfm;
adl_fcmFlow_e flow = ADL_PORT_UART2;

bool HandleWmfmUart2(adl_atResponse_t *response);

void SendData(u8 Id)
{
u8 data[10] = “asdasd”;
u16 dataLen = sizeof(data);
fcmData = adl_fcmSendData(FCM, data, dataLen);
}

bool CtrlHandler(adl_fcmEvent_e event)
{
switch( event )
{
case ADL_FCM_EVENT_FLOW_OPENNED :
TRACE(( 1, “ADL_FCM_EVENT_FLOW_OPENNED\n”));
FCMV24 = adl_fcmSwitchV24State(FCM, ADL_FCM_V24_STATE_DATA);
TRACE(( 1, “adl_fcmSwitchV24State = %d”, FCMV24));
break;

    case ADL_FCM_EVENT_V24_DATA_MODE :
        TRACE(( 1, "ADL_FCM_EVENT_V24_DATA_MODE\n"));
        adl_tmrSubscribe(TRUE, 100, ADL_TMR_TYPE_100MS, (adl_tmrHandler_t)SendData);            
        break;
        
    case ADL_FCM_EVENT_V24_AT_MODE :
    case ADL_FCM_EVENT_V24_AT_MODE_EXT:
        TRACE(( 1, "ADL_FCM_EVENT_V24_AT_MODE\n"));
        
        FCMV24 = adl_fcmSwitchV24State(FCM, ADL_FCM_V24_STATE_AT);

        break;
        
    case ADL_FCM_EVENT_FLOW_CLOSED:
        TRACE(( 1, "ADL_FCM_EVENT_FLOW_CLOSED\n"));
        adl_fcmUnsubscribe(FCM);
        break;
        
    case ADL_FCM_EVENT_RESUME :
        TRACE(( 1, "ADL_FCM_EVENT_RESUME\n"));
        break;
        
    case ADL_FCM_EVENT_MEM_RELEASE :
        TRACE(( 1, "ADL_FCM_EVENT_MEM_RELEASE\n"));
        
        break;
}

}

bool DataHandler(u16 DataLen, u8 * Data)
{
TRACE(( 1, “DataHandler\n”));
return TRUE;
}

bool HandleWmfmUart2(adl_atResponse_t * response)
{
TRACE (( 1, “HandleWmfmUart2Enable\n” ));
FCM = adl_fcmSubscribe(flow, CtrlHandler, DataHandler);
TRACE(( 1, “adl_fcmSubscribe= %d”, FCM));
return FALSE;
}

bool HandleIPR(adl_atResponse_t * response)
{
TRACE(( 1, “HandleIPR\n”));
return FALSE;
}

void adl_main ( adl_InitType_e InitType )
{
TRACE (( 1, “Embedded Application : FCM\n” ));

Wmfm = adl_atCmdCreate("AT+WMFM=0,1,2", FALSE, HandleWmfmUart2, "*", NULL);
TRACE(( 1, "adl_atCmdCreate(AT+WMFM)= %d", Wmfm));
   
Ipr = adl_atCmdCreate("AT+IPR=115200", ADL_AT_PORT_TYPE(flow, FALSE), HandleIPR, "*", NULL);
TRACE(( 1, "adl_atCmdCreate(AT+IPR)= %d", Ipr));  

}

Thanks