-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
usb: remove Kconfig option USB_UART_CONSOLE #40428
usb: remove Kconfig option USB_UART_CONSOLE #40428
Conversation
Use same init level and priority as serial drivers. Align priority to the changes in commit ad14505 ("drivers: serial: Refactor drivers to use shared init priority Kconfig") Signed-off-by: Johann Fischer <[email protected]>
Do not change init level and priority of console driver if Kconfig option CONFIG_USB_UART_CONSOLE is enabled because commit 37f4d9b ("usb: cdc_acm: rework cdc_acm_poll_out to non-blocking") changed CDC ACM UART driver so that it more closely mimics the real controller and CDC ACM UART driver now uses the same init level and priority as regular serial driver. Signed-off-by: Johann Fischer <[email protected]>
This sample uses console driver and therefore Kconfig option CONFIG_CONSOLE and CONFIG_UART_CONSOLE are required. Kconfig option CONFIG_USB_UART_CONSOLE no longer has any influence here and should be removed. Signed-off-by: Johann Fischer <[email protected]>
Remove option CONFIG_USB_UART_CONSOLE where it has no influence or enable CONFIG_SHELL_BACKEND_SERIAL_CHECK_DTR without taking a detour through CONFIG_USB_UART_CONSOLE. Check the compatibility of chosen property instead of usage of CONFIG_USB_UART_CONSOLE option. Align how to wait for the readiness of CDC ACM UART. Signed-off-by: Johann Fischer <[email protected]>
Remove option CONFIG_USB_UART_CONSOLE where it has no influence or enable CONFIG_SHELL_BACKEND_SERIAL_CHECK_DTR without taking a detour through CONFIG_USB_UART_CONSOLE. Check the compatibility of chosen property instead of usage of CONFIG_USB_UART_CONSOLE option. Signed-off-by: Johann Fischer <[email protected]>
These boards try to configure CDC ACM UART as backend used by the console driver. CONFIG_USB_UART_CONSOLE has no more influence to console driver any and can be removed. Signed-off-by: Johann Fischer <[email protected]>
Since there are no more users and dependencies of Kconfig option USB_UART_CONSOLE in the tree, remove the remains and the option USB_UART_CONSOLE. Signed-off-by: Johann Fischer <[email protected]>
usb_enable(NULL); | ||
k_sleep(K_SECONDS(2)); | ||
#if DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_shell_uart), zephyr_cdc_acm_uart) | ||
const struct device *dev; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about moving this to shell backend. There is a enable
function called from shell thread context. You can block there.
zephyr/subsys/shell/backends/shell_uart.c
Line 238 in 525fa76
sh_uart->ctrl_blk->blocking_tx = blocking_tx; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, that will handle shell only and not printk :/ maybe it must stay here or we redirect printk to shell like log is redirected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to keep it that way for now. That is consistent with other examples. Also CONFIG_SHELL_BACKEND_SERIAL_CHECK_DTR
is enabled, waiting here is general for this sample.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Perhaps it would be good to correct the typo "sampes" in the a0c0996 commit title.
Adjust init level and priority of CDC ACM driver to regular serial drivers.
Limit scope of CONFIG_USB_UART_CONSOLE and finally remove this option.
Branched off from #40220