From b54d50e7e3f32356d124d518b8f3a6f04ab86e48 Mon Sep 17 00:00:00 2001 From: grilliiiii Date: Thu, 18 Apr 2024 18:14:24 +0800 Subject: [PATCH 1/6] Add:XIAO RP2040 With Zephyr(RTOS) usage wiki --- .../XIAO-RP2040-Zephyr-RTOS.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_RP2040/XIAO-RP2040-Zephyr-RTOS.md b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_RP2040/XIAO-RP2040-Zephyr-RTOS.md index 1fd127c245c8..4ed6b498d45d 100644 --- a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_RP2040/XIAO-RP2040-Zephyr-RTOS.md +++ b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_RP2040/XIAO-RP2040-Zephyr-RTOS.md @@ -12,7 +12,7 @@ last_update: # XIAO RP2040 With Zephyr(RTOS) -
+ This wiki covers [Zephyr](https://www.zephyrproject.org/) support for the [Seeed Studio XIAO RP2040](https://wiki.seeedstudio.com/xiao_rp2040_getting_started/). With the assistance of this guide you will be able to utilize the feature set available to the board. @@ -183,7 +183,8 @@ CONFIG_GPIO_HOGS=y If you wish to utilize the onboard WS2812 it is advisable to enable this variable to allow it to draw power. -
+ +
#### LED PWM @@ -219,7 +220,8 @@ As can be seen by the `xiao_rp2040-pinctrl.dtsi` from the zephyr board files the In this case the PWM is using the configured devicetree pwm LED which is associated back with pin 25 (the blue LED). The PWM pins can be referenced from the [RP2040 documentation](https://docs.zephyrproject.org/apidoc/latest/rpi-pico-rp2040-pinctrl_8h.html). -
+ +
#### Clock @@ -312,7 +314,8 @@ x_value: 1.4137159*2^1, y_value: 1.8977352*2^-3 #### Grove - Expansion Board - I2C Display -
+ +
To test this setup we can use an existing sample with Zephyr: @@ -409,7 +412,8 @@ In this case GPIO 27 corresponds with Pin A1/D1 on the Xiao RP2040. It is setup First solder on pins and connect your Xiao RP2040 to the expansion board. Then connect a grove connector cable between the Grove SHT31 and one of the I2C ports on the expansion board. -
+ +
To test this setup we can use an existing sample with Zephyr which we will enable USB console support with our overlay and conf. @@ -477,7 +481,8 @@ When this completes, move the build file from `build/zephyr/zephyr.uf2` to the m With the new firmware in place the device now shows the same demo screen we saw previously on the expansion board just now updated for the color LCD over SPI. -
+ +
## ✨ Contributor Project From fcf5420458e7d595176c57876e584659d9858d8d Mon Sep 17 00:00:00 2001 From: Tim Lovett Date: Thu, 18 Apr 2024 23:07:50 -0400 Subject: [PATCH 2/6] xiao esp32c3 zephyr augmentations --- .../XIAO-ESP32C3-Zephyr.md | 466 +++++++++++++++++- .../XIAO-SAMD21-Zephyr-RTOS.md | 2 +- 2 files changed, 460 insertions(+), 8 deletions(-) diff --git a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32C3/XIAO-ESP32C3-Zephyr.md b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32C3/XIAO-ESP32C3-Zephyr.md index 1e3b8f8bbf59..a9cf796b263d 100644 --- a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32C3/XIAO-ESP32C3-Zephyr.md +++ b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32C3/XIAO-ESP32C3-Zephyr.md @@ -6,8 +6,8 @@ keywords: image: https://files.seeedstudio.com/wiki/wiki-platform/S-tempor.png slug: /XIAO-ESP32C3-Zephyr last_update: - date: 7/25/2023 - author: yulu Ji + date: 4/17/2023 + author: timo614 --- # XIAO ESP32C3 with Zephyr(RTOS) @@ -42,7 +42,7 @@ Zephyr offers a number of familiar services for development: ### Multiple Scheduling Algorithms - Zephyr provides a comprehensive set of thread scheduling choices: + Zephyr provides a comprehensive set of thread scheduling choices: - Cooperative and Preemptive Scheduling - Earliest Deadline First (EDF) - Meta IRQ scheduling implementing “interrupt bottom half” or “tasklet” behavior @@ -70,20 +70,472 @@ Mesh Support: - Highly configurable, fitting in devices with at least 16k RAM *Reference: [**Zephyr Project**](https://docs.zephyrproject.org/latest/introduction/index.html#)* + ## Getting Started -- [Official Zephyr For XIAO ESP32C3 Getting Started](https://docs.zephyrproject.org/latest/boards/seeed/xiao_esp32c3/doc/index.html) +The first step to working with Zephyr is to get the SDK and toolchain setup for local development. The [Zephyr getting started guide](https://docs.zephyrproject.org/latest/develop/getting_started/index.html) should be referenced for the associated setup procedure needed for your environment. + +Once the Zephyr toolchain has been setup and an associated SDK has been downloaded you can begin application development. + +For the Xiao ESP32C3 the [board description file](https://docs.zephyrproject.org/latest/boards/seeed/xiao_esp32c3/doc/index.html) can be referenced for further setup information. + +To fetch the blobs needed for using the ESP32C3 run the following command: + +``` +west blobs fetch hal_espressif +``` + +After this samples can be built and flashed to the board. + +The simplest example is to run the "Hello World" sample on the board. After changing to the directory of the Zephyr install run the following commands. + +``` +west build -p always -b xiao_esp32c3 samples/hello_world +west flash +west espressif monitor +``` + +With the final command you should see the response showing the "Hello World!" greeting. + +``` +*** Booting Zephyr OS build v3.6.0-2566-gc9b45bf4672a *** +Hello World! xiao_esp32c3/esp32c3 +``` + +To assist with the process of using Zephyr with Xiao and its expansion board a repository has been constructed with several overlays and configurations used here. The commands included in this wiki article assume it is located `../applications/xiao-zephyr-examples` relative to the zephyr root. An alternative path can be provided to the commands below by updating it. + +``` +git clone https://github.com/Cosmic-Bee/xiao-zephyr-examples +``` + +## Hardware Preparation + + + + + + + + + + + + + + + + + +
Seeed Studio XIAO ESP32C3Seeed Studio Expansion BoardGrove Red LED
+ +### Developer Knowledge + +#### XIAO Expansion Board + + In order to use Grove modules with Seeed Studio XIAO ESP32C3, we will use a [Seeed Studio Expansion Base for XIAO](https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html) and connect XIAO ESP32C3 on it. + + After that, the Grove connectors on the board can be used to connect Grove modules. + +
+ +#### Pin Definitions + + You need to follow the graphic below to use the appropriate internal pin numbers when connecting the Grove modules to the Grove connectors on Grove Shield for Seeed Studio XIAO. + +
+ +### Primary Functionality + +- GPIO / LED Enable +- Bluetooth +- Wi-Fi +- TFLite + +#### GPIO / LED Enable + +To test this setup we can use the blinky sample with Zephyr but we'll use an additional Grove LED and an overlay to override the LED to the D0 pin to demonstrate this working (the Xiao ESP32C3 does not have a programmable onboard LED): + +``` +west build -p always -b xiao_esp32c3 samples/basic/blinky -- -DDTC_OVERLAY_FILE=$(dirname $(pwd))/applications/xiao-zephyr-examples/d0_led.overlay +west flash +west espressif monitor +``` + +Double press RESET or short the RST pin to the GND. + +``` +west flash +``` + +You will see the attached red LED toggle on and off creating a blinking effect. + +Let's dive into this example a bit to see why it works. + +The associated example code reference led0: +``` +#define LED0_NODE DT_ALIAS(led0) +static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios); +``` + +The LED overlay (`xiao-zephyr-examples/d0_led.overlay`) defines this LED for us: +``` +/ { + aliases { + led0 = &led0; + }; + + leds { + compatible = "gpio-leds"; + led0: led_0 { + gpios = <&xiao_d 0 GPIO_ACTIVE_HIGH>; + label = "Demo LED"; + }; + }; +}; +``` + +This overlay sets D0 (as shown via `&xiao_d 0`) as an LED and associates it with the alias `led0`. `led0` is an alias which allows many samples use it as the LED being controlled as they look specifically for this name. + +If you monitor the serial output via `west espressif monitor` you will see an output similar to: +``` +*** Booting Zephyr OS build v3.6.0-2566-gc9b45bf4672a *** +LED state: OFF +LED state: ON +LED state: OFF +LED state: ON +``` + +#### Bluetooth + +To test this setup we can use an existing sample with Zephyr: + +``` +west build -p always -b xiao_esp32c3 samples/bluetooth/observer +west flash +west espressif monitor +``` + +You will see a console available for sending commands to the board: +``` +*** Booting Zephyr OS build v3.6.0-2566-gc9b45bf4672a *** +Starting Observer Demo +Started scanning... +Device found: E5:44:60:88:DB:99 (random) (RSSI -92), type 0, AD data len 27 +Device found: F3:38:F3:AD:FC:C6 (random) (RSSI -63), type 3, AD data len 8 +Device found: 49:E6:31:0F:A6:25 (random) (RSSI -55), type 2, AD data len 28 +Device found: EC:11:27:22:AF:D2 (public) (RSSI -80), type 0, AD data len 31 +Device found: FB:3C:4A:AC:64:33 (random) (RSSI -78), type 0, AD data len 30 +Device found: 79:05:36:B8:1E:1B (random) (RSSI -34), type 2, AD data len 4 +Device found: 77:4D:FC:E2:12:D4 (random) (RSSI -86), type 2, AD data len 4 +Device found: E0:9D:13:29:DA:15 (public) (RSSI -99), type 0, AD data len 31 +Device found: 53:17:1B:22:70:23 (random) (RSSI -97), type 0, AD data len 18 +``` + +``` +CONFIG_BT=y +CONFIG_BT_OBSERVER=y +``` + +The [conf file](https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/bluetooth/observer/prj.conf) here enables bluetooth related features for the Zephyr build. + +#### Wi-Fi + +To test this setup we can use an existing sample with Zephyr: + +``` +west build -p always -b xiao_esp32c3 samples/net/wifi +west flash +west espressif monitor +``` + +You will see a console available for sending commands to the board: +``` +*** Booting Zephyr OS build v3.6.0-1155-g1a55caf8263e *** +uart:~$ +``` + +Several commands exist allowing you to see and connect to local networks, see the [sample readme](https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/net/wifi/README.rst) for more information. +``` +*** Booting Zephyr OS build v3.6.0-2566-gc9b45bf4672a *** +uart:~$ wifi scan +Scan requested +Num | SSID (len) | Chan (Band) | RSSI | Security | BSSID | MFP +1 | Maredonia 9 | 6 (2.4GHz) | -41 | WPA2-PSK | | Disable +2 | Maredonia 9 | 6 (2.4GHz) | -41 | WPA2-PSK | | Disable +3 | Aernazonea 10 | 6 (2.4GHz) | -41 | WPA2-PSK | | Disable +4 | Aernazonea 10 | 6 (2.4GHz) | +``` + +Let's dive into this example a bit to see why it works: +``` +&wifi { + status = "okay"; +}; +``` + +The app [overlay file](https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/net/wifi/boards/xiao_esp32c3.overlay) is used to setup various board components. Using this file the example can be utilized as the overlay informs the sample logic to enable Wi-Fi. + +``` +CONFIG_WIFI=y + +CONFIG_NETWORKING=y +CONFIG_NET_L2_ETHERNET=y + +CONFIG_NET_IPV6=n +CONFIG_NET_IPV4=y +CONFIG_NET_DHCPV4=y +CONFIG_ESP32_WIFI_STA_AUTO_DHCPV4=y + +CONFIG_NET_LOG=y +``` + +The [conf file](https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/net/wifi/boards/xiao_esp32c3.conf) here enables several networking related features for the Zephyr build. + +#### TFLite - Hello World + +Enable TFLite with Zephyr and update: +``` +west config manifest.project-filter -- +tflite-micro +west update +``` + +Build the sample and flash to your board: +``` +west build -p always -b xiao_esp32c3 samples/modules/tflite-micro/hello_world +west flash +west espressif monitor +``` + +You will see results returned from the console: +``` +*** Booting Zephyr OS build v3.6.0-2566-gc9b45bf4672a *** +x_value: 1.0*2^-127, y_value: 1.0*2^-127 + +x_value: 1.2566366*2^-2, y_value: 1.4910772*2^-2 + +x_value: 1.2566366*2^-1, y_value: 1.1183078*2^-1 + +x_value: 1.8849551*2^-1, y_value: 1.677462*2^-1 + +x_value: 1.2566366*2^0, y_value: 1.9316229*2^-1 + +x_value: 1.5707957*2^0, y_value: 1.0420598*2^0 + +x_value: 1.8849551*2^0, y_value: 1.9146791*2^-1 + +x_value: 1.0995567*2^1, y_value: 1.6435742*2^-1 + +x_value: 1.2566366*2^1, y_value: 1.0674761*2^-1 + +x_value: 1.4137159*2^1, y_value: 1.8977352*2^-3 +``` + +Additional information about TFLite is outside of the scope of this guide but the example serves as a guide to the capabilities of the device and the components required for running the TFLite setup. + +### Additional Components + +- [Grove - Expansion Board](https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html) - I2C Display +- [Grove - Expansion Board](https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html) - Button +- [Grove - Temperature and Humidity Sensor (SHT31)](https://www.seeedstudio.com/Grove-Temperature-Humidity-Sensor-SHT31.html) +- [1.69inch LCD Display Module, 240×280 Resolution, SPI Interface](https://www.seeedstudio.com/1-69inch-240-280-Resolution-IPS-LCD-Display-Module-p-5755.html) + + +#### Grove - Expansion Board - I2C Display + +
+ +To test this setup we can use an existing sample with Zephyr: + +``` +west build -p always -b xiao_esp32c3 samples/drivers/display -- -DSHIELD=seeed_xiao_expansion_board +west flash +``` + +You'll see a display showing multiple black boxes and a blinking box in the corner given this display only supports two colors. + +Let's dive into this example a bit to see why it works: +``` +/ { + chosen { + zephyr,display = &ssd1306; + }; +}; + +&xiao_i2c { + status = "okay"; + + ssd1306: ssd1306@3c { + compatible = "solomon,ssd1306fb"; + reg = <0x3c>; + width = <128>; + height = <64>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <63>; + segment-remap; + com-invdir; + prechargep = <0x22>; + }; +}; + +``` + +The shield sets up a SSD1306 OLED screen at the 0x3C register. It is selected as the zephyr display in the chosen section. + + +#### Grove - Expansion Board - Button + +To test this setup we can use an existing sample with Zephyr but we'll use an additional Grove LED and an overlay to override the LED to the D0 pin to demonstrate this working (the Xiao ESP32C3 does not have a programmable onboard LED): + +``` +west build -p always -b xiao_esp32c3 samples/basic/button -- -DSHIELD=seeed_xiao_expansion_board -DDTC_OVERLAY_FILE=$(dirname $(pwd))/applications/xiao-zephyr-examples/d0_led.overlay +west flash +west espressif monitor +``` + +Pressing the button with the sample will trigger the D0 associated LED to light up. + +You will see results returned from the console: + +``` +*** Booting Zephyr OS build v3.6.0-2566-gc9b45bf4672a *** +Set up button at gpio@60004000 pin 3 +Set up LED at gpio@60004000 pin 2 +Press the button +Button pressed at 39818120 +Button pressed at 63872629 +Button pressed at 168304681 +Button pressed at 241105558 +Button pressed at 346324767 +Button pressed at 382181856 +Button pressed at 419342954 +``` + +Let's dive into this example a bit to see why it works: +``` +/ { + aliases { + sw0 = &xiao_button0; + }; + + buttons { + compatible = "gpio-keys"; + xiao_button0: button_0 { + gpios = <&xiao_d 1 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "SW0"; + zephyr,code = ; + }; + }; +}; +``` + +The shield / overlay file is used to setup various board components. Using this file the button example can be utilized as the overlay allows the Zephyr to configure the button and make it available for the associated code. + +In this case D1 on the Xiao ESP32C3. It is setup in this overlay to act as a button and is aliased to the sw0 name to allow it to be used for the sample which has code expecting this. + +The LED as shown above in the LED example is also configured via its overlay file. Now with the button associated pressing it lights this LED. + +
+ +#### Grove - Temperature and Humidity Sensor (SHT31) + +First solder on pins and connect your Xiao ESP32C3 to the expansion board. Then connect a grove connector cable between the Grove SHT31 and one of the I2C ports on the expansion board. + +
+ +To test this setup we can use an existing sample with Zephyr: + +``` +west build -p always -b xiao_esp32c3 samples/sensor/sht3xd -- -DDTC_OVERLAY_FILE=$(dirname $(pwd))/applications/xiao-zephyr-examples/sht31.overlay +west flash +west espressif monitor +``` + +You will see results returned from the console: +``` +*** Booting Zephyr OS build v3.6.0-2566-gc9b45bf4672a *** +SHT3XD: 25.92 Cel ; 53.37 %RH +SHT3XD: 25.97 Cel ; 54.37 %RH +SHT3XD: 26.00 Cel ; 54.43 %RH +SHT3XD: 26.02 Cel ; 54.11 %RH +SHT3XD: 26.03 Cel ; 53.33 %RH +SHT3XD: 26.02 Cel ; 52.88 %RH +SHT3XD: 26.04 Cel ; 52.12 %RH +SHT3XD: 26.07 Cel ; 51.87 %RH +SHT3XD: 26.13 Cel ; 52.81 %RH +``` + +Let's dive into this example a bit to see why it works: +``` + &xiao_i2c { + sht3xd@44 { + compatible = "sensirion,sht3xd"; + reg = <0x44>; + }; + }; +``` + +The app overlay file is used to setup various board components. Using this file the SHT31 example can be utilized as the overlay informs the [sample logic](https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/sensor/sht3xd/src/main.c) how to configure the sensor for our board. + +#### 1.69inch LCD Display Module, 240×280 Resolution, SPI Interface + +For this example we'll use SPI to connect to a 1.69 inch LCD with a 240x280 resolution. + +First connect your board to the LCD screen using the following image as a guide (in this case we're using the Xiao ESP32C3 but the same pin layout is used for connecting here). + +| 1.69-inch LCD SPI Display| XIAO ESP32C3 | +| ------------- | ------------------------- | +| VCC | 3V3 | +| GND | GND | +| DIN | D10 | +| CLK | D8 | +| CS | D1 | +| DC | D3 | +| RST | D0 | +| BL | D6 | + +
+ +We can now build and flash the firmware: +``` +cd ~/zephyrproject/zephyr +west build -p always -b xiao_esp32c3 samples/drivers/display -- -DDTC_OVERLAY_FILE=$(dirname $(pwd))/applications/xiao-zephyr-examples/240x280_st7789v2.overlay -DEXTRA_CONF_FILE=$(dirname $(pwd))/applications/xiao-zephyr-examples/240x280_st7789v2.conf +west flash +``` + +With the new firmware in place the device now shows the same demo screen we saw previously on the expansion board just now updated for the color LCD over SPI. + +
+ + +## ✨ Contributor Project + +- This project is supported by the Seeed Studio [Contributor Project](https://github.com/orgs/Seeed-Studio/projects/6?pane=issue&itemId=57293521). +- Thanks **Tim's efforts** and your work will be [exhibited](https://wiki.seeedstudio.com/Honorary-Contributors/). ## Tech Support & Product Discussion Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.
- +
- + -
\ No newline at end of file + diff --git a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_SAMD21/XIAO-SAMD21-Zephyr-RTOS.md b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_SAMD21/XIAO-SAMD21-Zephyr-RTOS.md index b13986ec4a9c..e6bc9dff1689 100644 --- a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_SAMD21/XIAO-SAMD21-Zephyr-RTOS.md +++ b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_SAMD21/XIAO-SAMD21-Zephyr-RTOS.md @@ -184,7 +184,7 @@ Double press RESET or short the RST pin to the GND. west flash ``` -You will see the onboard yellow LED turn toggle creating a blinking effect. +You will see the onboard yellow LED toggle on and off creating a blinking effect. Let's dive into this example a bit to see why it works. From d2df4638ce52e31ebe9e16ddfca64031ab386595 Mon Sep 17 00:00:00 2001 From: Tim Lovett Date: Mon, 22 Apr 2024 01:55:56 -0400 Subject: [PATCH 3/6] Add examples for expansion board buzzer pwm and sd card spi --- .../XIAO-ESP32C3-Zephyr.md | 117 +++++++++++++++++ .../XIAO-ESP32S3-Zephyr-RTOS.md | 116 +++++++++++++++++ .../XIAO-RP2040-Zephyr-RTOS.md | 113 ++++++++++++++++- .../XIAO-SAMD21-Zephyr-RTOS.md | 118 ++++++++++++++++++ 4 files changed, 463 insertions(+), 1 deletion(-) diff --git a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32C3/XIAO-ESP32C3-Zephyr.md b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32C3/XIAO-ESP32C3-Zephyr.md index a9cf796b263d..cdc103276c7b 100644 --- a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32C3/XIAO-ESP32C3-Zephyr.md +++ b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32C3/XIAO-ESP32C3-Zephyr.md @@ -450,6 +450,123 @@ The LED as shown above in the LED example is also configured via its overlay fil
+ +#### Grove - Expansion Board - Buzzer + +We'll activate our buzzer using the blinky PWM example to control its activation via a PWM signal. For this we'll use a custom overlay which enables the PWM for the A3 pin. + +``` +cd ~/zephyrproject/zephyr +west build -p always -b xiao_esp32c3 samples/basic/blinky_pwm -- -DDTC_OVERLAY_FILE="$(dirname $(pwd))/applications/xiao-zephyr-examples/xiao-esp32c3/xiao_expansion_buzzer.overlay" +west flash +``` + +After flashing you should begin hearing a series of buzzes which change in sound as the sample runs its course. + +Let's look at why this works: +``` +#include + +/ { + aliases { + pwm-0 = &ledc0; + pwm-led0 = &pwm_buzzer; + }; + + pwmleds { + compatible = "pwm-leds"; + pwm_buzzer: pwm_led_gpio0_5 { + label = "PWM LED0"; + pwms = <&ledc0 0 1000 PWM_POLARITY_NORMAL>; + }; + }; +}; + +&pinctrl { + ledc0_default: ledc0_default { + group1 { + pinmux = ; + output-enable; + }; + }; +}; + +&ledc0 { + pinctrl-0 = <&ledc0_default>; + pinctrl-names = "default"; + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + channel0@0 { + reg = <0x0>; + timer = <0>; + }; +}; +``` + +The overlay configures the PWM logic for the pin 5 which corresponds with the A3 pin from the ESP32C3 pinout. + +#### Grove - Expansion Board - SD Card + +We'll use the filesystem sample here along with the Xiao Expansion Board shield to try interfacing with the SD card reader over SPI. The expansion board shield has the CS pin configured for the associated `&xiao_d 2` pin so no work is needed on your part for associating this capability with the board aside from adding the shield. To further prepare it we are using a custom config that enables the SD card functionality. + +``` +cd ~/zephyrproject/zephyr +west build -p always -b xiao_esp32c3 samples/subsys/fs/fs_sample -- -DEXTRA_CONF_FILE="$(dirname $(pwd))/applications/xiao-zephyr-examples/xiao_expansion_sd.conf" -DSHIELD=seeed_xiao_expansion_board +``` + +Now flash and monitor: +``` +west flash +west espressif monitor +``` + +You should see a response similar to this: +``` +*** Booting Zephyr OS build v3.6.0-2566-gc9b45bf4672a *** +[00:00:00.032,000] sd: Maximum SD clock is under 25MHz, using clock of 24000000Hz +[00:00:00.033,000] main: Block count 15519744 +Sector size 512 +Memory Size(MB) 7578 +Disk mounted. +Listing dir /SD: ... +[FILE] IMAGE1.JPG (size = 58422) +[FILE] IMAGE2.JPG (size = 97963) +``` + +In this case my SD card had two files. Their names and their sizes were outputted to my console. + +Let's look over the relevant elements at play here: +``` +CONFIG_SPI=y +CONFIG_DISK_DRIVER_SDMMC=y +CONFIG_GPIO=y +``` + +In the associated config we're enabling SPI, the SDMMC disk driver, and the GPIO. Without this config the overlay will lead to an error as the sample is unable to find the SD card. + +The relevant part of the Xiao Expansion Board shield is shown below: + +``` +&xiao_spi { + status = "okay"; + cs-gpios = <&xiao_d 2 GPIO_ACTIVE_LOW>; + + sdhc0: sdhc@0 { + compatible = "zephyr,sdhc-spi-slot"; + reg = <0>; + status = "okay"; + mmc { + compatible = "zephyr,sdmmc-disk"; + status = "okay"; + }; + spi-max-frequency = <24000000>; + }; +}; +``` + +As mentioned previously the `&xiao_d 2` pin mapping is used to allow the D2 pin to be selected for this regardless of the board used so long as it supports the `&xiao_d` pin setup. + #### Grove - Temperature and Humidity Sensor (SHT31) First solder on pins and connect your Xiao ESP32C3 to the expansion board. Then connect a grove connector cable between the Grove SHT31 and one of the I2C ports on the expansion board. diff --git a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32S3/XIAO-ESP32S3-Zephyr-RTOS.md b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32S3/XIAO-ESP32S3-Zephyr-RTOS.md index 6d3639db37dd..e5c0da49efb1 100644 --- a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32S3/XIAO-ESP32S3-Zephyr-RTOS.md +++ b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32S3/XIAO-ESP32S3-Zephyr-RTOS.md @@ -248,6 +248,8 @@ Additional information about TFLite is outside of the scope of this guide but th - [Grove - Expansion Board](https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html) - I2C Display - [Grove - Expansion Board](https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html) - Button +- [Grove - Expansion Board](https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html) - Buzzer +- [Grove - Expansion Board](https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html) - SD Card - [Grove - Temperature and Humidity Sensor (SHT31)](https://www.seeedstudio.com/Grove-Temperature-Humidity-Sensor-SHT31.html) - [1.69inch LCD Display Module, 240×280 Resolution, SPI Interface](https://www.seeedstudio.com/1-69inch-240-280-Resolution-IPS-LCD-Display-Module-p-5755.html) @@ -346,6 +348,120 @@ The shield / overlay file is used to setup various board components. Using this In this case D1 on the Xiao ESP32S3. It is setup in this overlay to act as a button and is aliased to the sw0 name to allow it to be used for the sample which has code expecting this. +#### Grove - Expansion Board - Buzzer + +We'll activate our buzzer using the blinky PWM example to control its activation via a PWM signal. For this we'll use a custom overlay which enables the PWM for the A3 pin. + +``` +cd ~/zephyrproject/zephyr +west build -p always -b xiao_esp32s3 samples/basic/blinky_pwm -- -DDTC_OVERLAY_FILE="$(dirname $(pwd))/applications/xiao-zephyr-examples/xiao-esp32s3/xiao_expansion_buzzer.overlay" +``` + +After flashing you should begin hearing a series of buzzes which change in sound as the sample runs its course. + +Let's look at why this works: +``` +#include + +/ { + aliases { + pwm-0 = &ledc0; + pwm-led0 = &pwm_buzzer; + }; + + pwmleds { + compatible = "pwm-leds"; + pwm_buzzer: pwm_led_gpio0_4 { + label = "PWM Buzzer"; + pwms = <&ledc0 0 1000 PWM_POLARITY_NORMAL>; + }; + }; +}; + +&pinctrl { + ledc0_default: ledc0_default { + group1 { + pinmux = ; + output-enable; + }; + }; +}; + +&ledc0 { + pinctrl-0 = <&ledc0_default>; + pinctrl-names = "default"; + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + channel0@0 { + reg = <0x0>; + timer = <0>; + }; +}; +``` + +The overlay configures the PWM logic for the pin 4 which corresponds with the A3 pin from the ESP32S3 pinout. + +#### Grove - Expansion Board - SD Card + +We'll use the filesystem sample here along with the Xiao Expansion Board shield to try interfacing with the SD card reader over SPI. The expansion board shield has the CS pin configured for the associated `&xiao_d 2` pin so no work is needed on your part for associating this capability with the board aside from adding the shield. To further prepare it we are using a custom config that enables the SD card functionality. + +``` +cd ~/zephyrproject/zephyr +west build -p always -b xiao_esp32s3 samples/subsys/fs/fs_sample -- -DEXTRA_CONF_FILE="$(dirname $(pwd))/applications/xiao-zephyr-examples/xiao_expansion_sd.conf" -DSHIELD=seeed_xiao_expansion_board +``` + +Now flash and monitor: +``` +west flash +west espressif monitor +``` + +You should see a response similar to this: +``` +*** Booting Zephyr OS build v3.6.0-2566-gc9b45bf4672a *** +[00:00:00.208,000] sd: Maximum SD clock is under 25MHz, using clock of 24000000Hz +[00:00:00.208,000] main: Block count 15519744 +Sector size 512 +Memory Size(MB) 7578 +Disk mounted. +Listing dir /SD: ... +[FILE] IMAGE1.JPG (size = 58422) +[FILE] IMAGE2.JPG (size = 97963) +``` + +In this case my SD card had two files. Their names and their sizes were outputted to my console. + +Let's look over the relevant elements at play here: +``` +CONFIG_SPI=y +CONFIG_DISK_DRIVER_SDMMC=y +CONFIG_GPIO=y +``` + +In the associated config we're enabling SPI, the SDMMC disk driver, and the GPIO. Without this config the overlay will lead to an error as the sample is unable to find the SD card. + +The relevant part of the Xiao Expansion Board shield is shown below: + +``` +&xiao_spi { + status = "okay"; + cs-gpios = <&xiao_d 2 GPIO_ACTIVE_LOW>; + + sdhc0: sdhc@0 { + compatible = "zephyr,sdhc-spi-slot"; + reg = <0>; + status = "okay"; + mmc { + compatible = "zephyr,sdmmc-disk"; + status = "okay"; + }; + spi-max-frequency = <24000000>; + }; +}; +``` + +As mentioned previously the `&xiao_d 2` pin mapping is used to allow the D2 pin to be selected for this regardless of the board used so long as it supports the `&xiao_d` pin setup. #### Grove - Temperature and Humidity Sensor (SHT31) diff --git a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_RP2040/XIAO-RP2040-Zephyr-RTOS.md b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_RP2040/XIAO-RP2040-Zephyr-RTOS.md index 1fd127c245c8..8fcd41200390 100644 --- a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_RP2040/XIAO-RP2040-Zephyr-RTOS.md +++ b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_RP2040/XIAO-RP2040-Zephyr-RTOS.md @@ -256,7 +256,6 @@ Now: 30 Set alarm in 32 sec (32000000 ticks) ``` - #### TFLite - Hello World Enable TFLite with Zephyr and update: @@ -307,6 +306,8 @@ x_value: 1.4137159*2^1, y_value: 1.8977352*2^-3 - [Grove - Expansion Board](https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html) - I2C Display - [Grove - Expansion Board](https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html) - Button +- [Grove - Expansion Board](https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html) - Buzzer +- [Grove - Expansion Board](https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html) - SD Card - [Grove - Temperature and Humidity Sensor (SHT31)](https://www.seeedstudio.com/Grove-Temperature-Humidity-Sensor-SHT31.html) - [1.69inch LCD Display Module, 240×280 Resolution, SPI Interface](https://www.seeedstudio.com/1-69inch-240-280-Resolution-IPS-LCD-Display-Module-p-5755.html) @@ -404,6 +405,116 @@ The app overlay file is used to setup various board components. Using this file In this case GPIO 27 corresponds with Pin A1/D1 on the Xiao RP2040. It is setup in this overlay to act as a button and is aliased to the sw0 name to allow it to be used for the sample which has code expecting this. +#### Grove - Expansion Board - Buzzer + +We'll activate our buzzer using the blinky PWM example to control its activation via a PWM signal. For this we'll use a custom overlay which enables the PWM for the A3 pin. + +``` +cd ~/zephyrproject/zephyr +west build -p always -b xiao_rp2040 samples/basic/blinky_pwm -- -DDTC_OVERLAY_FILE="$(dirname $(pwd))/applications/xiao-zephyr-examples/xiao-rp2040/xiao_expansion_buzzer.overlay" +``` + +After uploading the uf2 file you should begin hearing a series of buzzes which change in sound as the sample runs its course. + +Let's look at why this works: +``` +/delete-node/ &pwm_led0; + +/ { + aliases { + pwm-led = &pwm_led0; + }; +}; + +&{/pwm_leds} { + status = "okay"; + compatible = "pwm-leds"; + + pwm_led0: pwm_led0 { + status = "okay"; + pwms = <&pwm 13 PWM_HZ(880) PWM_POLARITY_NORMAL>; + }; +}; + +&pinctrl { + pwm_ch6b_default: pwm_ch6b_default { + group1 { + pinmux = ; + }; + }; +}; + +&pwm { + status = "okay"; + pinctrl-0 = <&pwm_ch6b_default>; + divider-frac-6 = <15>; + divider-int-6 = <255>; +}; +``` + +The overlay in use first removes the existing `pwm_led0` node as this board is supported via an onboard LED setup for PWM. It then configures the A3 pin for use as a PWM. + +We're using channel 6B here for the PWM as the associated pin for A3 on the Xiao RP2040 is pin 29. See the [RP2040 pinctrl documentation](https://docs.zephyrproject.org/apidoc/latest/rpi-pico-rp2040-pinctrl_8h.html#a8c0c1058a626d83ba5f7e18238aba150) for more information / the pin mapping of other pins. + +#### Grove - Expansion Board - SD Card + +We'll use the filesystem sample here along with the Xiao Expansion Board shield to try interfacing with the SD card reader over SPI. The expansion board shield has the CS pin configured for the associated `&xiao_d 2` pin so no work is needed on your part for associating this capability with the board aside from adding the shield. To further prepare it we are using a custom config that enables the SD card functionality. + +``` +cd ~/zephyrproject/zephyr +west build -p always -b xiao_rp2040 samples/subsys/fs/fs_sample -- -DDTC_OVERLAY_FILE="$(dirname $(pwd))/applications/xiao-zephyr-examples/console.overlay" -DEXTRA_CONF_FILE="$(dirname $(pwd))/applications/xiao-zephyr-examples/console.conf $(dirname $(pwd))/applications/xiao-zephyr-examples/xiao_expansion_sd.conf" -DSHIELD=seeed_xiao_expansion_board +``` + +After uploading the uf2 file connect to monitor: +``` +screen /dev/ttyACM0 115200 +``` + +``` +*** Booting Zephyr OS build v3.6.0-2566-gc9b45bf4672a *** +[00:00:00.201,000] sd: Maximum SD clock is under 25MHz, using clock of 24000000Hz +[00:00:00.202,000] main: Block count 15519744 +Sector size 512 +Memory Size(MB) 7578 +Disk mounted. + +Listing dir /SD: ... +[FILE] IMAGE1.JPG (size = 58422) +[FILE] IMAGE2.JPG (size = 97963) +``` + +In this case my SD card had two files. Their names and their sizes were outputted to my console. + +Let's look over the relevant elements at play here: +``` +CONFIG_SPI=y +CONFIG_DISK_DRIVER_SDMMC=y +CONFIG_GPIO=y +``` + +In the associated config we're enabling SPI, the SDMMC disk driver, and the GPIO. Without this config the overlay will lead to an error as the sample is unable to find the SD card. + +The relevant part of the Xiao Expansion Board shield is shown below: + +``` +&xiao_spi { + status = "okay"; + cs-gpios = <&xiao_d 2 GPIO_ACTIVE_LOW>; + + sdhc0: sdhc@0 { + compatible = "zephyr,sdhc-spi-slot"; + reg = <0>; + status = "okay"; + mmc { + compatible = "zephyr,sdmmc-disk"; + status = "okay"; + }; + spi-max-frequency = <24000000>; + }; +}; +``` + +As mentioned previously the `&xiao_d 2` pin mapping is used to allow the D2 pin to be selected for this regardless of the board used so long as it supports the `&xiao_d` pin setup. #### Grove - Temperature and Humidity Sensor (SHT31) diff --git a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_SAMD21/XIAO-SAMD21-Zephyr-RTOS.md b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_SAMD21/XIAO-SAMD21-Zephyr-RTOS.md index e6bc9dff1689..a978695d4fd1 100644 --- a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_SAMD21/XIAO-SAMD21-Zephyr-RTOS.md +++ b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_SAMD21/XIAO-SAMD21-Zephyr-RTOS.md @@ -412,6 +412,8 @@ x_value: 1.4137159*2^1, y_value: 1.8977352*2^-3 - [Grove - Expansion Board](https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html) - I2C Display - [Grove - Expansion Board](https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html) - Button +- [Grove - Expansion Board](https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html) - Buzzer +- [Grove - Expansion Board](https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html) - SD Card - [Grove - Temperature and Humidity Sensor (SHT31)](https://www.seeedstudio.com/Grove-Temperature-Humidity-Sensor-SHT31.html) - [1.69inch LCD Display Module, 240×280 Resolution, SPI Interface](https://www.seeedstudio.com/1-69inch-240-280-Resolution-IPS-LCD-Display-Module-p-5755.html) @@ -521,6 +523,122 @@ The app overlay file is used to setup various board components. Using this file In this case it is using the &xiao_d connector interface to associate D1 as a button. Alternatively we could have used the `&porta` interface here as `&porta 4` which is the corresponding pin on the MCU associated with D1. +#### Grove - Expansion Board - Buzzer + +We'll activate our buzzer using the blinky PWM example to control its activation via a PWM signal. For this we'll use a custom overlay which enables the PWM for the A3 pin. + +``` +cd ~/zephyrproject/zephyr +west build -p always -b seeeduino_xiao samples/basic/blinky_pwm -- -DDTC_OVERLAY_FILE="$(dirname $(pwd))/applications/xiao-zephyr-examples/xiao-samd21/xiao_expansion_buzzer.overlay" +``` + +After uploading the uf2 file you should begin hearing a series of buzzes which change in sound as the sample runs its course. + +Let's look at why this works: +``` +/delete-node/ &pwm_led0; + +/ { + aliases { + pwm-led = &pwm_led0; + }; + + pwm_leds { + status = "okay"; + compatible = "pwm-leds"; + + pwm_led0: pwm_led_0 { + pwms = <&tcc1 1 PWM_HZ(880) >; + }; + }; +}; + +&pinctrl { + pwm_default: pwm_default { + group1 { + pinmux = ; + }; + }; +}; + +&tcc1 { + status = "okay"; + compatible = "atmel,sam0-tcc-pwm"; + /* Gives a maximum period of 1.4 s */ + prescaler = <1024>; + #pwm-cells = <2>; + + pinctrl-0 = <&pwm_default>; + pinctrl-names = "default"; +}; +``` + +The overlay in use first removes the existing `pwm_led0` node as this board is configured with this alias already. It then configures the A3 pin for use as a PWM. + +We're using pin A3 which corresponds with the GPIO PA11 on the SAMD21. Given its associated PWM pinmux is PA11E_TCC1_WO1 we use the tcc1 timer for the PWM. + +#### Grove - Expansion Board - SD Card + +We'll use the filesystem sample here along with the Xiao Expansion Board shield to try interfacing with the SD card reader over SPI. The expansion board shield has the CS pin configured for the associated `&xiao_d 2` pin so no work is needed on your part for associating this capability with the board aside from adding the shield. To further prepare it we are using a custom config that enables the SD card functionality. + +``` +cd ~/zephyrproject/zephyr +west build -p always -b seeeduino_xiao samples/subsys/fs/fs_sample -- -DDTC_OVERLAY_FILE="$(dirname $(pwd))/applications/xiao-zephyr-examples/console.overlay $(dirname $(pwd))/applications/xiao-zephyr-examples/xiao_expansion_sd.overlay" -DEXTRA_CONF_FILE="$(dirname $(pwd))/applications/xiao-zephyr-examples/console.conf $(dirname $(pwd))/applications/xiao-zephyr-examples/xiao_expansion_sd.conf" -DSHIELD=seeed_xiao_expansion_board +``` + +After uploading the uf2 file connect to monitor: +``` +screen /dev/ttyACM0 115200 +``` + +``` +*** Booting Zephyr OS build v3.6.0-2566-gc9b45bf4672a *** +[00:00:00.197,000] sd: Maximum SD clock is under 25MHz, using clock of 10000000Hz +[00:00:00.198,000] main: Block count 15519744 +Sector size 512 +Memory Size(MB) 7578 +Disk mounted. + +Listing dir /SD: ... +[FILE] IMAGE1.JPG (size = 58422) +[FILE] IMAGE2.JPG (size = 97963) +``` + +In this case my SD card had two files. Their names and their sizes were outputted to my console. + +Let's look over the relevant elements at play here: +``` +CONFIG_SPI=y +CONFIG_DISK_DRIVER_SDMMC=y +CONFIG_GPIO=y +``` + +In the associated config we're enabling SPI, the SDMMC disk driver, and the GPIO. Without this config the overlay will lead to an error as the sample is unable to find the SD card. + +The relevant part of the Xiao Expansion Board shield is actually overridden in this example via the `xiao_expansion_sd.overlay` used for the Xiao SAMD21 shown below: + +``` +&xiao_spi { + status = "okay"; + cs-gpios = <&xiao_d 2 GPIO_ACTIVE_LOW>; + + sdhc0: sdhc@0 { + compatible = "zephyr,sdhc-spi-slot"; + reg = <0>; + status = "okay"; + mmc { + compatible = "zephyr,sdmmc-disk"; + status = "okay"; + }; + spi-max-frequency = <10000000>; + }; +}; +``` + +As mentioned previously the `&xiao_d 2` pin mapping is used to allow the D2 pin to be selected for this regardless of the board used so long as it supports the `&xiao_d` pin setup. + +The reason we're not using the shield's overlay here but overriding it is that the `spi-max-frequency` of `24000000` set by the shield is too high which causes the SAMD21 to fail. + #### Grove - Temperature and Humidity Sensor (SHT31) First solder on pins and connect your Xiao SAMD21 to the expansion board. Then connect a grove connector cable between the Grove SHT31 and one of the I2C ports on the expansion board. From c61d27bd4f2bf61bee1b3555fd8ea855a138bd0a Mon Sep 17 00:00:00 2001 From: limengdu <37475446+limengdu@users.noreply.github.com> Date: Tue, 23 Apr 2024 11:22:13 +0800 Subject: [PATCH 4/6] Fix: xiao esp32s3 D/A11 and D/A12 pin clarification --- .../XIAO_ESP32S3_Pin_Multiplexing.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32S3/XIAO_ESP32S3_Pin_Multiplexing.md b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32S3/XIAO_ESP32S3_Pin_Multiplexing.md index 959714909bc0..e86804fc0f4f 100644 --- a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32S3/XIAO_ESP32S3_Pin_Multiplexing.md +++ b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32S3/XIAO_ESP32S3_Pin_Multiplexing.md @@ -181,6 +181,8 @@ Due to the limited number of pins on the ESP32-S3, D11 and D12 on the Sense expa :::caution As can be seen from the picture, due to the space limitations of XIAO, many wire layouts are very compact. Therefore, when cutting the connection between J1 and J2, please be very careful not to cut outside the white line, otherwise it may cause the development board to malfunction! + +For the two additional pins D11 and D12 on the XIAO ESP32S3 Sense, we have not macro-defined the pins. That is, you can't use D11/A11 or D12/A12 to control these two pins yet, but you can control these two pins by using the GPIO numbers, GPIO12 and GPIO13, respectively. we will submit the macro definitions for these two pins as soon as possible, and once the submission is done, then you can D/A the pin definitions. ::: :::tip @@ -220,10 +222,10 @@ For the actual circuit schematic, please refer to the following diagram: #### Step 3. Software implementation -The following program toggles the relay every 500 milliseconds. Connect the SIG pin of the relay to the D11 interface of the expansion board. +The following program toggles the relay every 500 milliseconds. Connect the SIG pin of the relay to the GPIO12 interface of the expansion board. ```c -const int relayPin = D11; +const int relayPin = 12; void setup() { // initialize the Relay pin as an output: @@ -242,6 +244,10 @@ void loop() { The above method is also applicable to the [Digital as PWM](#digital-as-pwm) and [Analog](#analog) sections. You just need to modify the pin numbers of the expansion board that you want to use. This will not be repeated later. +:::caution +For the two additional pins D11 and D12 on the XIAO ESP32S3 Sense, we have not macro-defined the pins. That is, you can't use D11/A11 or D12/A12 to control these two pins yet, but you can control these two pins by using the GPIO numbers, GPIO12 and GPIO13, respectively. we will submit the macro definitions for these two pins as soon as possible, and once the submission is done, then you can D/A the pin definitions. +::: + ## Digital as PWM All GPIO pins on XIAO ESP32S3 support PWM output. Therefore, you can use any pin to output PWM to adjust the brightness of lights, control servos, and other functions. From de9d6da0006e8936dbf7eae6a7974239d76ab448 Mon Sep 17 00:00:00 2001 From: grilliiiii Date: Tue, 23 Apr 2024 14:22:26 +0800 Subject: [PATCH 5/6] Add: xiao samd21 zephyr usage --- .../SeeedStudio_XIAO_SAMD21/XIAO-SAMD21-Zephyr-RTOS.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_SAMD21/XIAO-SAMD21-Zephyr-RTOS.md b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_SAMD21/XIAO-SAMD21-Zephyr-RTOS.md index b13986ec4a9c..e9bf1351e594 100644 --- a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_SAMD21/XIAO-SAMD21-Zephyr-RTOS.md +++ b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_SAMD21/XIAO-SAMD21-Zephyr-RTOS.md @@ -417,7 +417,8 @@ x_value: 1.4137159*2^1, y_value: 1.8977352*2^-3 #### Grove - Expansion Board - I2C Display -
+ +
To test this setup we can use an existing sample with Zephyr: @@ -525,7 +526,8 @@ In this case it is using the &xiao_d connector interface to associate D1 as a bu First solder on pins and connect your Xiao SAMD21 to the expansion board. Then connect a grove connector cable between the Grove SHT31 and one of the I2C ports on the expansion board. -
+ +
To test this setup we can use an existing sample with Zephyr which we will enable USB console support with our overlay and conf. @@ -616,7 +618,8 @@ west flash With the new firmware in place the device now shows the same demo screen we saw previously on the expansion board just now updated for the color LCD over SPI. -
+ +
## ✨ Contributor Project From 05f6b417b2d391c462e62e74682e12abda77f150 Mon Sep 17 00:00:00 2001 From: grilliiiii Date: Tue, 23 Apr 2024 15:59:50 +0800 Subject: [PATCH 6/6] Update: change image links --- .../SeeedStudio_XIAO_ESP32C3/XIAO-ESP32C3-Zephyr.md | 13 +++++++++---- .../XIAO-ESP32S3-Zephyr-RTOS.md | 10 +++++++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32C3/XIAO-ESP32C3-Zephyr.md b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32C3/XIAO-ESP32C3-Zephyr.md index cdc103276c7b..d5f7bb0cc44f 100644 --- a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32C3/XIAO-ESP32C3-Zephyr.md +++ b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32C3/XIAO-ESP32C3-Zephyr.md @@ -354,7 +354,8 @@ Additional information about TFLite is outside of the scope of this guide but th #### Grove - Expansion Board - I2C Display -
+ +
To test this setup we can use an existing sample with Zephyr: @@ -448,7 +449,8 @@ In this case D1 on the Xiao ESP32C3. It is setup in this overlay to act as a but The LED as shown above in the LED example is also configured via its overlay file. Now with the button associated pressing it lights this LED. -
+ +
#### Grove - Expansion Board - Buzzer @@ -571,7 +573,9 @@ As mentioned previously the `&xiao_d 2` pin mapping is used to allow the D2 pin First solder on pins and connect your Xiao ESP32C3 to the expansion board. Then connect a grove connector cable between the Grove SHT31 and one of the I2C ports on the expansion board. -
+ +
+ To test this setup we can use an existing sample with Zephyr: @@ -635,7 +639,8 @@ west flash With the new firmware in place the device now shows the same demo screen we saw previously on the expansion board just now updated for the color LCD over SPI. -
+ +
## ✨ Contributor Project diff --git a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32S3/XIAO-ESP32S3-Zephyr-RTOS.md b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32S3/XIAO-ESP32S3-Zephyr-RTOS.md index e5c0da49efb1..e2ea34917b52 100644 --- a/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32S3/XIAO-ESP32S3-Zephyr-RTOS.md +++ b/docs/Sensor/SeeedStudio_XIAO/SeeedStudio_XIAO_ESP32S3/XIAO-ESP32S3-Zephyr-RTOS.md @@ -256,7 +256,9 @@ Additional information about TFLite is outside of the scope of this guide but th #### Grove - Expansion Board - I2C Display -
+ +
+ To test this setup we can use an existing sample with Zephyr: @@ -467,7 +469,8 @@ As mentioned previously the `&xiao_d 2` pin mapping is used to allow the D2 pin First solder on pins and connect your Xiao ESP32S3 to the expansion board. Then connect a grove connector cable between the Grove SHT31 and one of the I2C ports on the expansion board. -
+ +
To test this setup we can use an existing sample with Zephyr: @@ -532,7 +535,8 @@ west flash With the new firmware in place the device now shows the same demo screen we saw previously on the expansion board just now updated for the color LCD over SPI. -
+ +
## ✨ Contributor Project