This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I have a question about the following 5 lines of Workarround in Errata USB10.
---Excerpt from Errata Guide---
USBIEPCNF_0 &= ~EPCNF_UBME; // Clear ME to gate off SETUPIFG clear event
USBOEPCNF_0 &= ~EPCNF_UBME; // Clear ME to gate off SETUPIFG clear event
USBIFG &= ~SETUPIFG; // clear the interrupt bit
USBIEPCNF_0 |= EPCNF_UBME; // Set ME to continue with normal operation
USBOEPCNF_0 |= EPCNF_UBME; // Set ME to continue with normal operation
-----------------------------------------------
In the above contents, I would like to confirm why SETUPIFG and UBME are cleared and set.
In other words, does clearing and setting SETUPIFG and UBME prevent the errata from occurring?
Thanks,
Astro
Hi Astro
>> does clearing and setting SETUPIFG and UBME prevent the errata from occurring?
Yes.
The Errata behavior can be prevented altogether by clearing the UBME bit immediately before clearing SETUPIFG, and setting it again immediately after.
Disable EP0 before clear of SETUPIFG and re-enable afterwards
Hi, Xiaodong
Lines 1 and 2 in the source code disable EP0 by disabling input endpoint 0 and output endpoint 0.
And after clearing SETUPIFG on line 3, EP0 is enabled by enabling input endpoint 0 and output endpoint 0 again.
Is the above understanding correct? Also, can you tell me why this action clears the errata?
--
USBIEPCNF_0 &= ~EPCNF_UBME; // Clear ME to gate off SETUPIFG clear event
USBOEPCNF_0 &= ~EPCNF_UBME; // Clear ME to gate off SETUPIFG clear event
USBIFG &= ~SETUPIFG; // clear the interrupt bit
USBIEPCNF_0 |= EPCNF_UBME; // Set ME to continue with normal operation
USBOEPCNF_0 |= EPCNF_UBME; // Set ME to continue with normal operation
---
Thanks,
Astro
Hi Astro
I can't explain much more than the Errata description because this Errata is long time before.
I think these code lines are for disable EP0 before clear of SETUPIFG and re-enable afterwards to correct SETUPIFG synchronization scheme in USB buffer manager.
Thanks!
**Attention** This is a public forum