cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

vim_2255711
New Contributor II

Dear All,

For us  write data from GPIF II to Storage Port(through FatFs) and USB simultaneously.  Earlier we have done with MANUAL IN to write on storage port using Fatfs, now we need to push to USB too.

For this what I did was,  created DMA MANUAL CHANNEL, here the consumer is CY_U3P_UIB_SOCKET_CONS_1 and registered a callback function, once  DMA event notification hits the callback func, I tried to send an even from that callback, but am not able to receive the event in another thread and also no error.  The call back hits up to 8 times for this I added a counter and displayed.

In DMA MANUAL CHANNEL configuration can we send the events or send Q to other threads. from call back function?

0 Likes
1 Solution
vim_2255711
New Contributor II

We are able to achieve this using the DMA MANUAL option, receiving the events and Q messages now, Only I see that writer thread even timeouts due to the Host side read is slow.

View solution in original post

0 Likes
4 Replies
YashwantK_46
Moderator
Moderator

Hello,

Can you please share your firmware so that we can review it on our end?


Events can be used for inter-thread communication and they can be set in the callback function as well.

Are you sending the same buffer that you are committing to the Storage port to the USB socket as well in the callback function?

Regards,

Yashwant

0 Likes
vim_2255711
New Contributor II

Yashwant, I am sending the input->buffer_p. buffer pointer using CyU3PQueueSend API and raise an event to the writer thread from the CB function, where writer thread will receive the buffer and give it to Fatfs. So my idea was, once I receive the buffer from Q receive in the writer thread, give it to fatfs and commit the buffer to USB using commit API.  But first of all, I am not able to receive the event at all in the writer thread.

For MANUAL-IN  DMA channel selection I was able to send an event and receive  Q data and write to FatFs and discard.

0 Likes
vim_2255711
New Contributor II

We are able to achieve this using the DMA MANUAL option, receiving the events and Q messages now, Only I see that writer thread even timeouts due to the Host side read is slow.

View solution in original post

0 Likes
YashwantK_46
Moderator
Moderator

Hello,

Apologies for the delay.

Happy to hear that the events are working correctly now.


Can you please elaborate on what is the issue that you are facing now?

Regards,
Yashwant

0 Likes