UART_access

The command in UART1 does not open UART3 (USB)
AT+WDU=1, “UART3”, 115200
ERROR

AT+WMFM=0,0,3
AT+WDU=1, “UART3”, 115200
ERROR

AT+WMFM=0,1,3
AT+WDU=1, “UART3”, 115200
ERROR

The command in UART2 too does not open UART3 (USB)
AT+WDU=1, “UART3”, 115200
ERROR

AT+WMFM=0,0,3
AT+WDU=1, “UART3”, 115200
ERROR

AT+WMFM=0,1,3
AT+WDU=1, “UART3”, 115200
ERROR

What I not correctly do?

Hiya,

What version of the firmware are you using?

R7.4 opens the USB port automatically - this is a change from earlier firmware.

Try using AT+WMFM=0,2 to determine the state of all ports (see section 8.12.5 in the R7.4 AT Users Guide).

Also, turn on extended errors using AT+CMEE=1 to get more diagnostics than simply ‘ERROR’.

ciao, Dave

version of the firmware R7.4a
WMP100

at
OK
at+wmfm=0,2
+WMFM: 0,2,1,1
+WMFM: 0,2,2,1
+WMFM: 0,2,3,0

OK

at
OK
at+cmee=1
OK
at+wmfm?
+WMFM: 0,2,1,1
+WMFM: 0,2,2,1
+WMFM: 0,2,3,0
+WMFM: 1,2,4,0
+WMFM: 1,2,4,1

OK
at+wdu=1,“UART3”,115200
ERROR

at+wmfm=0,0,2
OK
at
OK
at+wdu=1,“UART2”,9600
OK

AT+WDU is a custom command implemented by the sample; you have the source code - look at it to see what reasons could make it say, “ERROR”.

Debug it - add additional TRACE to see what’s going on…

s32 uart_open( char* identity, u32 speed )
{
   s32             handle;
   sUartSettings_t Settings;
   psGItfCont_t    pinterface;
   sUartEvent_t    events;
   sUartLc_t       lc;
   sUartFlowCtrl_t Fc;

   TRACE (( 1, "uart_open(UART%c,%d)",identity[4], speed ));
   /* Device */
   Settings.capabilities = NULL;
   Settings.identity = identity;
   Settings.role = UART_ROLE_NM;

   /* 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.event_handlers = &events;

   /* To retrieve the UART SP Interface */
   Settings.interface = &pinterface;

   /* Line Coding */
   lc.valid_fields = UART_LC_ALL;
   lc.rate         = (eUartRate_t)(UART_RATE_USER_DEF | speed );
   lc.stop         = UART_STOP_BIT_1;
   lc.parity       = UART_PARITY_NONE;
   lc.data         = UART_DATALENGTH_8;

   Settings.line_coding = &lc;

   /*------------------*/
   /* open UART device */
   /*------------------*/
   if( 0 < (handle = adl_OpenDevice( DF_UART_CLID, &Settings)) )
   {
      TRACE(( 1, "UART successfully opened" ));

      /* Locally store the uart interface */
      uart_itf = *pinterface;

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

      if( uart_itf.io_control( handle, IOC_UART_FC, (void*) &Fc) )
      {
         uart_itf.close( handle );
         TRACE((1, "ERROR : IOCTL FC Set"));
         handle = 0;
      }
   }
   else
   {
      TRACE(( 1, "Uart_Open : ERROR UART is not opened" ));
   }
   return handle;
}

09/12/10,02:33:19:352	ADL	1	Binary header at 00260000
09/12/10,02:33:19:384	ADL	1	OK - mtInit
09/12/10,02:33:19:384	ADL	1	adl_atCmdSubscribe return 0
09/12/10,02:33:19:384	ADL	1	OK - stInit
09/12/10,02:33:19:384	ADL	1	Wait for a Received Data......
09/12/10,02:34:21:806	ADL	1	+WDU Command Handler
09/12/10,02:34:21:806	ADL	1	uart_open(UART3,115200)
09/12/10,02:34:21:806	ADL	1	Uart_Open : ERROR UART is not opened

Debugging is an essential part of all software development!

Some tips here: 8052.com/faqs/120313

See also: embedded.com/design/testissu … edded_news