Hi,
I’m trying to use the UART2 of my Q2406B module.
I did activate the UART2 and checked it through AT interface:
at+wmfm?
+WMFM: 0,2,1,1
+WMFM: 0,2,2,1
+WMFM: 1,2,4,0
+WMFM: 1,2,4,1
I got UART2 connected to a device sending data at 4800bps.
First I followed jan’s topic instructions to set the speed up on the serial port:
adl_atCmdCreate( "AT+IPR=4800", ADL_AT_PORT_TYPE( ADL_AT_UART2, FALSE ), Res_IPR_Handler, "*", NULL );
In the handler i can see the response of the module is “OK”.
Now i subscribe to the fcm handler:
HandleUART2 = adl_fcmSubscribe( ADL_FCM_FLOW_V24_UART2, UART2fcmCtrlH, UART2fcmDataH );
And in the Control handler i receive the event which indicates that the flow was correctly opened. Then i switch to DATA Mode and the Control handler is called again with the event indicating that it went to DATA MODE.
However, the DATA handler is never called as if it didn’t receive anything.
Any hints please?
EDITED
I’ve spent the whole day trying things with UART2 and have observed something:
If I send data using:
adl_atSendResponse(ADL_AT_PORT_TYPE(ADL_AT_UART2,ADL_AT_RSP),buffer);
it works. However since I need to use raw data and try to send it with
adl_fcmSendData i experiment the following behavior:
When i call this function first i get the next message:
ADL_FCM_RET_OK_WAIT_RESUME
According to the documentation it means: Success, but the last credit was used.
Now i am supposed to wait for ADL_FCM_EVENT_RESUME in my control handler but it doesn’t arrive.
Of course the next times i try to send data the error code is as follows:
ADL_FCM_RET_ERR_WAIT_RESUME
which means that the flow’s got no more credit to use.
I don’t know how to sort this out, could please anybody help me?
Thanks,
Daniel