Seeeduino XIAO

Overview

This is a set of Bridle’s extension to the original Zephyr upstream board Seeeduino XIAO with some adaptions and improvement on Kconfig and Devicetree level.

List of extensions

Kconfig

  • deactivate self powered USB explicitly and set the maximum of electrical current consumption to 500㎃:

    Seeeduino XIAO

    Kconfig.defconfig
    config USB_SELF_POWERED
    	default n
    	depends on USB_DEVICE_STACK && BOARD_SEEEDUINO_XIAO
    
    config USB_MAX_POWER
    	default 250 if BOARD_SEEEDUINO_XIAO	# 500mA
    	depends on USB_DEVICE_STACK && BOARD_SEEEDUINO_XIAO
    
  • change log level and startup delay only in case of use the native USB device port atmel,sam0-usb with CDC-ACM UART zephyr,cdc-acm-uart as Zephyr console:

    Seeeduino XIAO

    Kconfig.defconfig
    # 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
    DT_COMPAT_ATMEL_USB := atmel,sam0-usb
    
    # Macros to shorten Kconfig expressions
    DT_CHOSEN_CONSOLE_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_CONSOLE))
    DT_CHOSEN_CONSOLE_PARENT := $(dt_node_parent,$(DT_CHOSEN_CONSOLE_NODE))
    
    if BOARD_SEEEDUINO_XIAO && \
    	$(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))
    
    # 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
    
    # Wait 4000ms at startup for USB enumeration on host side
    config BOOT_DELAY
    	default 4000
    
    endif # zephyr,cdc-acm-uart
    

Devicetree

  • set default entries for model and compatible of the boards:

    Seeeduino XIAO

    seeeduino_xiao.overlay
    / {
    	model = "Seeeduino XIAO @ UART Concole";
    	compatible = "seeed,seeeduino-xiao-uartcons",
    		     "seeed,seeeduino-xiao",
    		     "atmel,samd21g18a",
    		     "atmel,samd21";
    };