q&a.rst 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. Q & A
  2. ============================================
  3. Porting Question Template
  4. ------------------------------
  5. Please submit questions through the following channels:
  6. - RT-Thread Official Forum: https://club.rt-thread.org/ask/tag/5f5f851966917b14.html
  7. - Github issue: https://github.com/cherry-embedded/CherryUSB/issues/new/choose
  8. Please include the following information in your question:
  9. - Version being used
  10. - Board, pins, and USB IP being used
  11. - Whether USB interrupts, USB clock, USB pins, USB PHY configuration are configured, and whether USB register addresses are correct (include screenshots)
  12. - Whether USB interrupts are triggered
  13. - Whether the chip has cache functionality and whether no-cache processing has been implemented (include screenshots)
  14. - Whether USB circuit is drawn correctly, whether dupont wires are used for connection, whether direct connection is used; if normal, please explain why it's normal
  15. - If interrupts can be triggered, configure **#define CONFIG_USB_DBG_LEVEL USB_DBG_LOG** and provide logs (limited to commercial IPs only; other IPs are prohibited from enabling logs, otherwise enumeration will fail)
  16. - Whether the chip has been taped out and is being sold
  17. Other Question Template
  18. --------------------------------
  19. Specifically describe the phenomenon, reproduction method, test using my provided demo, and provide complete logs
  20. How Much Performance Can CherryUSB Achieve
  21. ----------------------------------------------------------------
  22. Reference: :ref:`performace_show`
  23. ST IP Naming Issues
  24. -------------------------
  25. ST naming uses USB_OTG_FS, USB_OTG_HS, which doesn't indicate whether it's actually high-speed or full-speed, but represents the maximum speed it can support (high-speed). Both are actually full-speed and require external high-speed PHY. Therefore, please avoid using these terms in questions; use USB0(PA11/PA12), USB1(PB14/PB15) instead. The same applies to other domestic manufacturers.
  26. GD IP Issues
  27. ------------------
  28. GD IP uses DWC2, but all hardware parameters read are 0 (I don't understand why they don't want people to know). Therefore, users need to know the hardware information themselves. Starting from version 1.5.0, because hardware information needs to be read, it cannot be used directly.
  29. Additionally, GD cannot use the EPDIS function to close endpoints after reset. Users need to delete the following code from the reset interrupt:
  30. .. code-block:: C
  31. USB_OTG_INEP(i)->DIEPCTL = (USB_OTG_DIEPCTL_EPDIS | USB_OTG_DIEPCTL_SNAK);
  32. USB_OTG_OUTEP(i)->DOEPCTL = (USB_OTG_DOEPCTL_EPDIS | USB_OTG_DOEPCTL_SNAK);
  33. There may also be other unknown bugs; please test yourself.
  34. Cannot enumerate after enabling USB_LOG_DBG
  35. ----------------------------------------------------------------
  36. Only commercial IPs can enumerate after enabling, other IPs are prohibited from enabling, otherwise enumeration will fail. Those who know, know.
  37. Which version to use for USB3 CV testing
  38. --------------------------------------------
  39. Version 1.4.3 and above
  40. Ep addr XXX fifo overflow
  41. ------------------------------
  42. .. figure:: img/question1.png
  43. This error indicates that the default FIFO space setting for this endpoint is insufficient and needs to be increased. This is commonly seen in DWC2/MUSB IP. Refer to relevant glue files for FIFO settings.
  44. Ep addr XXX overflow
  45. ------------------------------
  46. .. figure:: img/question2.png
  47. This error indicates that the IP hardware doesn't have that many endpoints. Please change IP or reduce endpoint usage.
  48. Of course, you can also modify to bidirectional endpoints. Considering that not all IPs support bidirectional endpoints, the default demo doesn't implement bidirectional functionality. For example, the default is 81 02 rather than 81 01. If supported, modify it yourself. Some IP bidirectional endpoints may occupy the same hardware information and may not be usable simultaneously, please check yourself.
  49. This dwc2 version does not support dma mode, so stop working
  50. ----------------------------------------------------------------
  51. This DWC2 version doesn't support DMA mode, prohibited from use. Not using DMA mode will frequently trigger NAK interrupts (about every tens of microseconds), causing excessively high CPU usage.
  52. Which chips support OTG
  53. ------------------------------
  54. Currently, only HPM chips support OTG functionality in the mainline, automatically switching between host/device modes via ID pin. For other chips, please use manual switching mode OR implement ID recognition driver yourself.
  55. How to change PC-recognized COM port name
  56. ----------------------------------------------------------------
  57. This is a Microsoft CDC ACM driver issue that cannot be modified. If modification is needed, please contact Microsoft, pay fees, and write driver to make changes.
  58. Connect and disconnect events not triggering
  59. ----------------------------------------------------------------
  60. Currently only HPM chips support connect and disconnect events. For other chips, please use USB VBUS detection circuit. DWC2 IP supports it, but because it requires pin usage and most are log ports, and different enabling configurations vary, support is not provided.
  61. __has_include error
  62. ------------------------------------------------------------------
  63. If error occurs, compiler needs to support C99 syntax. If using Keil, please use AC6 compiler.
  64. When to use CONFIG_USB_HS
  65. ----------------------------------------------------------------
  66. Enable when your chip hardware supports high speed and you want to initialize in high-speed mode. Related IP will configure internal or external high-speed PHY based on this macro.
  67. Failed to enable port
  68. ----------------------------------------------------------------
  69. Insufficient power supply or hardware USB circuit issues
  70. Porting USB host encounters URB return -12/-14
  71. ----------------------------------------------------------------
  72. Check PHY configuration, cache configuration (if any), power supply (recommend self-powered)
  73. USB_ERR_NAK explanation
  74. ----------------------------------------------------------------
  75. USB_ERR_NAK only exists in DWC2 buffer DMA/slave mode (we don't use slave mode). DWC2 in buffer DMA mode doesn't support hardware handling of NAK interrupts for interrupt transfers, requiring software handling, resulting in very frequent NAK interrupts. Recommend using with timer.
  76. DWC2 scatter/gather DMA mode is fully handled by hardware but doesn't support split transfers. In summary, **tasteless to eat, pity to discard**.
  77. USB host connecting USB network adapter issues
  78. ----------------------------------------------------------------
  79. Manifests as network adapter recognition and IP address allocation but inability to ping. This is because the network adapter itself needs to enable auto-dial, usually requiring AT port settings. Specifically for EC20/ML307 modules.
  80. When to enable CONFIG_USB_DCACHE_ENABLE
  81. -------------------------------------------------
  82. Enable this macro when chip has cache functionality and doesn't use no-cache RAM to ensure data consistency. **When using EHCI, nocache RAM is still needed internally**. Usually, for third-party platforms or components that don't use no-cache RAM macros but use global variables or malloc operations, this RAM typically goes through cache, requiring this macro. Recommend mandatory enabling for third-party platform usage.
  83. Which IPs have data alignment requirements
  84. -------------------------------------------------
  85. - When CONFIG_USB_DCACHE_ENABLE is not enabled, only DWC2/WCH/AIC IP requires 4-byte alignment, others need only 1-byte alignment.
  86. - When CONFIG_USB_DCACHE_ENABLE is enabled, all IPs need alignment to CONFIG_USB_ALIGN_SIZE bytes