- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You disable all interrupts and expect that the component still works.... Imho that will not fit together.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you. Enabling the global interrupts again around my for loop works, and allows it to send bytes again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Glad that I could help you!
Bob