Can not open UART2 on Q2686H


#1

I’m trying to open UART2 fcm handle using OpenAT 4.01 and OS 6.61 betta on Q2686H. This is my code:

//**************************************************
s8 UART2_Handle;

bool hnd_fcmData_U2 ( u16 DataSize, u8 * Data );
bool hnd_fcmCtrl_U2 ( adl_fcmEvent_e Event );


void UART2_Enable(void)
{
UART2_Handle = adl_fcmSubscribe( ADL_FCM_FLOW_V24_UART2 |
ADL_FCM_FLOW_SLAVE, hnd_fcmCtrl_U2, hnd_fcmData_U2);
if (UART2_Handle < 0)
adl_atSendResponse ( ADL_AT_UNS, “\r\n>> UART2_Enable Error!!!\r\n”);
}

//*******************************************************

UART2_Handle always lover then zero. The same code works correctly with UART1 (without ADL_FCM_FLOW_SLAVE flag).

Am I doing something wrong or UART2 simply doesn’t work in this OS?


#2

Hi Amat
You must first activate 2nd Uart with
AT+WMFM=0,1,2

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

Best regards
Walter


#3

I tryed to send AT+WMFM=0,1,2 to my Q2686H, it returns ERROR!


#4

I tryed to send AT+WMFM=0,1,2 to my Q2686H, it returns ERROR!


#5

I tryed to send AT+WMFM=0,1,2 to my Q2686H but it returned ERROR! My code also doesn’t work…


#6

Hi amat79,

ERROR could mean that the port is already open. Try at+wmfm? to see if it is open…

Best Regards,
Jan


#7

This is the fragment of my HyperTerminal log:

at+wmfm?
+WMFM: 0,2,1,1
+WMFM: 0,2,2,1
+WMFM: 0,2,3,0
+WMFM: 1,2,4,0
+WMFM: 1,2,4,1

OK
at+wmfm=0,1,1
ERROR
at+wmfm=0,0,1
ERROR

And as I wrote in manual UART2 enables with AT+WMFM=0,1,1.

#8

You pasted the answer yourself! The port is open. You can’t open a port that is already open. Just like on any other operating system. Close it first, then you will be able to open it again.