Open UART with open AT in Fastrack supreme 20


#1

HI,

I try to make an application who send in the serial port (in 38400 bauds) any packet who arrived from an IP server whith GPRS connection.

I have a probleme to write in serial port after open it with adl_open (In Target Release mode).

If I open UART2, I have a corect handle but when I try to write or to change FlowControl, the application restart.
If I try to open UART1, my handle is set to -1.

here is my open function:

sUartSettings_t settings;
    sUartLc_t       line_coding;
    sUartEvent_t    events;
    sUartFlowCtrl_t Fc;

	// Set the line coding parameters
	  line_coding.valid_fields = UART_LC_ALL;
	  line_coding.rate = (eUartRate_t)( UART_RATE_USER_DEF | 115200 );
	  line_coding.stop = UART_STOP_BIT_1;
	  line_coding.data = UART_DATALENGTH_8;
	  line_coding.parity = UART_PARITY_NONE;

	  /* Events */
	   events.user_data = (void*)0;
	   events.valid_cb = UART_CB_ON_ALL;
	   memcpy((u8*)events.cb_list, (u8*)uartCbTab, 6*sizeof(sGCbDesc_t));

	  settings.identity = "UART2";
	  settings.role = UART_ROLE_NM;
	  settings.capabilities = NULL;
	  settings.event_handlers = &events;
	  settings.interface = &uart_if;
	  settings.line_coding = &line_coding;

	  uart_hdl = adl_odOpen( DF_UART_CLID, &settings );

	  if( !uart_hdl )
	  {
			adl_atSendResponse ( ADL_AT_INT, "SERIAL PORT ERROR\n");

			// UART2 opening failed...
			return;
	  }

	  /* Flow control IO control setting */
	  Fc.op   = G_IOC_OP_SET;
	  Fc.type = UART_FC_NONE;

	  if( uart_itf.io_control( uart_hdl, IOC_UART_FC, (void*) &Fc) )
	      {
 	         uart_itf.close( uart_hdl );
 	         TRACE((1, "ERROR : IOCTL FC Set"));
 	         uart_hdl = 0;
 	      }

Can anyone could help me? Or someone have other Idea to do it? (I already try with FCM but it says that UART isn’t avaible).

Thanks in advance


#2

Hi, i have the same problem with UART1.
i’m just runing a sample from SDK OpenAT\OS\6.20.04\ADL\samples\UART_access\ on Fastrack Supereme in Target mode.

  • uart_itf.io_control causes module to restart.
    Wavecome support is keepieng silence… , if you have solved this issue please be so kind to share ,
    regards

#3

Can you use the old, tried & trusted FCM (Flow Control Manager) instead?


#4

Hello,
Did you mean that sample provided in OpenOS AT SDK not tried and not trusted?
With such support and such documentation its very difficult to make something working, i do my best but i’m very limited in time
P.S. and your replies is less informative than header of the post.
regards


#5

It has been known! :angry:

Also, as it’s a new feature, it cannot be as extensively “tried and trusted” as the older feature - can it?


#6

It has been known! :angry:

I need technical support but instead you makes me look like a complete idiot :confused: anyway thanks for FCM


#7

Hi all,

I experience the same pb on 2686H module.The result of the function “adl_OpenDevice” with “UART1” is -1.
Tsarapin, do you solve the pb?

thanks for help,
Regards,


#8

ecoprocess, I had the same problem when I tried to use adl_OpenDevice on UART2. Finally I found that UART port you want to open must be closed with AT+WMFM command (in my case it was opened because at first I used FCM service). I think it is done to prevent using FCM and Device service together. I.e. to open UART1 you should first execute AT+WMFM=0,0,1. And I think that at first you’d need to open UART2 port to have an ability to still execute AT commands.


#9

thanks noim. I have tested it and it works fine.
Be carefull, close state is stored in eeprom. The open AT application should open an other way to accept AT command (UART2 as you suggest).
A reset not reallocate UART1 to FM.