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

shell: uart: Allow a change in the shell initalisation to let routing it through USB UART #26051

Closed
KubaFYI opened this issue Jun 8, 2020 · 5 comments
Labels
area: USB Universal Serial Bus Enhancement Changes/Updates/Additions to existing features

Comments

@KubaFYI
Copy link
Contributor

KubaFYI commented Jun 8, 2020

Is your enhancement proposal related to a problem? Please describe.
When wanting to route the shell through USB CDC ACM there is a problem with the shell getting possibly initialised before the CDC ACM driver.

Describe the solution you'd like
I managed to successfully accomplish what I need by adding a call to usb_enable() in the enable_shell_uart() function and changing the literal 0 shell initialisation priority to CONFIG_APPLICATION_INIT_PRIORITY (so that it happens after the USB device's CONFIG_KERNEL_INIT_PRIORITY_DEVICE.

However, I'm not sure if this is the correct way to do it with me being possibly unaware of the reason why shell's initialisation needs to be 0, an the best place to usb_enable().

@KubaFYI KubaFYI added the Enhancement Changes/Updates/Additions to existing features label Jun 8, 2020
@KubaFYI
Copy link
Contributor Author

KubaFYI commented Jun 8, 2020

I've done the work on my fork at https://github.com/KubaFYI/zephyr/tree/feat_usb_acm_shell.

@carlescufi
Copy link
Member

I've done the work on my fork at https://github.com/KubaFYI/zephyr/tree/feat_usb_acm_shell.

Why don't you send an RFC PR with the code you have and we then discuss it there?

@KubaFYI
Copy link
Contributor Author

KubaFYI commented Jun 9, 2020

@carlescufi Oh ok. I always kinda assumed it's annoying to bother everyone with PRs which have not been discussed to be the right way forward, but if that's the preferred workflow I'll go for it!

@carlescufi
Copy link
Member

@carlescufi Oh ok. I always kinda assumed it's annoying to bother everyone with PRs which have not been discussed to be the right way forward, but if that's the preferred workflow I'll go for it!

No actually, many discussions can take place directly in the PR. Thanks for your contribution!

@jfischer-no
Copy link
Collaborator

The solution in current Zephyr tree is to configure the shell (CONFIG_UART_SHELL_ON_DEV_NAME="CDC_ACM_0") and enable USB device support in user application.
See also #26122 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: USB Universal Serial Bus Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants