Skip to content

boards/esp32s3-seeedstudio: Seeedstudio xiao esp32s3 board support #20973

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

IsikcanYilmaz
Copy link
Contributor

Contribution description

Support for the tiny, barebones board "Seeed Studio Xiao ESP32S3"

Mostly based on the esp32s3-pros3 board

Testing procedure

  • I have not yet tested the SPI/I2C/ADC, as my main goal has been to get my board up and running as soon as possible. I assume the pin definitions etc. are correct due to their similarities to the pros3 board, and what's noted in the vendor's webpage
  • I'm making this PR following the advice on the contributions document 😄(Verify your concept early!) pardon if it's got obvious mistakes that werent obvious to me

@github-actions github-actions bot added Area: doc Area: Documentation Area: boards Area: Board ports Area: Kconfig Area: Kconfig integration labels Nov 11, 2024
@IsikcanYilmaz IsikcanYilmaz force-pushed the board/esp32s3-seeedstudio branch 2 times, most recently from 38765d8 to 1285c4c Compare November 11, 2024 14:00
Copy link
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

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

Looks pretty straightforward!
For the naming, I'd go with esp32s3-seeedstudio-xiao, acknowledging that esp somehow has it's own naming scheme going on, but allowing for future esp32s3 boards by seeedstudio.

Comment on lines +94 to +137
/** TODO all gpios are pwm in seeed esp32s3
* @brief Declaration of the channels for device PWM_DEV(0),
* at maximum PWM_CHANNEL_NUM_DEV_MAX.
*/
// #ifndef PWM0_GPIOS
// #define PWM0_GPIOS { GPIO12, GPIO13, GPIO14, GPIO15, GPIO16 }
// #endif

/**
* @brief Declaration of the channels for device PWM_DEV(1),
* at maximum PWM_CHANNEL_NUM_DEV_MAX.
*/
// #ifndef PWM1_GPIOS
// #define PWM1_GPIOS { GPIO6, GPIO7, GPIO21, GPIO38 }
// #endif

/** @} */

/**
* @name SPI configuration
*
* @note The GPIOs listed in the configuration are first initialized as SPI
* signals when the corresponding SPI interface is used for the first time
* by either calling the `spi_init_cs` function or the `spi_acquire`
* function. That is, they are not allocated as SPI signals before and can
* be used for other purposes as long as the SPI interface is not used.
* @{ TODO SPI pins
*/
// #ifndef SPI0_CTRL
// #define SPI0_CTRL FSPI /**< FSPI is used as SPI_DEV(0) */
// #endif
// #ifndef SPI0_SCK
// #define SPI0_SCK GPIO36 /**< FSPI SCK (pin FSPICLK) */
// #endif
// #ifndef SPI0_MISO
// #define SPI0_MISO GPIO37 /**< FSPI MISO (pin FSPIQ) */
// #endif
// #ifndef SPI0_MOSI
// #define SPI0_MOSI GPIO35 /**< FSPI MOSI (pin FSPID) */
// #endif
// #ifndef SPI0_CS0
// #define SPI0_CS0 GPIO34 /**< FSPI CS0 (pin FSPICS0) */
// #endif
/** @} */
Copy link
Contributor

Choose a reason for hiding this comment

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

Either define them or remove them 😉

Copy link
Contributor

@gschorcht gschorcht Nov 12, 2024

Choose a reason for hiding this comment

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

I would prefer to define them at least for the SPI what schouldn't be a problem.

#define SPI0_SCK    GPIO7
...
#define SPI0_MISO   GPIO8
...
#define SPI0_MOSI   GPIO9
...
#define SPI0_CS0    <any available GPIO, e.g. GPIO3 (D2/A2)>

Copy link
Contributor

@gschorcht gschorcht Nov 12, 2024

Choose a reason for hiding this comment

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

Since GPIO3 (D2/A2) is also used for the SD Card Expansion port, it makes sense to use GPIO3 also for SPI0_CS0. This ensures that the SD Card Expansion Board works with with our sdcard_spi driver.

Copy link
Contributor

Choose a reason for hiding this comment

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

Unless you define them, the doc.txt would need to be adapted to reflect the pins that are actually usable from RIOT with the default configuration.

* at maximum PWM_CHANNEL_NUM_DEV_MAX.
*/
// #ifndef PWM0_GPIOS
// #define PWM0_GPIOS { GPIO12, GPIO13, GPIO14, GPIO15, GPIO16 }
Copy link
Contributor

Choose a reason for hiding this comment

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

Some or at least the USER LED pin GPIO21 should be defined as PWM channel.

@mguetschow
Copy link
Contributor

For the naming, I'd go with esp32s3-seeedstudio-xiao, acknowledging that esp somehow has it's own naming scheme going on, but allowing for future esp32s3 boards by seeedstudio.

According to https://github.com/RIOT-OS/RIOT/blob/master/doc/memos/rdm0003.md, I'd rather go with seeedstudio-xiao-esp32s3 (I know board naming has been a mess, but at least there is some common scheme now with RDM0003).

Copy link
Contributor

@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

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

Thanks for your PR, much appreciated! 🎉 some comments below

* @brief Support for the Seeed Studio Xiao ESP32S3
* @author Isikcan 'Jon' Yilmaz <[email protected]>

\section esp32s3_seeedstudio Seeed Studio Xiao ESP32
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
\section esp32s3_seeedstudio Seeed Studio Xiao ESP32
\section esp32s3_seeedstudio Seeed Studio Xiao ESP32S3

?

Comment on lines +94 to +137
/** TODO all gpios are pwm in seeed esp32s3
* @brief Declaration of the channels for device PWM_DEV(0),
* at maximum PWM_CHANNEL_NUM_DEV_MAX.
*/
// #ifndef PWM0_GPIOS
// #define PWM0_GPIOS { GPIO12, GPIO13, GPIO14, GPIO15, GPIO16 }
// #endif

/**
* @brief Declaration of the channels for device PWM_DEV(1),
* at maximum PWM_CHANNEL_NUM_DEV_MAX.
*/
// #ifndef PWM1_GPIOS
// #define PWM1_GPIOS { GPIO6, GPIO7, GPIO21, GPIO38 }
// #endif

/** @} */

/**
* @name SPI configuration
*
* @note The GPIOs listed in the configuration are first initialized as SPI
* signals when the corresponding SPI interface is used for the first time
* by either calling the `spi_init_cs` function or the `spi_acquire`
* function. That is, they are not allocated as SPI signals before and can
* be used for other purposes as long as the SPI interface is not used.
* @{ TODO SPI pins
*/
// #ifndef SPI0_CTRL
// #define SPI0_CTRL FSPI /**< FSPI is used as SPI_DEV(0) */
// #endif
// #ifndef SPI0_SCK
// #define SPI0_SCK GPIO36 /**< FSPI SCK (pin FSPICLK) */
// #endif
// #ifndef SPI0_MISO
// #define SPI0_MISO GPIO37 /**< FSPI MISO (pin FSPIQ) */
// #endif
// #ifndef SPI0_MOSI
// #define SPI0_MOSI GPIO35 /**< FSPI MOSI (pin FSPID) */
// #endif
// #ifndef SPI0_CS0
// #define SPI0_CS0 GPIO34 /**< FSPI CS0 (pin FSPICS0) */
// #endif
/** @} */
Copy link
Contributor

Choose a reason for hiding this comment

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

Unless you define them, the doc.txt would need to be adapted to reflect the pins that are actually usable from RIOT with the default configuration.

Comment on lines +154 to +158
/**
* @name Camera configurations and pins
* TODO also mic pins
*/

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/**
* @name Camera configurations and pins
* TODO also mic pins
*/

The board doesn't have those, right?

@mguetschow mguetschow added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Nov 12, 2024
@IsikcanYilmaz
Copy link
Contributor Author

sorry folks, maybe this PR was more premature than i thought.

@riot-ci
Copy link

riot-ci commented Nov 12, 2024

Murdock results

FAILED

5ded807 boards/esp32s3-seeedstudio: seeedstudio xiao esp32s3 board support. mostly copied from esp32s3-pros3 board files.

Success Failures Total Runtime
91 0 555 31s

Artifacts

@benpicco
Copy link
Contributor

sorry folks, maybe this PR was more premature than i thought.

No worries, nothing wrong with getting feedback early

…ostly copied from esp32s3-pros3 board files.
@IsikcanYilmaz IsikcanYilmaz force-pushed the board/esp32s3-seeedstudio branch from 1285c4c to 5ded807 Compare January 29, 2025 23:09
Copy link
Contributor

@crasbe crasbe left a comment

Choose a reason for hiding this comment

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

@IsikcanYilmaz I can give this a test soon (the hardware will arrive this week). Perhaps you can use #21267 for orientation for the last remaining tasks.
For the time being I gave this an initial review which addresses some things that were present in #21267 as well.

You can also follow the guide in #21220 and change the doc.txt to the new Markdown format.

# other features provided by the board
FEATURES_PROVIDED += esp_jtag
FEATURES_PROVIDED += highlevel_stdio
FEATURES_PROVIDED += tinyusb_device
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
FEATURES_PROVIDED += tinyusb_device
FEATURES_PROVIDED += tinyusb_device
FEATURES_PROVIDED += xiao_shield

PR #20980 will introduce the xiao_shield feature, which applies to this PR as well. You'll have to wait before adding this until the PR is merged. Otherwise you will get a Make error.

Comment on lines +19 to +25
1. [Overview](#esp32s3_seeedstudio_overview)
2. [Hardware](#esp32s3_seeedstudio_hardware)
1. [MCU](#esp32s3_seeedstudio_mcu)
2. [Board Configuration](#esp32s3_seeedstudio_board_configuration)
3. [Board Pinout](#esp32s3_seeedstudio_pinout)
3. [Flashing the Device](#esp32s3_seeedstudio_flashing)
4. [Using STDIO](#esp32s3_seeedstudio_stdio)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
1. [Overview](#esp32s3_seeedstudio_overview)
2. [Hardware](#esp32s3_seeedstudio_hardware)
1. [MCU](#esp32s3_seeedstudio_mcu)
2. [Board Configuration](#esp32s3_seeedstudio_board_configuration)
3. [Board Pinout](#esp32s3_seeedstudio_pinout)
3. [Flashing the Device](#esp32s3_seeedstudio_flashing)
4. [Using STDIO](#esp32s3_seeedstudio_stdio)
-# [Overview](#esp32s3_seeedstudio_overview)
-# [Hardware](#esp32s3_seeedstudio_hardware)
-# [MCU](#esp32s3_seeedstudio_mcu)
-# [Board Configuration](#esp32s3_seeedstudio_board_configuration)
-# [Board Pinout](#esp32s3_seeedstudio_pinout)
-# [Flashing the Device](#esp32s3_seeedstudio_flashing)
-# [Using STDIO](#esp32s3_seeedstudio_stdio)

Doxygen supports automatic numbering of the tables. That makes it a lot easier to add or remove elements later on because it's not required to renumber everything.

Comment on lines +1 to +2
# The board uses a ESP32-S3 with a 16MB QSPI Flash and a 8MB QSPI PSRAM
FLASH_SIZE ?= 16
Copy link
Contributor

Choose a reason for hiding this comment

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

The specifications say it has 8MB of QSPI Flash: https://wiki.seeedstudio.com/xiao_esp32s3_getting_started/#specification

* Since the GPIO of the button is pulled up with an external resistor, the
* mode for the GPIO pin has to be GPIO_IN.
*/
#define BTN0_MODE GPIO_IN_PU
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#define BTN0_MODE GPIO_IN_PU
#define BTN0_MODE GPIO_IN

See #21267 (comment)

/**
* @name I2C configuration
*
* For generic boards, only one I2C interface I2C_DEV(0) is defined.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably be adapted for the Xiao specifically.

#endif

/**
* @name ADC and DAC channel configuration
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @name ADC and DAC channel configuration
* @name ADC channel configuration

The ESP32S3 does not have a DAC.

* ESP32-S3 provides 3 UART interfaces at maximum:
*
* UART_DEV(0) uses fixed standard configuration.<br>
* UART_DEV(1) is not used.<br>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* UART_DEV(1) is not used.<br>
* UART_DEV(1) is not used.<br>
* UART_DEV(2) is not used.<br>

For completeness.

@crasbe
Copy link
Contributor

crasbe commented Mar 13, 2025

The Xiao-ESP32S3 arrived today and I gave it a quick test with some tests:

The tests/periph/adc test shows the correct values when the pins are pulled up or down.
As with the Xiao-ESP32C3, sometimes some data is lost, but that's most likely not caused by this PR.

/home/cbuec/RIOTstuff/riot-esp32c3/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200" -ln "/tmp/pyterm-cbuec" -rn "2025-03-13_22.47.51-tests_adc-esp32s3-seeedstudio"
2025-03-13 22:47:51,782 # Connect to serial port /dev/ttyACM0
Welcome to pyterm!
Type '/exit' to exit.
2025-03-13 22:47:52,789 # ADC_LINE(0): 20  81  325 1296    -1    -1
2025-03-13 22:47:52,789 # ADC_LINE(1): 20  80  323 1299    -1    -1
2025-03-13 22:47:52,790 # ADC_LINE(2): 20  80  323 1296    -1    -1
2025-03-13 22:47:52,790 # ADC_LINE(3): 20  81  323 1303    -1    -1
2025-03-13 22:47:52,790 # ADC_LINE(4): 20  80  323 1299    -1    -1
2025-03-13 22:47:52,791 # ADC_LINE(5): 20  80  325 1301    -1    -1
2025-03-13 22:47:52,791 # ADC_LINE(6): 20  81  325 1299    -1    -1
2025-03-13 22:47:52,791 # ADC_LINE(7): 20  80  325 1299    -1    -1
2025-03-13 22:47:52,791 # ADC_LINE(8): 20  81  325 1293    -1    -1
2025-03-13 22:47:52,791 #
2025-03-13 22:47:53,717 # ADC_LINE(0): 20  80  323 1293    -1    -1
2025-03-13 22:47:53,718 # ADC_LINE(1): 20  81  323 1293    -1    -1
2025-03-13 22:47:53,719 # ADC_LINE(2): 20  80  325 1293    -1    -1
2025-03-13 22:47:53,719 # ADC_LINE(3): 20  80  324 12    -1
2025-03-13 22:47:53,719 # ADC_LINE(4): 20  81  324 1296    -1    -1
2025-03-13 22:47:53,720 # ADC_LINE(5): 20  80  324 1303    -1    -1
2025-03-13 22:47:53,721 # ADC_LINE(6): 20  81  322 1295    -1    -1
2025-03-13 22:47:53,721 # ADC_LINE(7): 20  81  322 1293    -1    -1
2025-03-13 22:47:53,722 # ADC_LINE(8): 20  81  324 1292    -1    -1

The tests/sys/shell test works as well:

/home/cbuec/RIOTstuff/riot-esp32c3/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200" -ln "/tmp/pyterm-cbuec" -rn "2025-03-13_22.49.58-tests_shell-esp32s3-seeedstudio"
2025-03-13 22:49:58,914 # Connect to serial port /dev/ttyACM0
Welcome to pyterm!
Type '/exit' to exit.
help
2025-03-13 22:50:04,378 # help
2025-03-13 22:50:04,379 # Command              Description
2025-03-13 22:50:04,380 # -------------------------------
2025-03-13 22:50:04,381 # bufsize              Get the shell's buffer size
2025-03-13 22:50:04,382 # start_test           starts a test
2025-03-13 22:50:04,382 # end_test             ends a test
2025-03-13 22:50:04,382 # echo                 prints the input command
2025-03-13 22:50:04,383 # empty                print nothing on command
2025-03-13 22:50:04,383 # periodic             periodically print command
2025-03-13 22:50:04,384 # xfa_test1            xfa test command 1
2025-03-13 22:50:04,384 # xfa_test2            xfa test command 2
2025-03-13 22:50:04,385 # app_metadata         Returns application metadata
2025-03-13 22:50:04,385 # pm                   interact with layered PM subsystem
2025-03-13 22:50:04,385 # ps                   Prints information about running threads.
2025-03-13 22:50:04,386 # version              Prints current RIOT_VERSION
2025-03-13 22:50:04,386 # bootloader           Reboot to bootloader
2025-03-13 22:50:04,386 # reboot               Reboot the node
> periodic
2025-03-13 22:50:10,355 # periodic
> 2025-03-13 22:50:10,856 # test
b2025-03-13 22:50:11,356 # test
2025-03-13 22:50:12,447 # test
2025-03-13 22:50:12,948 # test
2025-03-13 22:50:13,447 # test
> ps
2025-03-13 22:50:19,212 # ps
2025-03-13 22:50:19,213 #       pid | name                 | state    Q | pri
2025-03-13 22:50:19,215 #         1 | esp_timer            | sleeping _ |   2
2025-03-13 22:50:19,216 #         2 | idle                 | pending  Q |  15
2025-03-13 22:50:19,216 #         3 | main                 | running  Q |   7
> bootloader
2025-03-13 22:50:25,337 # bootloader
2025-03-13 22:50:25,338 # ESP-ROM:esp32s3-20210327
2025-03-13 22:50:25,338 # Build:Mar 27 2021
2025-03-13 22:50:25,339 # rst:0x3 (RTC_SW_SYS_RST),boot:0x0 (DOWNLOAD(USB/UART0))
2025-03-13 22:50:25,339 # Saved PC:0x42003db7
2025-03-13 22:50:25,340 # waiting for download

@crasbe
Copy link
Contributor

crasbe commented Mar 14, 2025

As with the Xiao-ESP32C3, sometimes some data is lost, but that's most likely not caused by this PR.

Indeed, this was caused by USBipd. On my Linux ThinkPad, the data looks absolutely fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: doc Area: Documentation Area: Kconfig Area: Kconfig integration CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants