- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I use the FX3 to receive the data of camera chip to PC by USB3.0, so I refer the UVC - AN75779 document & example to design the mechanism.
I can use the CyU3PGpifRegisterCallback() to trigger a callback from State Machine - "INTR_CPU", and it's work to receive the data and show on PC.
However, if I replace the CyU3PGpifRegisterCallback() to CyU3PGpifRegisterSMIntrCallback(), it's not work anymore...
The callback will never be triggered, and it causes that the PC cannot receive any data.
Register code:
Callback code:
In the API document, it mentions "Please note that API calls that require a mutex get or equivalent cannot be directly called from this callback function.", but I don't know the meaning, and don't find any mutex for that in the AN75779 example.
Do I miss something? Hope anybody could provide me some suggestion!
Thanks a lot!
Hughes
[Environment]
Chip: CYUSB3014
SDK version: v1.33
DMA mode: auto DMA
Solved! Go to Solution.
- Tags:
- fx3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hughes,
1) Yes, CyU3PDmaSocketSetWrapUp() does not use mutexget() function in it's implementation and can be used with CyU3PGpifRegisterSMIntrCallback.
2) To know an API's implementation, you can refer to the source files in the SDK
Path: C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\fx3_sdk_1_3_4_src\fx3_sdk_1_3_4_src\FX3
Regards,
Rashi
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
As you said, the API document mentions "Please note that API calls that require a mutex get or equivalent cannot be directly called from this callback function." This means that an API, in which "mutex get" (function) is used, cannot be called directly in the Callback function.
In your case, the callback function uses CyU3PDmaMultiChannelSetWrapUp & CyU3PDebugPrint() APIs and both of them call "mutex get" function in their implementation. This means you can not use CyU3PDmaMultiChannelSetWrapUp & CyU3PDebugPrint() API call in call back function if you are using CyU3PGpifRegisterSMIntrCallback().
Regards,
Rashi
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear RashiV_61:
Thanks for your reply!
I referred the AN75779 example which use the CyU3PDmaSocketSetWrapUp() rather than CyU3PDmaMultiChannelSetWrapUp() inside the CyU3PGpifRegisterSMIntrCallback.
It works! Thank you!
Now, I want to clarify 2 things:
1.it means that the CyU3PDmaSocketSetWrapUp() is NOT a "mutex get" function, so it's valid inside the CyU3PGpifRegisterSMIntrCallback?
2.I cannot find any document to indicate the CyU3PDmaMultiChannelSetWrapUp() & CyU3PDebugPrint() is a "mutex get" function. How to recognize whether a function is a "mutex get" or not?
Thanks a lot!
Hughes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hughes,
1) Yes, CyU3PDmaSocketSetWrapUp() does not use mutexget() function in it's implementation and can be used with CyU3PGpifRegisterSMIntrCallback.
2) To know an API's implementation, you can refer to the source files in the SDK
Path: C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\fx3_sdk_1_3_4_src\fx3_sdk_1_3_4_src\FX3
Regards,
Rashi
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear RashiV_61:
Thanks for reply!
I referred the "FX3APIGuide.pdf" and found the return value of CyU3PDmaMultiChannelSetWrapUp() with the mutex description, so I guess I could use it as a judgement.
Thanks for your specialized reply!
Hughes