Skip to content

Commit 6e60f2f

Browse files
feat(variant): add kode dot ESP32-S3 board with QSPI LCD, SD and GPIO … (#11371)
* feat(variant): add KodeDot ESP32-S3 board with QSPI LCD, SD and GPIO header * fix(kodedot): Reorder board definitions and translate comments to English * fix(kodedot): Clean up OTA override and remove unused partition menu for kode dot * fix(kodedot): Build board changed from ESP32S3_DEV to KODE_DOT on kode dot board * ci(pre-commit): Fix whitespace, EOLs and codespell 'Analog' * ci(pre-commit): Add bash script formatter * fix(merge): New name and description for custom merge tool and change partitions table to variants folder
1 parent 6476260 commit 6e60f2f

File tree

5 files changed

+201
-0
lines changed

5 files changed

+201
-0
lines changed

boards.txt

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50547,3 +50547,60 @@ cyobot_v2_esp32s3.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR
5054750547
cyobot_v2_esp32s3.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api.zczr -lzboss_stack.zczr -lzboss_port.remote
5054850548

5054950549
##############################################################
50550+
50551+
kodedot.name=kode dot
50552+
50553+
kodedot.bootloader.tool=esptool_py
50554+
kodedot.bootloader.tool.default=esptool_py
50555+
50556+
kodedot.upload.tool=esptool_py_app_only
50557+
kodedot.upload.tool.default=esptool_py_app_only
50558+
kodedot.upload.tool.network=esp_ota
50559+
50560+
kodedot.upload.maximum_size=8388608
50561+
kodedot.upload.maximum_data_size=327680
50562+
kodedot.upload.flags=
50563+
kodedot.upload.extra_flags=
50564+
kodedot.upload.use_1200bps_touch=false
50565+
kodedot.upload.wait_for_upload_port=false
50566+
kodedot.upload.speed=921600
50567+
50568+
kodedot.upload.erase_cmd=
50569+
50570+
kodedot.serial.disableDTR=false
50571+
kodedot.serial.disableRTS=false
50572+
50573+
kodedot.build.tarch=xtensa
50574+
kodedot.build.bootloader_addr=0x0
50575+
kodedot.build.target=esp32s3
50576+
kodedot.build.mcu=esp32s3
50577+
kodedot.build.core=esp32
50578+
kodedot.build.variant=kodedot
50579+
kodedot.build.board=KODE_DOT
50580+
50581+
kodedot.build.usb_mode=1
50582+
kodedot.build.cdc_on_boot=1
50583+
kodedot.build.msc_on_boot=0
50584+
kodedot.build.dfu_on_boot=0
50585+
50586+
kodedot.build.f_cpu=240000000L
50587+
50588+
kodedot.build.flash_offset=0x400000
50589+
kodedot.build.flash_size=16MB
50590+
kodedot.build.flash_freq=80m
50591+
kodedot.build.flash_mode=dio
50592+
50593+
kodedot.build.custom_partitions=kodedot_partitions
50594+
50595+
kodedot.build.psram_type=qspi
50596+
kodedot.build.defines=
50597+
50598+
kodedot.build.loop_core=-DARDUINO_RUNNING_CORE=1
50599+
kodedot.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1
50600+
50601+
kodedot.recipe.hooks.objcopy.postobjcopy.3.pattern=
50602+
kodedot.recipe.hooks.objcopy.postobjcopy.3.pattern_args=
50603+
50604+
kodedot.recipe.output.save_file={build.project_name}.ino.bin
50605+
50606+
##############################################################

platform.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,3 +330,19 @@ tools.dfu-util.cmd=dfu-util
330330
tools.dfu-util.upload.params.verbose=-d
331331
tools.dfu-util.upload.params.quiet=
332332
tools.dfu-util.upload.pattern="{path}/{cmd}" --device {vid.0}:{pid.0} -D "{build.path}/{build.project_name}.bin" -Q
333+
334+
## --------------------------------------------------------------------------
335+
## esptool_py_app_only is used to upload only the application image
336+
## It won't upload the bootloader or any other binary except for the main application
337+
## --------------------------------------------------------------------------
338+
tools.esptool_py_app_only.path={runtime.tools.esptool_py.path}
339+
tools.esptool_py_app_only.cmd=esptool
340+
tools.esptool_py_app_only.cmd.windows=esptool.exe
341+
342+
tools.esptool_py_app_only.upload.protocol=serial
343+
tools.esptool_py_app_only.upload.params.verbose=
344+
tools.esptool_py_app_only.upload.params.quiet=
345+
346+
tools.esptool_py_app_only.upload.pattern_args=--chip {build.mcu} --port "{serial.port}" --baud {upload.speed} {upload.flags} --before default_reset --after hard_reset write_flash --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} {build.flash_offset} "{build.path}/{build.project_name}.bin" {upload.extra_flags}
347+
348+
tools.esptool_py_app_only.upload.pattern="{path}/{cmd}" {tools.esptool_py_app_only.upload.pattern_args}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// custom_ota_override.cpp
2+
// This function overrides the weak definition of `verifyRollbackLater()` in the kode dot board.
3+
4+
extern "C" {
5+
// Declare the weak function symbol to override it
6+
bool verifyRollbackLater() __attribute__((weak));
7+
}
8+
9+
// Custom implementation of verifyRollbackLater()
10+
// Returning `true` prevents the OTA image from being automatically marked as valid.
11+
// This ensures that the system will roll back to the previous image unless it is explicitly validated later.
12+
bool verifyRollbackLater() {
13+
return true;
14+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Name, Type, SubType, Offset, Size, Flags
2+
nvs, data, nvs, 0x9000, 0x6000,
3+
phy_init, data, phy, 0xf000, 0x1000,
4+
otadata, data, ota, 0x10000, 0x2000,
5+
ota_0, app, ota_0, 0x20000, 0x3E0000,
6+
ota_1, app, ota_1, 0x400000, 0x800000,
7+
storage, data, spiffs, 0xC00000, 0x400000,

variants/kodedot/pins_arduino.h

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/*
2+
────────────────────────────────────────────────────────────────────────
3+
KodeDot – ESP32-S3R8 Variant
4+
Pin definition file for the Arduino-ESP32 core
5+
────────────────────────────────────────────────────────────────────────
6+
* External 2 × 10 connector → simple aliases PIN1 … PIN20
7+
* On-board QSPI LCD 410×502 @40 MHz (SPI3_HOST)
8+
* micro-SD on SPI2_HOST
9+
* Dual-I²C: external (GPIO37/36) + internal-sensors (GPIO48/47)
10+
* USB VID/PID 0x303A:0x1001
11+
*/
12+
13+
#ifndef Pins_Arduino_h
14+
#define Pins_Arduino_h
15+
16+
#include <stdint.h>
17+
#include <stdbool.h>
18+
19+
/*──────────────── USB device descriptor ────────────────*/
20+
#define USB_VID 0x303A // Espressif Systems VID
21+
#define USB_PID 0x1001 // Product ID: KodeDot-S3
22+
23+
/*──────────────── UART0 (Arduino Serial) ────────────────*/
24+
static const uint8_t TX = 43; // U0TXD – PIN16 on the 2×10 header
25+
static const uint8_t RX = 44; // U0RXD – PIN18 on the 2×10 header
26+
27+
/*──────────────── I²C buses ─────────────────────────────*/
28+
/* External expansion bus → header pins 11/13 */
29+
static const uint8_t SCL = 37; // GPIO37 – PIN12
30+
static const uint8_t SDA = 36; // GPIO36 – PIN14
31+
32+
/* Internal sensor/touch bus (not on header) */
33+
#define INT_I2C_SCL 47 // GPIO47
34+
#define INT_I2C_SDA 48 // GPIO48
35+
36+
/*──────────────── SPI2 – micro-SD ───────────────────────*/
37+
static const uint8_t SS = 15; // SD_CS
38+
static const uint8_t MOSI = 16; // SD_MOSI
39+
static const uint8_t MISO = 18; // SD_MISO
40+
static const uint8_t SCK = 17; // SD_CLK
41+
#define BOARD_HAS_SD_SPI
42+
#define SD_CS SS
43+
44+
/*──────────────── QSPI LCD (SPI3_HOST) ─────────────────–
45+
* Controller: ST7789 / 4-line SPI (no D/C pin)
46+
* Resolution: 410×502 px, 16 bpp, RGB color-space
47+
* Clock: 40 MHz
48+
*/
49+
#define BOARD_HAS_SPI_LCD
50+
#define LCD_MODEL ST7789
51+
#define LCD_WIDTH 410
52+
#define LCD_HEIGHT 502
53+
54+
#define LCD_HOST SPI3_HOST
55+
#define LCD_SCK 35 // GPIO35 • QSPI_CLK
56+
#define LCD_MOSI 33 // GPIO33 • QSPI_IO0 (D0)
57+
#define LCD_IO1 34 // GPIO34 • QSPI_IO1 (D1)
58+
#define LCD_IO2 37 // GPIO37 • QSPI_IO2 (D2)
59+
#define LCD_IO3 36 // GPIO36 • QSPI_IO3 (D3)
60+
#define LCD_CS 10 // GPIO10
61+
#define LCD_RST 9 // GPIO09
62+
#define LCD_DC -1 // not used in 4-line SPI
63+
/* Optional: back-light enable shares the NeoPixel pin */
64+
#define LCD_BL 5 // GPIO05 (same as NEOPIXEL)
65+
66+
/*──────────────── Analog / Touch pads ────────────────*/
67+
static const uint8_t A0 = 11; // PIN4 – GPIO11 / TOUCH11 / ADC2_CH0
68+
static const uint8_t A1 = 12; // PIN6 – GPIO12 / TOUCH12 / ADC2_CH1
69+
static const uint8_t A2 = 13; // PIN8 – GPIO13 / TOUCH13 / ADC2_CH2
70+
static const uint8_t A3 = 14; // PIN10 – GPIO14 / TOUCH14 / ADC2_CH3
71+
static const uint8_t T0 = A0, T1 = A1, T2 = A2, T3 = A3;
72+
73+
/*──────────────── On-board controls & indicator ─────────*/
74+
#define BUTTON_TOP 0 // GPIO00 – BOOT • active-LOW
75+
#define BUTTON_BOTTOM 6 // GPIO06 • active-LOW
76+
#define NEOPIXEL_PIN 5 // GPIO05 – WS2812
77+
#define LED_BUILTIN NEOPIXEL_PIN
78+
79+
/*──────────────── JTAG (also on connector) ──────────────*/
80+
#define MTCK 39 // PIN11 – GPIO39
81+
#define MTDO 40 // PIN13 – GPIO40
82+
#define MTDI 41 // PIN15 – GPIO41
83+
#define MTMS 42 // PIN17 – GPIO42
84+
85+
/*──────────────── 2×10 header: simple aliases ───────────
86+
NOTE: power pins (1 = 5 V, 2 = 3 V3, 19/20 = GND) are **not**
87+
exposed as GPIO numbers – they remain undefined here. */
88+
#define PIN3 1 // GPIO01 / TOUCH1 / ADC1_CH0
89+
#define PIN4 11 // GPIO11 / TOUCH11 / ADC2_CH0
90+
#define PIN5 2 // GPIO02 / TOUCH2 / ADC1_CH1
91+
#define PIN6 12 // GPIO12 / TOUCH12 / ADC2_CH1
92+
#define PIN7 3 // GPIO03 / TOUCH3 / ADC1_CH2
93+
#define PIN8 13 // GPIO13 / TOUCH13 / ADC2_CH2
94+
#define PIN9 4 // GPIO04 / TOUCH4 / ADC1_CH3
95+
#define PIN10 14 // GPIO14 / TOUCH14 / ADC2_CH3
96+
#define PIN11 39 // MTCK
97+
#define PIN12 37 // SCL (external I²C)
98+
#define PIN13 40 // MTDO
99+
#define PIN14 36 // SDA (external I²C)
100+
#define PIN15 41 // MTDI
101+
#define PIN16 43 // TX (U0TXD)
102+
#define PIN17 42 // MTMS
103+
#define PIN18 44 // RX (U0RXD)
104+
/* PIN1, PIN2, PIN19, PIN20 are power/ground and deliberately
105+
left undefined – they are **not** usable as GPIO. */
106+
107+
#endif /* Pins_Arduino_h */

0 commit comments

Comments
 (0)