-
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
boards: add common configuration for CDC ACM UART #81308
boards: add common configuration for CDC ACM UART #81308
Conversation
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.
Ezurio boards look ok
boards/common/cdc_acm_serial.dts
Outdated
}; | ||
|
||
zephyr_udc0: &usbd { | ||
cdc_acm_uart: cdc_acm_uart { |
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.
should this not be cdc_acm_uart0
if it supports multiple instances?
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.
cdc_acm_uart0
is likely to conflict with samples or user applications, we should rather name it board_cdc_acm_uart
, like we prefix snippets and shields.
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.
board_*
prefix sounds good
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 also moved them to boards/common/usb/
endif # LOG | ||
|
||
endif # USB_DEVICE_STACK | ||
source "${ZEPHYR_BASE}/boards/common/Kconfig.cdc_acm_serial" |
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.
Nitpick:
Harmonize path between Kconfig and dts:
source "../boards/common/Kconfig.cdc_acm_serial"
#include <../boards/common/cdc_acm_serial.dts>
or
source "${ZEPHYR_BASE}/boards/common/Kconfig.cdc_acm_serial"
#include <${ZEPHYR_BASE}/boards/common/cdc_acm_serial.dts>
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.
${ZEPHYR_BASE} cannot be resolved in dt.
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.
Can we then use ../boards/common
for Kconfig ?
70aa27a
to
4414ed1
Compare
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.
+1 for the approach
ab20804
to
78d913e
Compare
compatible = "zephyr,cdc-acm-uart"; | ||
}; | ||
}; | ||
- through common CDC ACM UART backend configuraiton for all boards |
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.
This typo caught my eye, and has at least one other instance in this PR.
- through common CDC ACM UART backend configuraiton for all boards | |
- through common CDC ACM UART backend configuration for all boards |
78d913e
to
21bf925
Compare
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.
Still some minor details, but those are very much depending on the perspective from where the solution is seen, so not something which should block this PR.
Many boards have similar code to configure the USB and CDC ACM UART that they want to use as a logging or shell backend. Some of them have an incorrect or incomplete configuration. These boards do not have a built-in debug adapter, but a SoC with a USB device controller and a bootloader with USB device support. Introduce common CDC ACM UART configuration that these boards should use for logging or shell backend to avoid duplicate or incorrect configuration. Signed-off-by: Johann Fischer <[email protected]>
21bf925
to
ae8123a
Compare
ae8123a
to
4c74867
Compare
@rerickson1 @nordicjm @tejlmand @erwango could you take another look? |
Remove all USB and CDC ACM configuration in favor of common configuraiton. Do not adapt board-specific configurations such as unknown PID/VID or string descriptors. There is no justification for using them on specific boards, and we do not have formal approval to use them in the project tree. Also, we need more uniform configuration, since the main reason for enabling CDC ACM here is to allow users to run examples like hello_world right out of the box. Of course, anyone is free to customize these settings in their fork or downstream project. Signed-off-by: Johann Fischer <[email protected]>
The board hardware has no network interfaces, although the ECM/EEM class implementation can provide Ethernet-like functionality and export it to the host, this is no reason to default to a specific USB class implementation.We do not make this kind of configuration for other boards that have a USB device controller. Also, it may not be what a user expects when using these boards with networking and a USB stack. Signed-off-by: Johann Fischer <[email protected]>
4c74867
to
b9b0789
Compare
Many boards have similar code to configure the USB and CDC ACM UART that
they want to use as a logging or shell backend. Some of them have an
incorrect or incomplete configuration.
These boards do not have a built-in debug adapter, but a SoC with a USB
device controller and a bootloader with USB device support. Introduce
common CDC ACM UART configuration that these boards should use for
logging or shell backend to avoid duplicate or incorrect configuration.
Derived from #81220 and #81228, as first step (or alternative).