- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello.
I'm using CYW943907AEVAL1F eval board.
I have to develop a project that creates a thread that
waits USB request using "ux_device_class_cdc_acm_read" and sends USB answer using "ux_device_class_cdc_acm_write".
Requests are small packets (8 bytes), answers are small packets (8 bytes).
In another thread I have send 512byte packets every ms (512kBps) using "ux_device_class_cdc_acm_write".
Since "ux_device_class_cdc_acm_write" is called from two different threads ... I have to use Mutex ?
Or "ux_device_class_cdc_acm_write" is thread safe ?
Is there a way to create two endpoints and sends answers in one endpoint and packets in the other ?
Solved! Go to Solution.
- Labels:
-
ispn:38946:1:0
-
l1:314:1:0
- Tags:
- thread safe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
"ux_device_class_cdc_acm_write" is a standard device class API of USBx stack. This function is called when an application needs to write to the IN data pipe (IN from the host, OUT from the device). It is blocking in nature. You can easily find this function's implementation in usbx repository in github. I provide you the link for the same-->
usbx/ux_device_class_cdc_acm_write.c at master · azure-rtos/usbx · GitHub
In the implementation, you'll find the function "_ux_utility_mutex_on" and "_ux_utility_mutex_off". So, I suppose it's thread safe and you won't need mutex implementation. The API is a standard API from a third party stack, so you can probably go through their documentation for more information. I hope this helps!
Thanks
Aditi