Skip to content
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

Conversation

jfischer-no
Copy link
Collaborator

@jfischer-no jfischer-no commented Nov 17, 2021

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

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]>
@jfischer-no jfischer-no added area: Drivers area: UART Universal Asynchronous Receiver-Transmitter area: USB Universal Serial Bus area: Console area: Shell Shell subsystem labels Nov 17, 2021
@github-actions github-actions bot added area: Boards area: Documentation area: Samples Samples area: Tests Issues related to a particular existing or missing test Release Notes To be mentioned in the release notes labels Nov 17, 2021
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;
Copy link
Contributor

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.

sh_uart->ctrl_blk->blocking_tx = blocking_tx;

Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Member

@anangl anangl left a 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.

@carlescufi carlescufi merged commit fdcc104 into zephyrproject-rtos:main Nov 18, 2021
@jfischer-no jfischer-no deleted the pr-remove-option-usb_uart_console branch November 19, 2021 08:36
@jfischer-no jfischer-no restored the pr-remove-option-usb_uart_console branch November 25, 2021 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Boards area: Console area: Documentation area: Drivers area: Samples Samples area: Shell Shell subsystem area: Tests Issues related to a particular existing or missing test area: UART Universal Asynchronous Receiver-Transmitter area: USB Universal Serial Bus Release Notes To be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants