# UARTs and FCM on Q2501

**URL:** <https://forum.sierrawireless.com/t/uarts-and-fcm-on-q2501/696>\
**Category:** General\
**Created:** [September 18, 2006, 12:52pm UTC](https://forum.sierrawireless.com/t/uarts-and-fcm-on-q2501/696 "2006-09-18T12:52:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![milan\_va](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@milan\_va](https://forum.sierrawireless.com/u/milan_va)\
**Post date:** [September 18, 2006, 12:52pm UTC](https://forum.sierrawireless.com/t/uarts-and-fcm-on-q2501/696/1 "2006-09-18T12:52:59Z")

</div>

Hello. I’m having big trouble with UARTs on Q2501B. What I want is to open a FCM flow on UART2 but I just cannot find all the needed steps in the procedure.  
I think it should be:

1. AT+WGPSCONF=0,0 //to set GPS in external mode
2. AT+CFUN=1 //to switch it actually
3. AT+WMFM=0,1,1 //open UART2
4. adl\_fcmSubscribe(ADL\_FCM\_FLOW\_V24\_UART2, …, …)

The problem is that after step 2., the NMEA frames keep coming from UART2 and it does not respond to AT commands.  
Another thing is that, after some experiments, I was able to close UART1, so that AT+WMFM? returns  
+WMFM: 0,2,0,0  
+WMFM: 0,2,1,0  
+WMFM: 1,2,4,0  
+WMFM: 1,2,4,1  
(note the first line) and I cannot turn it on again, not even using adl\_atCmdCreate(“AT+WMFM=0,1,0”, ADL\_AT\_PORT\_TYPE(ADL\_AT\_UART2, FALSE), …) (the debugger halts, application returns +CME ERROR: 3).  
It does not cause problems except that after AT+WGPSNMEA=1, I’m not getting the frames while it worked before I started fiddling with the module. (Of course I’ve set AT+WGPSCONF=0,1 back).

So to sum this up, I need

1. return UART1 to opened state, and
2. detach GPS from UART2 so I can send AT commands and subscribe to FCM.

TIA, Milan

---

<div class="post-metadata">

**Author:** ![dezzer](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@dezzer](https://forum.sierrawireless.com/u/dezzer)\
**Post date:** [September 18, 2006, 3:13pm UTC](https://forum.sierrawireless.com/t/uarts-and-fcm-on-q2501/696/2 "2006-09-18T15:13:49Z")

</div>

> [@](#):
>
> AT+WMFM=0,1,0

Why 0? According to AT Commands Interface Giude p. 359 you should use 1 for UART1 manipulations and 2 - for UART2. (But when you send AT+WMFM? numeration is different…)

PS It seems that detailed UART How-to is really required since questions in this section have much in common. Any volunteers? 🙂

---

<div class="post-metadata">

**Author:** ![milan\_va](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@milan\_va](https://forum.sierrawireless.com/u/milan_va)\
**Post date:** [September 19, 2006, 7:55am UTC](https://forum.sierrawireless.com/t/uarts-and-fcm-on-q2501/696/3 "2006-09-19T07:55:04Z")

</div>

Well I’ve noticed people are talking about it but I think I have an older firmware that numbers ports 0-based consistently. See:

> [@Q2501B](#):
>
> \< ati3
> 
> > 650a09gg.Q2501B 1949844 122204 14:53  
> > OK
> 
> \< at+wopen=2
> 
> > +WOPEN: 2,“AT v03.01”  
> > OK
> 
> \< at+wmfm?
> 
> > +WMFM: 0,2,0,0  
> > +WMFM: 0,2,1,1  
> > +WMFM: 1,2,4,0  
> > +WMFM: 1,2,4,1  
> > OK
> 
> \< at+wmfm=0,0,1
> 
> > OK
> 
> \< at+wmfm?
> 
> > +WMFM: 0,2,0,0  
> > +WMFM: 0,2,1,0  
> > +WMFM: 1,2,4,0  
> > +WMFM: 1,2,4,1  
> > OK
> 
> \< at+wmfm=0,2
> 
> > +WMFM: 0,2,0,0  
> > +WMFM: 0,2,1,0  
> > OK
> 
> \< at+wmfm=0,1,0
> 
> > +CME ERROR: 3
> 
> \< at+wmfm=0,1,2
> 
> > +CME ERROR: 3

I hate repetitive tasks too, I’m a programmer after all 8) , but first I need to know how it works…  
Also I couldn’t find anything specifically related to the GPS problem, can you?  
My application uses GSM calls, but that costs money, so I wanted to debug it using UART2 instead. I thought it should be easy but it’s not ☹

---

<div class="post-metadata">

**Author:** ![milan\_va](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@milan\_va](https://forum.sierrawireless.com/u/milan_va)\
**Post date:** [September 19, 2006, 9:46am UTC](https://forum.sierrawireless.com/t/uarts-and-fcm-on-q2501/696/4 "2006-09-19T09:46:10Z")

</div>

Now I think I’ve found the solution to the second problem. I was trying to read from GPS\_RXD0 instead of GSM\_RXD2 😊 . Now that I’ve connected to the right signals, UART2 seems to be working (at least for transmitting, but maybe I have a problem with my cable).  
So, only the first question remains: how to return the UART1 to Opened state?

---

<div class="post-metadata">

**Author:** ![dezzer](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@dezzer](https://forum.sierrawireless.com/u/dezzer)\
**Post date:** [September 19, 2006, 9:56am UTC](https://forum.sierrawireless.com/t/uarts-and-fcm-on-q2501/696/5 "2006-09-19T09:56:45Z")

</div>

> [@](#):
>
> So, only the first question remains: how to return the UART1 to Opened state?

What have you already tried to do it? I suppose you should just send at+wmfm=0,1,1 (or 0 in your case), but definitely not on UART1 itself (see notes in “AT+WMFM” documentation). Something like adl\_atCmdCreate(“AT+WMFM=0,1,1”, ADL\_AT\_PORT\_TYPE(ADL\_PORT\_UART2, FALSE), ResponseHandler, “\*”, NULL). I see you’ve tried something like this. Is it still not working after hardware changes?

---

<div class="post-metadata">

**Author:** ![milan\_va](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@milan\_va](https://forum.sierrawireless.com/u/milan_va)\
**Post date:** [September 19, 2006, 11:41am UTC](https://forum.sierrawireless.com/t/uarts-and-fcm-on-q2501/696/6 "2006-09-19T11:41:12Z")

</div>

I’m just getting +CME ERROR: 3 all the time ☹ Now I’m able to send AT commands through UART2 as well as through UART1, so I guess it’s all ready, but it simply does not work.

> [@On UART2 Milan](#):
>
> \< at+wmfm=0,1,0
> 
> > +CME ERROR: 3
> 
> \< at+wmfm=0,1,1
> 
> > +CME ERROR: 3
> 
> \< at+wmfm=0,1,2
> 
> > +CME ERROR: 3
> 
> \< at+wmfm?
> 
> > +WMFM: 0,2,0,0  
> > +WMFM: 0,2,1,1  
> > +WMFM: 1,2,4,0  
> > +WMFM: 1,2,4,1  
> > OK

Interesting is, that although I’m not getting unsolicited WGPSNMEA frames on UART1, the internal GPS functions (adl\_gpsGetPosition, MyGpsHandler()) are working fine 😮
