-
Notifications
You must be signed in to change notification settings - Fork 8.2k
shields: add generic shield to use CDC ACM UART as backend #40645
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
shields: add generic shield to use CDC ACM UART as backend #40645
Conversation
|
Hi @jfischer-no I'm thankful for this work but I have a big problem with this being "manually opt in by specifying a shield" as per This is just a non-starter for our customers, they need an easy way of getting zephyr and being able to test things as they do with any other board, not have to jump through hoops trying to get the most basic sample applications working. For our BL654 USB dongle it's basically a given that almost everyone will be using the CDC port either for Bluetooth or as a general UART and this should cater for those majority of users. |
I cannot take this seriously.
Taking (1) and (2) into account, what are most basic applications for BL654_USB dongle? Probably none. But useful applications, such as hci_usb or ot-coprocessor, work fine even with minimal board configuration, https://docs.zephyrproject.org/latest/guides/porting/board_porting.html#general-recommendations. |
|
This PR addresses a problem which one way or the other has to be solved, and this seems like a rather elegant solution, getting rid of the need to create overlays for each new program/tailored configs for each board enabling usb at boot. I myself am working on a port of Wio Terminal board, which doesn't have a native UART, so needs to use CDC ACM to open a console accessible over USB. |
I remain opposed to the idea of using SHIELD for this. |
|
Dev-review (Dec 16, 2021):
|
c261fd6 to
aceea49
Compare
|
see also this comment: #40669 (comment) believe the variant approach that has been discussed time back on slack should be continued. |
Add generic shields that provide devicetree and configuration overlays, and configure USB device stack so that CDC ACM UART can be used as backend for console, logging, or shell. This approach allows us to avoid many identical overlays in samples and tests directories, and cumbersome board configurations. These shields use Kconfig option CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT and is mainly intended to be used with boards like nrf52840dongle_nrf52840 or bl654_usb. Signed-off-by: Johann Fischer <[email protected]>
Remove CDC ACM UART devicetree and config overlay, and explicit USB support initialization in favor of generic CDC ACM shield. For shell support via USB CDC ACM, this example is to be built as follows: west build -b nrf52840dongle_nrf52840 samples/subsys/shell/shell_module -- -DSHIELD=cdc_acm_shell Signed-off-by: Johann Fischer <[email protected]>
Remove CDC ACM UART devicetree and config overlay, and explicit USB support initialization in favor of generic CDC ACM shield. For shell support via USB CDC ACM, this example is to be built as follows: west build -b nrf52840dongle_nrf52840 tests/bluetooth/shell -- -DSHIELD=cdc_acm_shell Signed-off-by: Johann Fischer <[email protected]>
Remove CDC ACM UART devicetree and config overlay, and explicit USB support initialization in favor of generic CDC ACM shield. For console support via USB CDC ACM, this example is to be built as follows: west build -b reel_board tests/drivers/uart/uart_basic_api -- -DSHIELD=cdc_acm_console Signed-off-by: Johann Fischer <[email protected]>
Remove CDC ACM UART devicetree overlay, and explicit USB support initialization in favor of generic CDC ACM shield. For console support via USB CDC ACM, this example is to be built as follows: west build -b sensortile_box samples/boards/sensortile_box -- -DSHIELD=cdc_acm_console Signed-off-by: Johann Fischer <[email protected]>
Remove CDC ACM UART devicetree nodes, chosen properties and explicit USB support configuration in favor of generic CDC ACM shield. For console support via USB CDC ACM, in-tree samples for this boards is to be built as follows: west build -b nrf52840dongle_nrf52840 samples/basic/threads -- -DSHIELD=cdc_acm_console For shell support via USB CDC ACM, in-tree samples for this boards is to be built as follows: west build -b nrf52840dongle_nrf52840 samples/subsys/shell/shell_module -- -DSHIELD=cdc_acm_shell Signed-off-by: Johann Fischer <[email protected]>
aceea49 to
274363a
Compare
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
Add generic shields that provide devicetree and configuration
overlays, and configure USB device stack so that CDC ACM UART
can be used as backend for console, logging, or shell.
This shield is not for a real hardware device but for an emulated UART controller,
analogous to how we have emulated boards.
This approach allows us to avoid many identical overlays in
samples and tests directories, and cumbersome board configurations.
These shields use Kconfig option CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT
and is mainly intended to be used with boards like
nrf52840dongle_nrf52840 or bl654_usb.
Draft for discussion (derived from #40220).