Skip to content

drivers: usb: udc: common: log requested endpoint configuration#106167

Merged
nashif merged 1 commit intozephyrproject-rtos:mainfrom
mathieuchopstm:topic/udc_common_log_requested_ep_config
Apr 15, 2026
Merged

drivers: usb: udc: common: log requested endpoint configuration#106167
nashif merged 1 commit intozephyrproject-rtos:mainfrom
mathieuchopstm:topic/udc_common_log_requested_ep_config

Conversation

@mathieuchopstm
Copy link
Copy Markdown
Contributor

In ep_check_config(), capabilities of the endpoint provided by the driver are logged, but not the requested endpoint configuration. As a result, when the function fails, it is not possible to determine why using only logs.

Add logging of the requested configuration in addition to the driver caps to allow easily determining the cause of the failure (when logging is on).


This is something I had to manually patch in several time when debugging USB issues so I think it's a good addition, especially since it has no additional cost when logging is not enabled (or under LOG_LEVEL_DBG).

It can also be very useful in situations such as #105151 where a specific configuration is required for certain use cases, but the driver has no chance to emit a vendor-specific warning since the stack preemptively fails udc_ep_enable().

In `ep_check_config()`, capabilities of the endpoint provided by the driver
are logged, but not the requested endpoint configuration. As a result, when
the function fails, it is not possible to determine why using only logs.

Add logging of the requested configuration in addition to the driver caps
to allow easily determining the cause of the failure (when logging is on).

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
@zephyrbot zephyrbot added the area: USB Universal Serial Bus label Mar 24, 2026
@sonarqubecloud
Copy link
Copy Markdown

@mathieuchopstm mathieuchopstm added this to the v4.4.0 milestone Mar 24, 2026
@mathieuchopstm
Copy link
Copy Markdown
Contributor Author

I think this is acceptable under rc1 merge criteria (not a new feature) so tagging as milestone v4.4.0. Please change if it seems inappropriate.

@jfischer-no jfischer-no removed this from the v4.4.0 milestone Mar 26, 2026
@jfischer-no
Copy link
Copy Markdown
Contributor

jfischer-no commented Mar 26, 2026

I think this is acceptable under rc1 merge criteria (not a new feature) so tagging as milestone v4.4.0. Please change if it seems inappropriate.

"only bug-fix, documentation and stabilization patches may be merged to the main branch." IMO, additional logging at the debug level does not seems to be one of them.

@nashif nashif added this to the v4.5.0 milestone Mar 26, 2026
@nashif nashif merged commit b85fbd4 into zephyrproject-rtos:main Apr 15, 2026
29 of 30 checks passed
@mathieuchopstm mathieuchopstm deleted the topic/udc_common_log_requested_ep_config branch April 17, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: USB Universal Serial Bus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants