-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
19917: boards: add support for ESP32-S3 WT32 SC01 Plus board r=benpicco a=gschorcht ### Contribution description This PR provides support for the [Wireless Tag WT32-SC01 Plus with ESP32-S3](http://en.wireless-tag.com/product-item-26.html) board. The board has the following main features: - ESP32-S3 SoC - 16 MB Flash - 2 MB QSPI RAM - 3.5" LCD Display 480 x 320 with ST7796UI - Capacitive Touch Panel with FT6336U - SD Card SPI mode - USB Type-C **Please note**: The ST7796UI display uses the MCU8080 8-bit parallel interface which require the changes in PR #19915. ### Testing procedure 1. `tests/drivers/st77xx` should work on top of PR #19915. ``` BOARD=esp32s3-wt32-sc01-plus make -j8 -C tests/drivers/st77xx flash ``` 2. `tests/drivers/ft5x06` should work with `stdio_uart` and the debugging tool. ``` USEMODULE=stdio_uart BOARD=esp32s3-wt32-sc01-plus make -j8 -C tests/drivers/ft5x06/ flash term ``` ``` main(): This is RIOT! (Version: 2023.10-devel-245-g55bd7-boards/esp32s3-wt32-sc01-plus) FT5x06 test application +------------Initializing------------+ Initialization successful 1 touch detected Touch 1 - X: 177, Y:96 Touch 1 - X: 177, Y:96 Touch 1 - X: 177, Y:96 Touch 1 - X: 177, Y:97 Touch 1 - X: 178, Y:99 Touch 1 - X: 180, Y:102 Touch 1 - X: 184, Y:106 Touch 1 - X: 190, Y:110 Touch 1 - X: 197, Y:116 Touch 1 - X: 204, Y:122 Released! ``` ### Issues/PRs references Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
- Loading branch information
Showing
12 changed files
with
645 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright (c) 2020 HAW Hamburg | ||
# 2023 Gunar Schorcht | ||
# | ||
# This file is subject to the terms and conditions of the GNU Lesser | ||
# General Public License v2.1. See the file LICENSE in the top level | ||
# directory for more details. | ||
|
||
config BOARD | ||
default "esp32s3-wt32-sc01-plus" if BOARD_ESP32S3_WT32_SC01_PLUS | ||
|
||
config BOARD_ESP32S3_WT32_SC01_PLUS | ||
bool | ||
default y | ||
select BOARD_COMMON_ESP32S3 | ||
select CPU_MODEL_ESP32S3_WROOM_1X_N16R2 | ||
select HAS_ESP_JTAG | ||
select HAS_HIGHLEVEL_STDIO | ||
select HAS_PERIPH_I2C | ||
select HAS_PERIPH_SPI | ||
select HAS_PERIPH_UART | ||
select HAS_PERIPH_USBDEV | ||
select HAS_SDCARD_SPI | ||
select HAS_TINYUSB_DEVICE | ||
|
||
select HAVE_FT5X06 | ||
select HAVE_LCD_PARALLEL | ||
select HAVE_MTD_SDCARD_DEFAULT | ||
select HAVE_ST7796 | ||
|
||
select MODULE_FATFS_VFS if MODULE_VFS_DEFAULT | ||
select MODULE_USB_BOARD_RESET if MODULE_STDIO_USB_SERIAL_JTAG | ||
select REQUIRES_USB_STDIO if MODULE_USBUS || MODULE_TINYUSB_DEVICE | ||
|
||
choice STDIO_IMPLEMENTATION | ||
default MODULE_STDIO_CDC_ACM if MODULE_USBUS | ||
default MODULE_STDIO_TINYUSB_CDC_ACM if MODULE_TINYUSB_DEVICE | ||
default MODULE_STDIO_USB_SERIAL_JTAG | ||
endchoice | ||
|
||
source "$(RIOTBOARD)/common/esp32s3/Kconfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
MODULE = board | ||
|
||
DIRS = $(RIOTBOARD)/common/esp32s3 | ||
|
||
include $(RIOTBASE)/Makefile.base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
ifeq (,$(filter stdio_% slipdev_stdio usbus usbus% tinyusb_device,$(USEMODULE))) | ||
# Use stdio_usb_serial_jtag if no other stdio is requested explicitly | ||
# and neither USBUS nor tinyusb_device are used | ||
USEMODULE += stdio_usb_serial_jtag | ||
# Even if only stdio_usb_serial_jtag is enabled, usb_board_reset is enabled | ||
# since there should be a CDC ACM interface in any case. This is necessary, | ||
# for example, to reset the board if stdio_cdc_acm or stdio_tinyusb_cdc_acm | ||
# was previously used. | ||
USEMODULE += usb_board_reset | ||
# include $(RIOTMAKE)/tools/usb_board_reset.mk | ||
endif | ||
|
||
include $(RIOTBOARD)/common/esp32s3/Makefile.dep | ||
include $(RIOTBOARD)/common/makefiles/stdio_cdc_acm.dep.mk | ||
|
||
# default to using fatfs on SD card | ||
ifneq (,$(filter vfs_default,$(USEMODULE))) | ||
USEMODULE += fatfs_vfs | ||
USEMODULE += mtd | ||
endif | ||
|
||
ifneq (,$(filter mtd,$(USEMODULE))) | ||
USEMODULE += mtd_sdcard_default | ||
endif | ||
|
||
ifneq (,$(filter disp_dev,$(USEMODULE))) | ||
USEMODULE += st7796 | ||
endif | ||
|
||
ifneq (,$(filter st7796,$(USEMODULE))) | ||
USEMODULE += lcd_parallel | ||
endif | ||
|
||
ifneq (,$(filter touch_dev,$(USEMODULE))) | ||
USEMODULE += ft5x06 | ||
endif | ||
|
||
ifneq (,$(filter periph_i2c,$(USEMODULE))) | ||
USEMODULE += esp_i2c_hw | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# actually the board uses a WT32-S3-WROVER-N16R2 module which in fact | ||
# is the same as the ESP32-S3-WROOM-1-N16R2 | ||
CPU_MODEL = esp32s3_wroom_1x_n16r2 | ||
|
||
# additional features provided by the board | ||
FEATURES_PROVIDED += periph_i2c | ||
FEATURES_PROVIDED += periph_spi | ||
FEATURES_PROVIDED += periph_uart | ||
FEATURES_PROVIDED += periph_usbdev | ||
|
||
# unique features provided by the board | ||
FEATURES_PROVIDED += esp_jtag | ||
FEATURES_PROVIDED += sdcard_spi | ||
FEATURES_PROVIDED += highlevel_stdio | ||
FEATURES_PROVIDED += tinyusb_device | ||
|
||
# common board and CPU features | ||
include $(RIOTBOARD)/common/esp32s3/Makefile.features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PORT_LINUX ?= /dev/ttyACM0 | ||
|
||
OPENOCD_CONFIG ?= board/esp32s3-builtin.cfg | ||
|
||
include $(RIOTBOARD)/common/esp32s3/Makefile.include |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (C) 2023 Gunar Schorcht | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @ingroup boards_esp32s3_wt32_sc01_plus | ||
* @{ | ||
* | ||
* @file | ||
* @brief Board specific initializations for ESP32-S3 WT32-SC01 Plus | ||
* | ||
* @author Gunar Schorcht <gunar@schorcht.net> | ||
*/ | ||
|
||
#include "board.h" | ||
|
||
void board_init(void) | ||
{ | ||
#if MODULE_ST77XX | ||
gpio_init(LCD_BACKLIGHT, GPIO_OUT); | ||
#endif | ||
#if MODULE_FT5X06 | ||
gpio_init(FT5X06_PARAM_RST_PIN, GPIO_OUT); | ||
gpio_set(FT5X06_PARAM_RST_PIN); | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
/* | ||
* Copyright (C) 2023 Gunar Schorcht | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @defgroup boards_esp32s3_wt32_sc01_plus ESP32-S3 WT32-SC01 Plus | ||
* @ingroup boards_esp32s3 | ||
* @brief Support for the ESP32-S3 WT32-SC01 Plus | ||
* @author Gunar Schorcht <gunar@schorcht.net> | ||
|
||
\section esp32s3_wt32_sc01_plus ESP32-S3 WT32-SC01 Plus | ||
|
||
## Table of Contents {#esp32s3_wt32_sc01_plus_toc} | ||
|
||
1. [Overview](#esp32s3_wt32_sc01_plus_overview) | ||
2. [Hardware](#esp32s3_wt32_sc01_plus_hardware) | ||
1. [MCU](#esp32s3_wt32_sc01_plus_mcu) | ||
2. [Board Configuration](#esp32s3_wt32_sc01_plus_board_configuration) | ||
3. [Board Pinout](#esp32s3_wt32_sc01_plus_pinout) | ||
3. [Flashing the Device](#esp32s3_wt32_sc01_plus_flashing) | ||
4. [Debugging with the Device](#esp32s3_wt32_sc01_plus_debugging) | ||
|
||
## Overview {#esp32s3_wt32_sc01_plus_overview} | ||
|
||
The [Wireless Tag WT32-SC01 Plus](http://en.wireless-tag.com/product-item-26.html) | ||
is a smart panel development platform with the ESP32-S3 SoC. | ||
|
||
\image html https://raw.githubusercontent.com/sukesh-ak/ESP32-TUX/master/datasheet/WT32-SC01-Plus.png "ESP32-S3 WT32-SC01 Plus" width=400px | ||
|
||
It also available on the market as [Smart Panlee SC01 Plus] | ||
(http://en.smartpanle.com/product-item-15.html). | ||
|
||
The ESP32-S3 WT32-SC01 Plus has following main features: | ||
<center> | ||
|Feature | Support | | ||
|:--------------------------------------------|:-------:| | ||
| ESP32-S3 SoC | yes | | ||
| 16 MB Flash | yes | | ||
| 2 MB QSPI RAM | yes | | ||
| 3.5" LCD Display 480 x 320 with ST7796UI | yes | | ||
| Capacitive Touch Panel with FT6336U | yes | | ||
| SD Card SPI mode | yes | | ||
| USB Type-C | yes | | ||
| RS485 interface | no | | ||
</center> | ||
\n | ||
|
||
[Back to table of contents](#esp32s3_wt32_sc01_plus_toc) | ||
|
||
## Hardware {#esp32s3_wt32_sc01_plus_hardware} | ||
|
||
This section describes | ||
|
||
- the [MCU](#esp32s3_wt32_sc01_plus_mcu), | ||
- the default [board configuration](#esp32s3_wt32_sc01_plus_board_configuration), | ||
- the [board pinout](#esp32s3_wt32_sc01_plus_pinout). | ||
|
||
[Back to table of contents](#esp32s3_wt32_sc01_plus_toc) | ||
|
||
### MCU {#esp32s3_wt32_sc01_plus_mcu} | ||
|
||
Most features of the ESP32-S3 WT32-SC01 Plus are provided by the ESP32-S3 SoC. | ||
For detailed information about the ESP32-S3 SoC variant (family) and ESP32x | ||
SoCs, see section \ref esp32_mcu_esp32 "ESP32 SoC Series". | ||
|
||
[Back to table of contents](#esp32s3_wt32_sc01_plus_toc) | ||
|
||
### Board Configuration {#esp32s3_wt32_sc01_plus_board_configuration} | ||
|
||
The following table shows the default ESP32-S3 WT32-SC01 Plus configuration, | ||
which is sorted according to the defined functionality of the GPIOs. | ||
|
||
<center> | ||
Function | GPIOs | Remarks | Configuration | ||
:---------------|:-------|:--------|:---------------------------------- | ||
I2C_DEV(0) SCL | GPIO5 | Touch Panel | \ref esp32_i2c_interfaces "I2C Interfaces" | ||
I2C_DEV(0) SDA | GPIO6 | Touch Panel | \ref esp32_i2c_interfaces "I2C Interfaces" | ||
SPI_DEV(0) CLK | GPIO39 | SD Card | \ref esp32_spi_interfaces "SPI Interfaces" | ||
SPI_DEV(0) MISO | GPIO38 | SD Card | \ref esp32_spi_interfaces "SPI Interfaces" | ||
SPI_DEV(0) MOSI | GPIO40 | SD Card | \ref esp32_spi_interfaces "SPI Interfaces" | ||
SPI_DEV(0) CS0 | GPIO41 | SD Card | \ref esp32_spi_interfaces "SPI Interfaces" | ||
UART_DEV(0) TxD | GPIO43 | DEBUG interface | \ref esp32_uart_interfaces "UART interfaces" | ||
UART_DEV(0) RxD | GPIO44 | DEBUG interface | \ref esp32_uart_interfaces "UART interfaces" | ||
LCD BACKLIGHT | GPIO45 | LCD Backlight | | | ||
LCD RESET | GPIO4 | LCD reset | | | ||
LCD RS | GPIO0 | LCD Command/Data Selection | | | ||
LCD WR | GPIO47 | LCD Write Clock | | | ||
LCD TE | GPIO48 | LCD Frame Sync | | | ||
LCD DB0 | GPIO9 | LCD 8-bit parallel interface D0 | | | ||
LCD DB1 | GPIO46 | LCD 8-bit parallel interface D1 | | | ||
LCD DB2 | GPIO3 | LCD 8-bit parallel interface D2 | | | ||
LCD DB3 | GPIO8 | LCD 8-bit parallel interface D3 | | | ||
LCD DB4 | GPIO18 | LCD 8-bit parallel interface D4 | | | ||
LCD DB5 | GPIO17 | LCD 8-bit parallel interface D5 | | | ||
LCD DB6 | GPIO16 | LCD 8-bit parallel interface D6 | | | ||
LCD DB7 | GPIO15 | LCD 8-bit parallel interface D7 | | | ||
TP INT | GPIO7 | Touch Interrupt | | | ||
TP RST | GPIO4 | Touch Reset | | | ||
</center> | ||
\n | ||
|
||
[Back to table of contents](#esp32s3_wt32_sc01_plus_toc) | ||
|
||
### Board Pinout {#esp32s3_wt32_sc01_plus_pinout} | ||
|
||
The pinout including the schematics of the board are described in detail in the | ||
[data sheet](https://www.antratek.de/media/wysiwyg/pdf/WT32-SC01-Plus-V1.3-EN.pdf). | ||
|
||
The board has different external interfaces that can be used to connect | ||
external hardware: | ||
|
||
<b>Extended I/O Interface (EXT)</b> | ||
|
||
Pin | Description | ||
----|:----------- | ||
1 | 5V | ||
2 | GND | ||
3 | EXT_IO1 (GPIO10) | ||
4 | EXT_IO2 (GPIO11) | ||
5 | EXT_IO3 (GPIO12) | ||
6 | EXT_IO4 (GPIO13) | ||
7 | EXT_IO5 (GPIO14) | ||
8 | EXT_IO6 (GPIO21) | ||
\n | ||
|
||
<b>RS485 Interface</b> | ||
|
||
Pin | Description | ||
----|:----------- | ||
1 | RS485-A | ||
2 | RS485-B | ||
3 | GND | ||
4 | 5V | ||
\n | ||
|
||
<b>Debug Interface (DEBUG)</b> | ||
|
||
Pin | Description | ||
----|:----------- | ||
1 | 5V | ||
2 | 3V3 | ||
3 | UART_DEV(0) TxD | ||
4 | UART_DEV(0) RxD | ||
5 | RESET (EN) | ||
6 | BOOT (GPIO0) | ||
7 | GND | ||
\n | ||
|
||
[Back to table of contents](#esp32s3_wt32_sc01_plus_toc) | ||
|
||
## Flashing the Device {#esp32s3_wt32_sc01_plus_flashing} | ||
|
||
Since the ESP32-S3 WT32-SC01 Plus does not have a USB-to-Serial chip, the | ||
easiest way to flash it is using the USB Serial/JTAG interface. Just connect | ||
the ESP32-S3 WT32-SC01 Plus to your host computer and use the following command: | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
BOARD=esp32s3-wt32-sc01-plus make flash ... | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Usually the make system resets the ESP32-S3 WT32-SC01 Plus before flashing to | ||
enable the USB Serial/JTAG controller and to reboot the ESP32-S3 in download | ||
mode. | ||
|
||
[Back to table of contents](#esp32s3_wt32_sc01_plus_toc) | ||
|
||
## Debugging with the Device {#esp32s3_wt32_sc01_plus_debugging} | ||
|
||
To be able to debug with the board, it must not use the STDIO via the USB OTG | ||
interface as it does by default. Instead, the STDIO must use the UART interface. | ||
For this purpose, compile and flash the application with the following command: | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
USEMODULE=stdio_uart BOARD=esp32s3-wt32-sc01-plus make flash ... | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
In order to use the STDIO in a terminal in this case, a debugging tool is | ||
available on the market, which is connected to the debug interface of the board. | ||
|
||
@note The debugging tool does not mean that it is used as OpenOCD adapter. It | ||
simply exposes the UART interface. | ||
|
||
For detailed information on debugging an ESP32-S3 board, refer to the section | ||
[JTAG Debugging with ESP32x SoC](#esp32_jtag_debugging). | ||
|
||
[Back to table of contents](#esp32s3_wt32_sc01_plus_toc) | ||
|
||
*/ |
Oops, something went wrong.