USBUART_1_CDCIsReady()   is blocking?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

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
 

0 Likes
3 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You disable all interrupts and expect that the component still works.... Imho that will not fit together.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thank you. Enabling the global interrupts again around my for loop works, and allows it to send bytes again. 

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Glad that I could help you!

   

 

   

Bob

0 Likes