AT+CFUN=1 RTK error

Hi

I’m using a Q2687 modem, and I want to restart the modem with an AT+CFUN=1 call from software. I’m currently checking the state of a pin. If the pin goes from low to high, the modem should restart but I get the following RTK error…

10/10/30,08:59:11:968 RTK 1 Except RTK …191 2 2

When the state of the pin changes, the function below is called. The state of the pin is checked with the ioReadSingle function. And depending on the state of the pin and the previous state, the modem must do a restart. But the RTK error keeps haunting me,no matter what I try.

Any help would be appreciated :slight_smile:

void MyGpioEventHandler ( s32 GpioHandle, adl_ioEvent_e Event, u32 Size, void * Param ){

	int waste;
	s8 checker;

	// Check event
	switch ( Event )
	{
		case ADL_IO_EVENT_INPUT_CHANGED :
		{
			pin_state = adl_ioReadSingle (GPIO33_Handle, &GpioConfig_33 );

			if((pin_state==1) && (prev_pin_state==0)){

				if(Flashwrite_Handler(6)==0){
					restart_now=1;
					checker = adl_atCmdSend("CFUN=1",NULL);
				}
			}else{
				prev_pin_state=pin_state;
			}
		}
		break;
	}
}

Maybe it doesn’t like doing that AT Command within the event handler?

Have you tried moving it out of the handler?

eg, start a 1-tick timer, and do the restart in the timer handler?

Or, what happens if you just do AT+CFUN=0 in the GPIO event handler, and then restart from the response handler…?

Just noticed a big mistake:

The first parameter needs to be the full AT Command; ie, “AT+CFUN=1”

To what value are you setting wm_apmCustomStackSize?