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

Provide USB console by snippets instead of specific board revision #130

Merged
merged 22 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
bd49812
snippets: usb-console: add CDC ACM UART console
rexut Sep 25, 2023
f58f8b8
snippets: usb-console: add Arduino Zero support
rexut Sep 25, 2023
ea699f5
boards: arduino_zero: use USB concole snippet
rexut Sep 25, 2023
1abbc3d
boards: arduino_zero: set USB max power to 500mA
rexut Sep 25, 2023
449a5b5
boards: arduino_zero: provide HEX output for OpenOCD
rexut Sep 25, 2023
d7e473b
snippets: usb-console: add Seeeduino Lotus Cortex-M0+
rexut Sep 26, 2023
58c2270
boards: seeeduino_lotus: use USB concole snippet
rexut Sep 26, 2023
fe8a1e0
boards: seeeduino_lotus: set USB max power to 500mA
rexut Sep 26, 2023
e650e54
boards: seeeduino_lotus: provide HEX output for OpenOCD
rexut Sep 26, 2023
21b1b75
snippets: usb-console: add Seeed XIAO SAMD21 support
rexut Sep 26, 2023
c70e9ac
boards: seeed_xiao_samd21: use USB concole snippet
rexut Sep 26, 2023
407c924
boards: seeed_xiao_samd21: set USB max power to 500mA
rexut Sep 26, 2023
750221b
boards: seeed_xiao_samd21: provide HEX output for OpenOCD
rexut Sep 26, 2023
ef64b9f
snippets: usb-console: add Waveshare RP2040 support
rexut Sep 27, 2023
74d2db3
boards: waveshare_rp2040: use USB concole snippet
rexut Sep 27, 2023
33d0988
tests: grove: base: remove '@usbcons' board revisions
rexut Sep 27, 2023
8abb06d
tests: grove: btn: remove '@usbcons' board revisions
rexut Sep 27, 2023
a53d19f
tests: grove: led: remove '@usbcons' board revisions
rexut Sep 27, 2023
1a92bcf
tests: grove: x_grove_testbed: remove '@usbcons' board revisions
rexut Sep 27, 2023
a21fbde
samples: helloshell: test: remove '@usbcons' board revisions
rexut Sep 27, 2023
9eaef07
ci: github: qa-shields: remove '@usbcons' board revisions
rexut Sep 27, 2023
e62e055
release: update draft notes for upcoming 3.5.0
rexut Sep 27, 2023
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
5 changes: 0 additions & 5 deletions .github/workflows/qa-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ jobs:
--outdir twister-out --no-clean --inline-logs \
--enable-size-report --platform-reports \
--platform arduino_zero \
--platform arduino_zero@usbcons \
--platform mimxrt1010_evk \
--platform mimxrt1060_evk \
--platform mimxrt1060_evkb \
Expand All @@ -120,14 +119,10 @@ jobs:
--platform nucleo_f767zi \
--platform rpi_pico \
--platform seeed_xiao_samd21 \
--platform seeed_xiao_samd21@usbcons \
--platform seeeduino_xiao \
--platform seeeduino_lotus \
--platform seeeduino_lotus@usbcons \
--platform waveshare_rp2040_plus \
--platform waveshare_rp2040_plus@usbcons \
--platform waveshare_rp2040_plus@16mb \
--platform waveshare_rp2040_plus@16mb@usbcons \
--testsuite-root bridle/tests/shields/grove/dts_bindings \
--testsuite-root bridle/tests/shields/x_grove_testbed/dts_bindings

Expand Down
22 changes: 17 additions & 5 deletions boards/arm/arduino_zero/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ config BOARD
default "arduino_zero"
depends on BOARD_ARDUINO_ZERO

config USB_SELF_POWERED
default n
depends on USB_DEVICE_STACK && BOARD_ARDUINO_ZERO

config USB_MAX_POWER
default 250 if BOARD_ARDUINO_ZERO # 500mA
depends on USB_DEVICE_STACK && BOARD_ARDUINO_ZERO

# Workaround for not being able to have commas in macro arguments
DT_CHOSEN_Z_CONSOLE := zephyr,console
DT_COMPAT_Z_CDC_ACM_UART := zephyr,cdc-acm-uart
Expand All @@ -17,30 +25,34 @@ DT_COMPAT_ATMEL_USB := atmel,sam0-usb
DT_CHOSEN_CONSOLE_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_CONSOLE))
DT_CHOSEN_CONSOLE_PARENT := $(dt_node_parent,$(DT_CHOSEN_CONSOLE_NODE))

if $(dt_chosen_enabled,$(DT_CHOSEN_Z_CONSOLE)) && \
if BOARD_ARDUINO_ZERO && \
$(dt_chosen_enabled,$(DT_CHOSEN_Z_CONSOLE)) && \
$(dt_compat_on_bus,$(DT_COMPAT_Z_CDC_ACM_UART),usb) && \
$(dt_node_has_compat,$(DT_CHOSEN_CONSOLE_PARENT),$(DT_COMPAT_ATMEL_USB))

config BOOTLOADER_BOSSA_DEVICE_NAME
default "$(dt_chosen_label,$(DT_CHOSEN_Z_CONSOLE))"
depends on USB_CDC_ACM

if LOG

# Logger cannot use itself to log
choice USB_CDC_ACM_LOG_LEVEL_CHOICE
default USB_CDC_ACM_LOG_LEVEL_OFF
depends on LOG
endchoice

# Set USB log level to error only
choice USB_DEVICE_LOG_LEVEL_CHOICE
default USB_DEVICE_LOG_LEVEL_ERR
depends on LOG
endchoice

# Wait 4000ms at startup for logging
config LOG_PROCESS_THREAD_STARTUP_DELAY_MS
default 4000
depends on LOG

endif # LOG
# Wait 4000ms at startup for USB enumeration on host side
config BOOT_DELAY
default 4000

endif # @usbcons
endif # zephyr,cdc-acm-uart
6 changes: 6 additions & 0 deletions boards/arm/arduino_zero/arduino_zero.dts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@
#include <zephyr/dt-bindings/pwm/pwm.h>

/ {
model = "Arduino Zero @ UART Concole";
compatible = "arduino,zero-uartcons", "arduino,zero",
"atmel,samd21g18a", "atmel,samd21";

chosen {
zephyr,console = &sercom5;
zephyr,shell-uart = &sercom5;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &code_partition;
Expand Down
1 change: 1 addition & 0 deletions boards/arm/arduino_zero/arduino_zero_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_SERIAL=y
CONFIG_BOOTLOADER_BOSSA=y
CONFIG_BOOTLOADER_BOSSA_ARDUINO=y
CONFIG_BUILD_OUTPUT_HEX=y
CONFIG_BUILD_OUTPUT_UF2=y
15 changes: 0 additions & 15 deletions boards/arm/arduino_zero/arduino_zero_uartcons.overlay

This file was deleted.

28 changes: 0 additions & 28 deletions boards/arm/arduino_zero/arduino_zero_usbcons.yaml

This file was deleted.

39 changes: 20 additions & 19 deletions boards/arm/arduino_zero/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,20 @@ Other hardware features are not currently supported by Zephyr.
The default configuration can be found in the Kconfig
:bridle_file:`boards/arm/arduino_zero/arduino_zero_defconfig`.

Board Revisions
===============
Board Configurations
====================

The :code:`arduino_zero` board can be configured for the following revisions.
These are not really specific hardware revisions, rather than specific
configurations for different use cases.
The :code:`arduino_zero` board can be configured for the following different
use cases.

.. rubric:: :code:`arduino_zero@uartcons`
.. rubric:: :command:`west build -b arduino_zero`

Use the serial port SERCOM5 over EDBG as Zephyr console and for the shell.

.. rubric:: :code:`arduino_zero@usbcons`
.. rubric:: :command:`west build -b arduino_zero -S usb-console`

Use the native USB device port with CDC-ACM as Zephyr console and for the shell.
Use the native USB device port with CDC-ACM as Zephyr console and for the shell,
see :ref:`snippet-usb-console`.

Connections and IOs
===================
Expand Down Expand Up @@ -153,8 +153,8 @@ Serial Port

The SAMD21 MCU has 6 SERCOM based USARTs. One of the USARTs (SERCOM5) is
connected to the onboard Atmel Embedded Debugger (EDBG) and is the Zephyr
console. This is captured by the standard board revision ``uartcons``.
SERCOM0 is available on the D0 (RX) and D1 (TX) of the |Arduino UNO R3| header.
console. This is captured by the standard board configuration. SERCOM0 is
available on the D0 (RX) and D1 (TX) of the |Arduino UNO R3| header.

USB Device Port
===============
Expand All @@ -165,14 +165,14 @@ USB Device Port
:alt: Arduino Zero Native and Programming USB Ports

The SAMD21 MCU has a (native) USB device port that can be used to communicate
with a host PC. See the :ref:`zephyr:usb-samples` sample applications for more,
such as the :doc:`zephyr:samples/subsys/usb/cdc_acm/README` sample which sets
up a virtual serial port that echos characters back to the host PC. As an
alternative to the default Zephyr console on serial port the special board
revision ``usbcons`` can be used to enable :ref:`zephyr:usb_device_cdc_acm`
and switch the console to USB::

USB device idVendor=2341, idProduct=804d, bcdDevice= 3.03
with a host PC. See Zephyr :ref:`zephyr:usb-samples` for more, such as the
:doc:`zephyr:samples/subsys/usb/cdc_acm/README` sample which sets up a virtual
serial port that echos characters back to the host PC. As an alternative to the
default Zephyr console on serial port the Bridle :ref:`snippet-usb-console`
can be used to enable :ref:`zephyr:usb_device_cdc_acm` and switch the console
to USB::

USB device idVendor=2341, idProduct=804d, bcdDevice= 3.04
USB device strings: Mfr=1, Product=2, SerialNumber=3
Product: Arduino Zero (CDC ACM)
Manufacturer: Arduino LLC
Expand Down Expand Up @@ -380,7 +380,8 @@ Hello Shell with USB-CDC/ACM Console

.. zephyr-app-commands::
:app: bridle/samples/helloshell
:board: arduino_zero@usbcons
:board: arduino_zero
:west-args: -S usb-console
:goals: flash
:compact:

Expand Down
13 changes: 0 additions & 13 deletions boards/arm/arduino_zero/revision.cmake

This file was deleted.

22 changes: 17 additions & 5 deletions boards/arm/seeed_xiao_samd21/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ config BOARD
default "seeed_xiao_samd21"
depends on BOARD_SEEED_XIAO_SAMD21

config USB_SELF_POWERED
default n
depends on USB_DEVICE_STACK && BOARD_SEEED_XIAO_SAMD21

config USB_MAX_POWER
default 250 if BOARD_SEEED_XIAO_SAMD21 # 500mA
depends on USB_DEVICE_STACK && BOARD_SEEED_XIAO_SAMD21

# Workaround for not being able to have commas in macro arguments
DT_CHOSEN_Z_CONSOLE := zephyr,console
DT_COMPAT_Z_CDC_ACM_UART := zephyr,cdc-acm-uart
Expand All @@ -17,30 +25,34 @@ DT_COMPAT_ATMEL_USB := atmel,sam0-usb
DT_CHOSEN_CONSOLE_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_CONSOLE))
DT_CHOSEN_CONSOLE_PARENT := $(dt_node_parent,$(DT_CHOSEN_CONSOLE_NODE))

if $(dt_chosen_enabled,$(DT_CHOSEN_Z_CONSOLE)) && \
if BOARD_SEEED_XIAO_SAMD21 && \
$(dt_chosen_enabled,$(DT_CHOSEN_Z_CONSOLE)) && \
$(dt_compat_on_bus,$(DT_COMPAT_Z_CDC_ACM_UART),usb) && \
$(dt_node_has_compat,$(DT_CHOSEN_CONSOLE_PARENT),$(DT_COMPAT_ATMEL_USB))

config BOOTLOADER_BOSSA_DEVICE_NAME
default "$(dt_chosen_label,$(DT_CHOSEN_Z_CONSOLE))"
depends on USB_CDC_ACM

if LOG

# Logger cannot use itself to log
choice USB_CDC_ACM_LOG_LEVEL_CHOICE
default USB_CDC_ACM_LOG_LEVEL_OFF
depends on LOG
endchoice

# Set USB log level to error only
choice USB_DEVICE_LOG_LEVEL_CHOICE
default USB_DEVICE_LOG_LEVEL_ERR
depends on LOG
endchoice

# Wait 4000ms at startup for logging
config LOG_PROCESS_THREAD_STARTUP_DELAY_MS
default 4000
depends on LOG

endif # LOG
# Wait 4000ms at startup for USB enumeration on host side
config BOOT_DELAY
default 4000

endif # @usbcons
endif # zephyr,cdc-acm-uart
29 changes: 14 additions & 15 deletions boards/arm/seeed_xiao_samd21/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,18 @@ Other hardware features are not currently supported by Zephyr.
The default configuration can be found in the Kconfig file
:bridle_file:`boards/arm/seeed_xiao_samd21/seeed_xiao_samd21_defconfig`.

Board Revisions
===============
Board Configurations
====================

The :code:`seeed_xiao_samd21` board can be configured for the following
revisions. These are not really specific hardware revisions, rather than
specific configurations for different use cases.
different use cases.

.. rubric:: :code:`seeed_xiao_samd21@uartcons`
.. rubric:: :command:`west build -b seeed_xiao_samd21`

Use the serial port SERCOM5 over |Seeed XIAO| header as Zephyr console
and for the shell.

.. rubric:: :code:`seeed_xiao_samd21@usbcons`
.. rubric:: :command:`west build -b seeed_xiao_samd21 -S usb-console`

Use the native USB device port with CDC-ACM as Zephyr console
and for the shell.
Expand Down Expand Up @@ -173,8 +172,7 @@ Serial Port

The SAMD21 MCU has 6 SERCOM based USARTs. On the Seeed Studio XIAO SAMD21,
SERCOM4 is the Zephyr console and is available on the |Seeed XIAO| header
pins 7 (RX) and 6 (TX). This is captured by the standard board revision
``uartcons``.
pins 7 (RX) and 6 (TX).

USB Device Port
===============
Expand All @@ -183,13 +181,13 @@ The SAMD21 MCU has a (native) USB device port that can be used to communicate
with a host PC. See the :ref:`zephyr:usb-samples` sample applications for more,
such as the :doc:`zephyr:samples/subsys/usb/cdc_acm/README` sample which sets
up a virtual serial port that echos characters back to the host PC. As an
alternative to the default Zephyr console on serial port the special board
revision ``usbcons`` can be used to enable :ref:`zephyr:usb_device_cdc_acm`
and switch the console to USB::
alternative to the default Zephyr console on serial port the Bridle
:ref:`snippet-usb-console` can be used to enable
:ref:`zephyr:usb_device_cdc_acm` and switch the console to USB::

USB device idVendor=2886, idProduct=802f, bcdDevice= 3.03
USB device idVendor=2886, idProduct=802f, bcdDevice= 3.04
USB device strings: Mfr=1, Product=2, SerialNumber=3
Product: Seeeduino XIAO (CDC ACM)
Product: XIAO SAMD21 (CDC ACM)
Manufacturer: Seeed Studio
SerialNumber: AC3FB5052F48A3F7

Expand Down Expand Up @@ -289,7 +287,7 @@ Debugging
.. zephyr-app-commands::
:app: zephyr/samples/hello_world
:board: seeed_xiao_samd21
:gen-args: -DCONFIG_BUILD_OUTPUT_HEX=y -DBOARD_FLASH_RUNNER=openocd
:gen-args: -DBOARD_FLASH_RUNNER=openocd
:goals: debug
:compact:

Expand Down Expand Up @@ -330,7 +328,8 @@ Hello Shell with USB-CDC/ACM Console

.. zephyr-app-commands::
:app: bridle/samples/helloshell
:board: seeed_xiao_samd21@usbcons
:board: seeed_xiao_samd21
:west-args: -S usb-console
:goals: flash
:compact:

Expand Down
13 changes: 0 additions & 13 deletions boards/arm/seeed_xiao_samd21/revision.cmake

This file was deleted.

10 changes: 10 additions & 0 deletions boards/arm/seeed_xiao_samd21/seeed_xiao_samd21.dts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@
#include <zephyr/dt-bindings/pwm/pwm.h>

/ {
model = "Seeed Studio XIAO SAMD21 (Seeeduino XIAO) @ UART Concole";
compatible = "seeed,seeed-xiao-samd21-uartcons",
"seeed,seeed-xiao-samd21",
"seeed,seeeduino-xiao-uartcons",
"seeed,seeeduino-xiao",
"atmel,samd21g18a",
"atmel,samd21";

chosen {
zephyr,console = &sercom4;
zephyr,shell-uart = &sercom4;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &code_partition;
Expand Down
Loading