# switch from Data mode to AT mode (FCM)

**URL:** <https://forum.sierrawireless.com/t/switch-from-data-mode-to-at-mode-fcm/8660>\
**Category:** Development tools\
**Created:** [July 14, 2016, 2:48pm UTC](https://forum.sierrawireless.com/t/switch-from-data-mode-to-at-mode-fcm/8660 "2016-07-14T14:48:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirilantevski](https://avatars.discourse-cdn.com/v4/letter/k/e8c25b/32.png) [@kirilantevski](https://forum.sierrawireless.com/u/kirilantevski)\
**Post date:** [July 14, 2016, 2:48pm UTC](https://forum.sierrawireless.com/t/switch-from-data-mode-to-at-mode-fcm/8660/1 "2016-07-14T14:48:05Z")

</div>

Hi to everyone, I am new to Open AT. I am using GL6100 RS323 device.  
I wanted to test the serial communication using the example code on FCM from Open AT Tutorial where the following code stucked me in the Data mode.  
I could not find solution here on the forum.

How can I erase the program or stop it before it boots?  
Once the program runs, I can not access the AT commands in order to stop the application. The application is halted anyway.  
Any solution?

```auto
#include "adl_global.h"
const u16 wm_apmCustomStackSize = 4096;
/* Global variable */
u8 Handle; //FCM handle
bool fcmCtrlH (adl_fcmEvent_e event );
bool fcmDataH (u16 DataLen, u8 * Data);
void adl_main (adl_InitType_e InitType )
{
Handle=adl_fcmSubscribe(ADL_FCM_FLOW_V24_UART1,fcmCtrlH, fcmDataH);
TRACE (( 1, "Embedded Application: Main" ));
}
bool fcmCtrlH ( adl_fcmEvent_e event )
{
TRACE ((1, "Control event received --> %d", event));
switch(event)
{
case ADL_FCM_EVENT_FLOW_OPENNED:
TRACE (( 1, "Flow Opened" ));
/* Switching V24 state from AT to Data. */
adl_fcmSwitchV24State(Handle, ADL_FCM_V24_STATE_DATA);
break;
case ADL_FCM_EVENT_V24_DATA_MODE:
TRACE (( 1, "Flow in Data Mode" ));
/* sending data to the external application via V24 serial link */
adl_fcmSendData(Handle, "This is a test case", 20);
break;
}
return TRUE;
}
```

---

<div class="post-metadata">

**Author:** ![kirilantevski](https://avatars.discourse-cdn.com/v4/letter/k/e8c25b/32.png) [@kirilantevski](https://forum.sierrawireless.com/u/kirilantevski)\
**Post date:** [July 15, 2016, 3:01pm UTC](https://forum.sierrawireless.com/t/switch-from-data-mode-to-at-mode-fcm/8660/2 "2016-07-15T15:01:48Z")

</div>

Solved it.  
In case you get blocked into Data mode use just the escape command (+++):

1. Power on device, connected to serial
2. In the console command type:

```auto
+++
```

1. Press Enter

You may have to repeat steps 2 and 3 several times.

The device should return OK  
Then you can stop the app with:

```auto
at+wopen=0
```

After that reset and delete the application
