3 Replies Latest reply on Dec 3, 2015 12:23 PM by user_1377889

    USBUART_1_CDCIsReady()   is blocking?

    neal.o'hara

      Hello,
      I need some help with this ASAP.
      I have a problem with some USB_UART communicaton, in the project attached here (which runs a 5LP dev board.)
      In usbuart.c  I have a function  USB_Work that handles  normal  uart communication just like the examples do it, by checking the configuration,  receiving PC sent data, and echoing data back to PC with 
      while(USBUART_1_CDCIsReady() == 0u);    /* Wait till component is ready to send more data to the PC */ 
      USBUART_1_PutData(buffer, count);
      this works fine.
      I parse the in buffer for some commands (in CopyBytes function). When I get certain values (AA, BB, DADA), I execute other functions. These parsing all work. 
      My DADA function (called readlog) is designed to send a datalog I've kept over time out over the USB_Uart.  I thus then try to loop over the values I need to send, and call 
      while(USBUART_1_CDCIsReady() == 0u);    /* Wait till component is ready to send more data to the PC */ 
      USBUART_1_PutData( (uint8 *) &read_values, RECORD_LENGTH);       /* Send data back to PC */

      This, I can see is physically entered, both by and led and an LCD print statement right before the first while(), but it hangs on the while, never releasing.
      There is nothing about the UART functionality that I can see should block this from running, so it must be something about the back to back  USBUART_1_CDCIsReady()  call, but I don't know what, or how to fix this issue.
      Can you offer any advice?
      Thank you, sincerely