usb_descriptor: silently overwrites endpoint address #67869
Replies: 2 comments
-
The above behaviour of USB stack implementation is well described here so far: #67923 |
Beta Was this translation helpful? Give feedback.
0 replies
-
The soulition of this problem is on it's way to linux kernel: https://lore.kernel.org/all/[email protected]/T/ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear community,
I have here a topic to discuss with you and find proper solution for better code-quality in Zephyr RTOS project. Please take a look and give your opinion.
What?
I found out that piece of code in
usb_descriptor.c
silently overwrites USB EP address, if it does not match predefined pattern (e.g. the EP address shall match index in ep_descriptor array config).There were two issues opened #22455 and #67812. The latest issue is made by me and has step-by-step description, how to reproduce observed behaviour.
Putting everything compact:
Why?
In my understanding silent overwriting of explicitly set values in the running code leads to:
How?
Thus I try to suggest possible solution in three steps:
Determine if USB standard defines such behaviour. (Here I have to rely on help from people having deep understanding of USB standard)
Choose one or multiple of possible solutions (or suggest a new one):
LOG_DBG("Fix ep address...")
from debug to error output and assert the executionCONFIG_USB_DESCRIPTOR_ASSER_INVALID_EP_ADDR
) with default value set to true. Setting this value to true will mean wrong EP address will lead to assertion. Disabling this config setting will lead to current behaviour.Implement it. (I will be happy to implement it, if nobody willing to do so)
In case Zephyr's USB stack doing correct USB standard behaviour implementation, which is great, everybody will be happy. But there are still some
"bad guys"
(e.g. Linux drivers), which also shall be covered somehow.I thing, finding a solution to this problem will make Zephyr to be a choise of more and more people around the world!
Beta Was this translation helpful? Give feedback.
All reactions