Can`t swich UART1 to DataMode


#1

Hello. I have Fastrack Supreme 10, frimware 6.63. UART2 use in DataMode. I Can`t swich UART1 to DataMode. Prompt how to transfer the data (uart1).

void SwitchUART1ToATMode ()
    {
           adl_fcmSwitchV24State (UART1Handle, ADL_FCM_V24_STATE_AT);    
    }

void SwitchUART1ToDataMode ()
    {
         adl_fcmSwitchV24State (UART1Handle, ADL_FCM_V24_STATE_DATA);
    }

bool UART1CtrlHandler (adl_fcmEvent_e event)
    {
          
        switch (event) {

           case ADL_FCM_EVENT_FLOW_OPENNED:
               if ( adl_atCmdCreate ("AT+IPR=115200",ADL_AT_PORT_TYPE(ADL_PORT_UART1, FALSE), NULL, NULL))
                    {
                            adl_atSendResponse(ADL_AT_RSP, "\n\r AT+IPR=115200 ok! \n\r"); 
                    }
               if ( adl_atCmdCreate ("AT+ICF=3,4",ADL_AT_PORT_TYPE(ADL_PORT_UART1, FALSE), NULL, NULL))
                    {
                            adl_atSendResponse(ADL_AT_RSP, "\n\r AT+ICF=3,4 ok! \n\r"); 
                     }
           break;
    

       
           case ADL_FCM_EVENT_V24_DATA_MODE:
           break;
               
           case ADL_FCM_EVENT_V24_AT_MODE:
           break;
               
           case ADL_FCM_EVENT_MEM_RELEASE:
           break;
                
                       }
                                
       return TRUE;
};



void AtRecData (adl_atCmdPreParser_t *p)
    {
       SwitchUART1ToDataMode();
       SwitchUART1ToATMode();
   };

After function call AtRecData FS10 Ceases to respond to commands through UART1.


#2

Your code is virtually illegible! Please re-post it using the proper ‘Code’ formatting tags.

Check it in the ‘Preview’ before you press the ‘Submit’ button…

There is a forum user guide here: viewtopic.php?f=24&t=27


#3

The code has corrected, I hope so it will be more clear.


#4

Not really - there’s too much missing!

However:

void AtRecData (adl_atCmdPreParser_t *p)
    {
       SwitchUART1ToDataMode();
       SwitchUART1ToATMode();
   };

Won’t work - you need to wait for the event that indicates when the switch has completed…


#5

I should process event ADL_FCM_EVENT_V24_DATA_MODE in the beginning?

Whether use both UART simultaneously, in a data transmission mode is possible?


#6

Look at the complete list of events, and ensure that you process all events relevant to anything you do - opening the flow, switching between AT and Data mode, etc, etc…

Don’t do anything before you have received any event that indicates when the previous operation has completed!

The UARTS are completely independent.


#7

Thanks for advice, have earned all.

Whether there is a delay function?


#8

You can use a Timer, or later versions of ADL have adl_ctxSleep()

I suggest that you take some time to familiarise yourself with the contents of the ADL User Guide


#9

Thanks for the help, the program has started to work. The subject can be closed.


#10

hi Oleg_mpm,
i am working on same thing i am facing lots of problem i am new to this q2686 module can u help me out…can u copy the working code


#11

Hi everyone!!, im new in Wavecom and i tried t run Telemetry sample in my Q2686 with some problems with the registration. When i sen AT+CREG the answer is always +CREG=0,2, then i send AT+CREG=1 and then +CREG=1,2.

It seem that my module cant register, but my SIM card works fine in a cellphone, what can i do?.

Thanks for advance!.


#12

nicool67, your question doesn’t seem to have anything to do with this particular thread of discussion - “Can`t swich UART1 to DataMode” - does it?

For a new question, you should start a new thread.

There is a User’s Guide to the forum here: viewtopic.php?f=24&t=27