10000 esp32/boards: Add support for XIAO ESP32S3/C3 boards. by Maxwelltoo · Pull Request #12042 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

esp32/boards: Add support for XIAO ESP32S3/C3 boards. #12042

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 3 commits into
base: master
Choose a base branch
from
Open
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
19 changes: 19 additions & 0 deletions ports/esp32/boards/SEEED_XIAO_ESP32C3/board.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"deploy": [
"../deploy_c3.md"
],
"docs": "",
"features": [
"BLE",
"USB-C",
"WiFi"
],
"images": [
"xiao_esp32c3.jpg"
],
"mcu": "esp32c3",
"product": "XIAO-ESP32C3",
"thumbnail": "",
"url": "https://wiki.seeedstudio.com/XIAO_ESP32C3_Getting_Started/",
"vendor": "Seeed Studio"
}
2 changes: 2 additions & 0 deletions ports/esp32/boards/SEEED_XIAO_ESP32C3/manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include("$(PORT_DIR)/boards/manifest.py")
freeze("./modules")
12 changes: 12 additions & 0 deletions ports/esp32/boards/SEEED_XIAO_ESP32C3/modules/xiao.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Seeed XIAO ESP32 C3 MicroPython Helper Library

from micropython import const

# SPI
SPI_MOSI = const(10)
SPI_MISO = const(9)
SPI_CLK = const(8)

# I2C
I2C_SDA = const(6)
I2C_SCL = const(7)
9 changes: 9 additions & 0 deletions ports/esp32/boards/SEEED_XIAO_ESP32C3/mpconfigboard.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
set(IDF_TARGET esp32c3)

set(SDKCONFIG_DEFAULTS
boards/sdkconfig.base
boards/sdkconfig.ble
boards/SEEED_XIAO_ESP32C3/sdkconfig.board
)

set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
14 changes: 14 additions & 0 deletions ports/esp32/boards/SEEED_XIAO_ESP32C3/mpconfigboard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#define MICROPY_HW_BOARD_NAME "Seeed XIAO ESP32C3"
#define MICROPY_HW_MCU_NAME "ESP32-C3FN4"
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "XIAO-ESP32C3"

#define MICROPY_HW_ENABLE_SDCARD (0)
#define MICROPY_PY_MACHINE_DAC (0)
#define MICROPY_PY_MACHINE_I2S (0)

#define MICROPY_HW_I2C0_SCL (7)
#define MICROPY_HW_I2C0_SDA (6)

#define MICROPY_HW_SPI1_MOSI (10)
#define MICROPY_HW_SPI1_MISO (9)
#define MICROPY_HW_SPI1_SCK (8)
7 changes: 7 additions & 0 deletions ports/esp32/boards/SEEED_XIAO_ESP32C3/sdkconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CONFIG_ESP32C3_REV_MIN_3=y
CONFIG_ESP32C3_BROWNOUT_DET=y
CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_7=
CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_4=y
CONFIG_ESP32C3_BROWNOUT_DET_LVL=4
CONFIG_ESP_CONSOLE_UART_DEFAULT=
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
23 changes: 23 additions & 0 deletions ports/esp32/boards/SEEED_XIAO_ESP32S3/board.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"deploy": [
"../deploy_s3.md"
],
"docs": "",
"features": [
"SPIRAM",
"USB-C",
"WiFi",
"BLE"
],
"features_non_filterable": [
],
"id": "xiao",
"images": [
"xiao_esp32s3.jpg"
],
"mcu": "esp32s3",
"product": "XIAO-ESP32S3",
"thumbnail": "",
"url": "https://wiki.seeedstudio.com/xiao_esp32s3_getting_started/",
"vendor": "Seeed Studio"
}
2 changes: 2 additions & 0 deletions ports/esp32/boards/SEEED_XIAO_ESP32S3/manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include("$(PORT_DIR)/boards/manifest.py")
freeze("modules")
20 changes: 20 additions & 0 deletions ports/esp32/boards/SEEED_XIAO_ESP32S3/modules/xiao.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# XIAO ESP32 S3 MicroPython Helper Library

from micropython import const
from machine import Pin

# SPI
SPI_MOSI = const(9)
SPI_MISO = const(8)
SPI_CLK = const(7)

# I2C
I2C_SDA = const(5)
I2C_SCL = const(6)

# LED
LED = const(21)

# Helper methods for built in sensors

led = Pin(LED, Pin.OUT, value=0)
12 changes: 12 additions & 0 deletions ports/esp32/boards/SEEED_XIAO_ESP32S3/mpconfigboard.cmake

Choose a reason for hiding this comment

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

I think here you should also add spiram_oct to support octal. Have you tested de ram size with your configuration?

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(IDF_TARGET esp32s3)

set(SDKCONFIG_DEFAULTS
boards/sdkconfig.base
boards/sdkconfig.usb
boards/sdkconfig.ble
boards/sdkconfig.240mhz
boards/sdkconfig.spiram_sx
boards/SEEED_XIAO_ESP32S3/sdkconfig.board
)

set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
12 changes: 12 additions & 0 deletions ports/esp32/boards/SEEED_XIAO_ESP32S3/mpconfigboard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#define MICROPY_HW_BOARD_NAME "Seeed XIAO ESP32S3"
#define MICROPY_HW_MCU_NAME "ESP32-S3-FN8"
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "XIAO-ESP32S3"

#define MICROPY_PY_MACHINE_DAC (0)

#define MICROPY_HW_I2C0_SCL (6)
#define MICROPY_HW_I2C0_SDA (5)

#define MICROPY_HW_SPI1_MOSI (9)
#define MICROPY_HW_SPI1_MISO (8)
#define MICROPY_HW_SPI1_SCK (7)
18 changes: 18 additions & 0 deletions ports/esp32/boards/SEEED_XIAO_ESP32S3/sdkconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
CONFIG_ESPTOOLPY_AFTER_NORESET=y

CONFIG_ESPTOOLPY_FLASHSIZE_4MB=
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-8MiB.csv"

CONFIG_LWIP_LOCAL_HOSTNAME="XIAO-ESP32S3"

CONFIG_TINYUSB_DESC_CUSTOM_VID=0x2886
CONFIG_TINYUSB_DESC_CUSTOM_PID=0x8056
CONFIG_TINYUSB_DESC_BCD_DEVICE=0x0100
CONFIG_TINYUSB_DESC_MANUFACTURER_STRING="Seeed Studio"
CONFIG_TINYUSB_DESC_PRODUCT_STRING="XIAO ESP32S3"
CONFIG_TINYUSB_DESC_SERIAL_STRING="XIAO ESP32S3"
0