Skip to content

Commit ae87a66

Browse files
committed
2 parents 51a5c68 + a897271 commit ae87a66

27 files changed

+898
-369
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"build": {
3+
"arduino":{
4+
"ldscript": "esp32s3_out.ld",
5+
"partitions": "partitions-8MB-tinyuf2.csv"
6+
},
7+
"core": "esp32",
8+
"extra_flags": [
9+
"-DARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3",
10+
"-DARDUINO_USB_CDC_ON_BOOT=1",
11+
"-DARDUINO_RUNNING_CORE=1",
12+
"-DARDUINO_EVENT_RUNNING_CORE=1",
13+
"-DBOARD_HAS_PSRAM"
14+
],
15+
"f_cpu": "240000000L",
16+
"f_flash": "80000000L",
17+
"flash_mode": "qio",
18+
"hwids": [
19+
[
20+
"0x239A",
21+
"0x8125"
22+
],
23+
[
24+
"0x239A",
25+
"0x0125"
26+
],
27+
[
28+
"0x239A",
29+
"0x8126"
30+
]
31+
],
32+
"mcu": "esp32s3",
33+
"variant": "adafruit_matrixportal_esp32s3"
34+
},
35+
"connectivity": [
36+
"bluetooth",
37+
"wifi"
38+
],
39+
"debug": {
40+
"openocd_target": "esp32s3.cfg"
41+
},
42+
"frameworks": [
43+
"arduino",
44+
"espidf"
45+
],
46+
"name": "Adafruit MatrixPortal ESP32-S3",
47+
"upload": {
48+
"arduino": {
49+
"flash_extra_images": [
50+
[
51+
"0x410000",
52+
"variants/adafruit_matrixportal_esp32s3/tinyuf2.bin"
53+
]
54+
]
55+
},
56+
"flash_size": "8MB",
57+
"maximum_ram_size": 327680,
58+
"maximum_size": 8388608,
59+
"use_1200bps_touch": true,
60+
"wait_for_upload_port": true,
61+
"require_upload_port": true,
62+
"speed": 460800
63+
},
64+
"url": "https://www.adafruit.com/product/5778",
65+
"vendor": "Adafruit"
66+
}

platformio.ini

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,26 @@
1010
# ------------------------------------------------------------------------------
1111

1212
# CI/release binaries
13-
default_envs = esp32s3dev_16MB_opi
14-
; esp32-s3-devkitc-1-n16r8v
15-
; nodemcuv2
16-
; esp8266_2m
17-
; esp01_1m_full
18-
; nodemcuv2_160
19-
; esp8266_2m_160
20-
; esp01_1m_full_160
21-
; nodemcuv2_compat
22-
; esp8266_2m_compat
23-
; esp01_1m_full_compat
24-
; esp32dev
25-
; esp32dev_debug
26-
; esp32_eth
27-
; esp32_wrover
28-
; lolin_s2_mini
29-
; esp32c3dev
30-
; esp32c3dev_qio
31-
; esp32s3dev_16MB_opi
32-
; esp32s3dev_8MB_opi
33-
; esp32s3_4M_qspi
34-
; usermods
13+
default_envs = nodemcuv2
14+
esp8266_2m
15+
esp01_1m_full
16+
nodemcuv2_160
17+
esp8266_2m_160
18+
esp01_1m_full_160
19+
nodemcuv2_compat
20+
esp8266_2m_compat
21+
esp01_1m_full_compat
22+
esp32dev
23+
esp32dev_debug
24+
esp32_eth
25+
esp32_wrover
26+
lolin_s2_mini
27+
esp32c3dev
28+
esp32c3dev_qio
29+
esp32s3dev_16MB_opi
30+
esp32s3dev_8MB_opi
31+
esp32s3_4M_qspi
32+
usermods
3533

3634
src_dir = ./wled00
3735
data_dir = ./wled00/data
@@ -563,9 +561,9 @@ upload_speed = 921600
563561
custom_usermods = audioreactive
564562
build_unflags = ${common.build_unflags}
565563
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_16MB_opi\"
566-
-D CONFIG_LITTLEFS_FOR_IDF_3_2 -D WLED_WATCHDOG_TIMEOUT=0
564+
-D WLED_WATCHDOG_TIMEOUT=0
567565
;-D ARDUINO_USB_CDC_ON_BOOT=0 ;; -D ARDUINO_USB_MODE=1 ;; for boards with serial-to-USB chip
568-
-D ARDUINO_USB_CDC_ON_BOOT=1 -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
566+
-D ARDUINO_USB_CDC_ON_BOOT=1 ;; -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
569567
-DBOARD_HAS_PSRAM
570568
lib_deps = ${esp32s3.lib_deps}
571569
board_build.partitions = ${esp32.extreme_partitions}
@@ -585,9 +583,9 @@ upload_speed = 921600
585583
custom_usermods = audioreactive
586584
build_unflags = ${common.build_unflags}
587585
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_8MB_opi\"
588-
-D CONFIG_LITTLEFS_FOR_IDF_3_2 -D WLED_WATCHDOG_TIMEOUT=0
586+
-D WLED_WATCHDOG_TIMEOUT=0
589587
;-D ARDUINO_USB_CDC_ON_BOOT=0 ;; -D ARDUINO_USB_MODE=1 ;; for boards with serial-to-USB chip
590-
-D ARDUINO_USB_CDC_ON_BOOT=1 -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
588+
-D ARDUINO_USB_CDC_ON_BOOT=1 ;; -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
591589
-DBOARD_HAS_PSRAM
592590
lib_deps = ${esp32s3.lib_deps}
593591
board_build.partitions = ${esp32.large_partitions}
@@ -606,13 +604,13 @@ upload_speed = 921600
606604
custom_usermods = audioreactive
607605
build_unflags = ${common.build_unflags}
608606
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_WROOM-2\"
609-
-D CONFIG_LITTLEFS_FOR_IDF_3_2 -D WLED_WATCHDOG_TIMEOUT=0
607+
-D WLED_WATCHDOG_TIMEOUT=0
610608
-D ARDUINO_USB_CDC_ON_BOOT=0 ;; -D ARDUINO_USB_MODE=1 ;; for boards with serial-to-USB chip
611-
;; -D ARDUINO_USB_CDC_ON_BOOT=1 -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
609+
;; -D ARDUINO_USB_CDC_ON_BOOT=1 ;; -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
612610
-DBOARD_HAS_PSRAM
613611
-D LEDPIN=38 -D DATA_PINS=38 ;; buildin WS2812b LED
614612
-D BTNPIN=0 -D RLYPIN=16 -D IRPIN=17 -D AUDIOPIN=-1
615-
-D WLED_DEBUG
613+
;;-D WLED_DEBUG
616614
-D SR_DMTYPE=1 -D I2S_SDPIN=13 -D I2S_CKPIN=14 -D I2S_WSPIN=15 -D MCLK_PIN=4 ;; I2S mic
617615
lib_deps = ${esp32s3.lib_deps}
618616

@@ -621,6 +619,23 @@ board_upload.flash_size = 16MB
621619
board_upload.maximum_size = 16777216
622620
monitor_filters = esp32_exception_decoder
623621

622+
[env:esp32S3_wroom2_32MB]
623+
;; For ESP32-S3 WROOM-2 with 32MB Flash, and >= 8MB PSRAM (memory_type: opi_opi)
624+
extends = env:esp32S3_wroom2
625+
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_WROOM-2_32MB\"
626+
-D WLED_WATCHDOG_TIMEOUT=0
627+
-D ARDUINO_USB_CDC_ON_BOOT=0 ;; -D ARDUINO_USB_MODE=1 ;; for boards with serial-to-USB chip
628+
;; -D ARDUINO_USB_CDC_ON_BOOT=1 ;; -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
629+
-DBOARD_HAS_PSRAM
630+
-D LEDPIN=38 -D DATA_PINS=38 ;; buildin WS2812b LED
631+
-D BTNPIN=0 -D RLYPIN=16 -D IRPIN=17 -D AUDIOPIN=-1
632+
;;-D WLED_DEBUG
633+
-D SR_DMTYPE=1 -D I2S_SDPIN=13 -D I2S_CKPIN=14 -D I2S_WSPIN=15 -D MCLK_PIN=4 ;; I2S mic
634+
board_build.partitions = tools/WLED_ESP32_32MB.csv
635+
board_upload.flash_size = 32MB
636+
board_upload.maximum_size = 33554432
637+
monitor_filters = esp32_exception_decoder
638+
624639
[env:esp32s3_4M_qspi]
625640
;; ESP32-S3, with 4MB FLASH and <= 4MB PSRAM (memory_type: qio_qspi)
626641
board = lolin_s3_mini ;; -S3 mini, 4MB flash 2MB PSRAM
@@ -630,7 +645,7 @@ upload_speed = 921600
630645
custom_usermods = audioreactive
631646
build_unflags = ${common.build_unflags}
632647
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_4M_qspi\"
633-
-DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
648+
-DARDUINO_USB_CDC_ON_BOOT=1 ;; -DARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
634649
-DBOARD_HAS_PSRAM
635650
-DLOLIN_WIFI_FIX ; seems to work much better with this
636651
-D WLED_WATCHDOG_TIMEOUT=0

platformio_override.sample.ini

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,22 @@ build_flags = ${common.build_flags} ${esp8266.build_flags}
191191
; -D HW_PIN_MISOSPI=9
192192

193193

194+
# ------------------------------------------------------------------------------
195+
# Optional: build flags for speed, instead of optimising for size.
196+
# Example of usage: see [env:esp32S3_PSRAM_HUB75]
197+
# ------------------------------------------------------------------------------
198+
199+
[Speed_Flags]
200+
build_unflags = -Os ;; to disable standard optimization for small size
201+
build_flags =
202+
-O2 ;; optimize for speed
203+
-free -fipa-pta ;; very useful, too
204+
;;-fsingle-precision-constant ;; makes all floating point literals "float" (default is "double")
205+
;;-funsafe-math-optimizations ;; less dangerous than -ffast-math; still allows the compiler to exploit FMA and reciprocals (up to 10% faster on -S3)
206+
# Important: we need to explicitly switch off some "-O2" optimizations
207+
-fno-jump-tables -fno-tree-switch-conversion ;; needed - firmware may crash otherwise
208+
-freorder-blocks -Wwrite-strings -fstrict-volatile-bitfields ;; needed - recommended by espressif
209+
194210

195211
# ------------------------------------------------------------------------------
196212
# PRE-CONFIGURED DEVELOPMENT BOARDS AND CONTROLLERS
@@ -541,7 +557,7 @@ build_flags = ${common.build_flags}
541557
-D WLED_ENABLE_HUB75MATRIX -D NO_GFX
542558
-D WLED_DEBUG_BUS
543559
; -D WLED_DEBUG
544-
-D SR_DMTYPE=-1 -D I2S_SDPIN=-1 -D I2S_CKPIN=-1 -D I2S_WSPIN=-1 -D MCLK_PIN=-1 ;; Disable to prevent pin clash
560+
-D SR_DMTYPE=1 -D I2S_SDPIN=-1 -D I2S_CKPIN=-1 -D I2S_WSPIN=-1 -D MCLK_PIN=-1 ;; Disable to prevent pin clash
545561

546562
lib_deps = ${esp32_idf_V4.lib_deps}
547563
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git#3.0.11
@@ -558,47 +574,53 @@ build_flags = ${common.build_flags}
558574
-D WLED_ENABLE_HUB75MATRIX -D NO_GFX
559575
-D ESP32_FORUM_PINOUT ;; enable for SmartMatrix default pins
560576
-D WLED_DEBUG_BUS
561-
-D SR_DMTYPE=-1 -D I2S_SDPIN=-1 -D I2S_CKPIN=-1 -D I2S_WSPIN=-1 -D MCLK_PIN=-1 ;; Disable to prevent pin clash
577+
-D SR_DMTYPE=1 -D I2S_SDPIN=-1 -D I2S_CKPIN=-1 -D I2S_WSPIN=-1 -D MCLK_PIN=-1 ;; Disable to prevent pin clash
562578
; -D WLED_DEBUG
563579

564580

565581
[env:adafruit_matrixportal_esp32s3]
566582
; ESP32-S3 processor, 8 MB flash, 2 MB of PSRAM, dedicated driver pins for HUB75
567583
board = adafruit_matrixportal_esp32s3
584+
;; adafruit recommends to use arduino-esp32 2.0.14
585+
;;platform = espressif32@ ~6.5.0
586+
;;platform_packages = platformio/framework-arduinoespressif32 @ 3.20014.231204 ;; arduino-esp32 2.0.14
568587
platform = ${esp32s3.platform}
569588
platform_packages =
570589
upload_speed = 921600
571590
build_unflags = ${common.build_unflags}
572-
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_4M_qspi\"
573-
-DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
591+
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_8M_qspi\"
592+
-DARDUINO_USB_CDC_ON_BOOT=1 ;; -DARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
574593
-DBOARD_HAS_PSRAM
575594
-DLOLIN_WIFI_FIX ; seems to work much better with this
576595
-D WLED_WATCHDOG_TIMEOUT=0
577596
-D WLED_ENABLE_HUB75MATRIX -D NO_GFX
578597
-D S3_LCD_DIV_NUM=20 ;; Attempt to fix wifi performance issue when panel active with S3 chips
579598
-D ARDUINO_ADAFRUIT_MATRIXPORTAL_ESP32S3
580599
-D WLED_DEBUG_BUS
581-
-D SR_DMTYPE=-1 -D I2S_SDPIN=-1 -D I2S_CKPIN=-1 -D I2S_WSPIN=-1 -D MCLK_PIN=-1 ;; Disable to prevent pin clash
600+
-D SR_DMTYPE=1 -D I2S_SDPIN=-1 -D I2S_CKPIN=-1 -D I2S_WSPIN=-1 -D MCLK_PIN=-1 ;; Disable to prevent pin clash
582601

583602

584603
lib_deps = ${esp32s3.lib_deps}
585604
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git#aa28e2a ;; S3_LCD_DIV_NUM fix
586605

587-
board_build.partitions = ${esp32.default_partitions}
606+
board_build.partitions = ${esp32.large_partitions} ;; standard bootloader and 8MB Flash partitions
607+
;; board_build.partitions = tools/partitions-8MB_spiffs-tinyuf2.csv ;; supports adafruit UF2 bootloader
588608
board_build.f_flash = 80000000L
589609
board_build.flash_mode = qio
590610
monitor_filters = esp32_exception_decoder
591611
custom_usermods = audioreactive
592612

593613
[env:esp32S3_PSRAM_HUB75]
594-
;; MOONHUB HUB75 adapter board
614+
;; MOONHUB HUB75 adapter board (lilygo T7-S3 with 16MB flash and PSRAM)
595615
board = lilygo-t7-s3
596616
platform = ${esp32s3.platform}
597617
platform_packages =
598618
upload_speed = 921600
599619
build_unflags = ${common.build_unflags}
620+
${Speed_Flags.build_unflags} ;; optional: removes "-Os" so we can override with "-O2" in build_flags
600621
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"esp32S3_16MB_PSRAM_HUB75\"
601-
-DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
622+
${Speed_Flags.build_flags} ;; optional: -O2 -> optimize for speed instead of size
623+
-DARDUINO_USB_CDC_ON_BOOT=1 ;; -DARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
602624
-DBOARD_HAS_PSRAM
603625
-DLOLIN_WIFI_FIX ; seems to work much better with this
604626
-D WLED_WATCHDOG_TIMEOUT=0
@@ -612,7 +634,8 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=
612634
lib_deps = ${esp32s3.lib_deps}
613635
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git#aa28e2a ;; S3_LCD_DIV_NUM fix
614636

615-
board_build.partitions = ${esp32.default_partitions}
637+
;;board_build.partitions = ${esp32.large_partitions} ;; for 8MB flash
638+
board_build.partitions = ${esp32.extreme_partitions} ;; for 16MB flash
616639
board_build.f_flash = 80000000L
617640
board_build.flash_mode = qio
618641
monitor_filters = esp32_exception_decoder

tools/WLED_ESP32_32MB.csv

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, 0x5000,
3+
otadata, data, ota, 0xe000, 0x2000,
4+
app0, app, ota_0, 0x10000, 0x300000,
5+
app1, app, ota_1, 0x310000,0x300000,
6+
spiffs, data, spiffs, 0x610000,0x19E0000,
7+
coredump, data, coredump,,64K

tools/cdata.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,21 @@ const wledBanner = `
3838
\t\t\x1b[36m build script for web UI
3939
\x1b[0m`;
4040

41+
// Generate build timestamp as UNIX timestamp (seconds since epoch)
42+
function generateBuildTime() {
43+
return Math.floor(Date.now() / 1000);
44+
}
45+
4146
const singleHeader = `/*
4247
* Binary array for the Web UI.
4348
* gzip is used for smaller size and improved speeds.
4449
*
4550
* Please see https://kno.wled.ge/advanced/custom-features/#changing-web-ui
4651
* to find out how to easily modify the web UI source!
4752
*/
53+
54+
// Automatically generated build time for cache busting (UNIX timestamp)
55+
#define WEB_BUILD_TIME ${generateBuildTime()}
4856
4957
`;
5058

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# ESP-IDF Partition Table
2+
# Name, Type, SubType, Offset, Size, Flags
3+
# bootloader.bin,, 0x1000, 32K
4+
# partition table,, 0x8000, 4K
5+
nvs, data, nvs, 0x9000, 20K,
6+
otadata, data, ota, 0xe000, 8K,
7+
ota_0, app, ota_0, 0x10000, 2048K,
8+
ota_1, app, ota_1, 0x210000, 2048K,
9+
uf2, app, factory,0x410000, 256K,
10+
spiffs, data, spiffs, 0x450000, 11968K,
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ESP-IDF Partition Table
2+
# Name, Type, SubType, Offset, Size, Flags
3+
# bootloader.bin,, 0x1000, 32K
4+
# partition table, 0x8000, 4K
5+
6+
nvs, data, nvs, 0x9000, 20K,
7+
otadata, data, ota, 0xe000, 8K,
8+
ota_0, 0, ota_0, 0x10000, 1408K,
9+
ota_1, 0, ota_1, 0x170000, 1408K,
10+
uf2, app, factory,0x2d0000, 256K,
11+
spiffs, data, spiffs, 0x310000, 960K,
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# ESP-IDF Partition Table
2+
# Name, Type, SubType, Offset, Size, Flags
3+
# bootloader.bin,, 0x1000, 32K
4+
# partition table,, 0x8000, 4K
5+
nvs, data, nvs, 0x9000, 20K,
6+
otadata, data, ota, 0xe000, 8K,
7+
ota_0, app, ota_0, 0x10000, 2048K,
8+
ota_1, app, ota_1, 0x210000, 2048K,
9+
uf2, app, factory,0x410000, 256K,
10+
spiffs, data, spiffs, 0x450000, 3776K,

usermods/EXAMPLE/usermod_v2_example.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,11 @@ class MyExampleUsermod : public Usermod {
313313
yield();
314314
// ignore certain button types as they may have other consequences
315315
if (!enabled
316-
|| buttonType[b] == BTN_TYPE_NONE
317-
|| buttonType[b] == BTN_TYPE_RESERVED
318-
|| buttonType[b] == BTN_TYPE_PIR_SENSOR
319-
|| buttonType[b] == BTN_TYPE_ANALOG
320-
|| buttonType[b] == BTN_TYPE_ANALOG_INVERTED) {
316+
|| buttons[b].type == BTN_TYPE_NONE
317+
|| buttons[b].type == BTN_TYPE_RESERVED
318+
|| buttons[b].type == BTN_TYPE_PIR_SENSOR
319+
|| buttons[b].type == BTN_TYPE_ANALOG
320+
|| buttons[b].type == BTN_TYPE_ANALOG_INVERTED) {
321321
return false;
322322
}
323323

0 commit comments

Comments
 (0)