Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions samples/subsys/usb/shell/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,39 @@ drivers and new USB support.
Building and flashing
*********************

The shell can be built with host and/or device stack support by selecting the
:ref:`application-file-suffixes`, where ``-DFILE_SUFFIX=<mode>`` selects
``prj_<mode>.conf``.

Assuming the board has a supported USB device controller, the example can be
built like:

.. zephyr-app-commands::
:zephyr-app: samples/subsys/usb/shell
:board: reel_board
:gen-args: -DFILE_SUFFIX=device
:goals: flash
:compact:

Assuming the board has a supported USB host controller, the example can be
built like:

.. zephyr-app-commands::
:zephyr-app: samples/subsys/usb/shell
:board: nrf52840dk/nrf52840
:shield: sparkfun_max3421e
:gen-args: -DFILE_SUFFIX=host
:goals: flash
:compact:

For the USB host functionality a supported host controller is required,
currently it is only MAX3421E. The example can be built as follows:
Assuming the board has a supported USB device and host controller,
the example can be built like:

.. zephyr-app-commands::
:zephyr-app: samples/subsys/usb/shell
:board: nrf52840dk/nrf52840
:shield: sparkfun_max3421e
:gen-args: -DCONFIG_UHC_DRIVER=y -DCONFIG_USB_HOST_STACK=y
:gen-args: -DFILE_SUFFIX=device_and_host
:goals: flash
:compact:

Expand All @@ -41,7 +57,7 @@ the platform has already defined or not ``zephyr_uhc0`` or ``zephyr_udc0`` nodel
.. zephyr-app-commands::
:zephyr-app: samples/subsys/usb/shell
:board: nrf52840dk/nrf52840
:gen-args: -DEXTRA_CONF_FILE=virtual.conf -DDTC_OVERLAY_FILE=virtual.overlay
:gen-args: -DFILE_SUFFIX=device_and_host -DDTC_OVERLAY_FILE=virtual.overlay
:goals: flash
:compact:

Expand Down
5 changes: 0 additions & 5 deletions samples/subsys/usb/shell/boards/qemu_cortex_m3.conf

This file was deleted.

23 changes: 0 additions & 23 deletions samples/subsys/usb/shell/boards/qemu_cortex_m3.overlay

This file was deleted.

8 changes: 8 additions & 0 deletions samples/subsys/usb/shell/prj_host.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CONFIG_SHELL=y

CONFIG_USB_HOST_STACK=y
CONFIG_USBH_SHELL=y

CONFIG_LOG=y
CONFIG_USBH_LOG_LEVEL_WRN=y
CONFIG_UHC_DRIVER_LOG_LEVEL_WRN=y
34 changes: 26 additions & 8 deletions samples/subsys/usb/shell/sample.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,49 @@
sample:
name: USB support shell sample
common:
depends_on:
- usbd
tests:
sample.usbd.shell:
depends_on:
- usbd
tags:
- usb
extra_args:
- FILE_SUFFIX=device
integration_platforms:
- nrf52840dk/nrf52840
- nrf54h20dk/nrf54h20/cpuapp
- frdm_k64f
- mimxrt685_evk/mimxrt685s/cm33
- mimxrt1060_evk/mimxrt1062/qspi
harness: keyboard
tags: usb
sample.usbh.shell:
depends_on:
- usbh
tags:
- usb
extra_args:
- FILE_SUFFIX=host
platform_allow:
- rd_rw612_bga
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you verify that this board is working?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No as unfortunately not available to the public.

This was used for UVC Host by @AidenHu.

Glad to know which board to use in the meantime this gets ready. Maybe still using the nRF52840 with the shield for now?

(In the meantime, I am hurrying on DWC2 Host...)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep rd_rw612_bga, we can replace it with integration_platforms later.

build_only: true
sample.usbh.shell.shield:
depends_on:
- usbd
tags:
- usb
- shield
extra_args:
- CONF_FILE="device_and_host_prj.conf"
- FILE_SUFFIX=device_and_host
- SHIELD="sparkfun_max3421e"
platform_allow:
- nrf52840dk/nrf52840
- frdm_k64f
build_only: true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we take the changes of #105083 for adding the usbh tag

nrf52840dk/nrf52840 and frdm_k64f both don't not have that tag, so it wouldn't be tested

Might be an idea to have two cases of this, one that depends of the usbh tag but without the shield and one for the shield variant but then without the usbh tag, as the original boards don't have a host controller

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, there is no tag for shields.

sample.usbh.shell.virtual:
tags: usb
extra_args: CONF_FILE="device_and_host_prj.conf"
platform_allow: qemu_cortex_m3
tags:
- usb
extra_args:
- FILE_SUFFIX=device_and_host
- EXTRA_DTC_OVERLAY_FILE="virtual.overlay"
platform_allow:
- native_sim/native/64
build_only: true
5 changes: 0 additions & 5 deletions samples/subsys/usb/shell/virtual.conf

This file was deleted.

Loading