-
-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathplatformio.ini
More file actions
331 lines (318 loc) · 13.7 KB
/
Copy pathplatformio.ini
File metadata and controls
331 lines (318 loc) · 13.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
; BambuHelper - Bambu Lab Printer Monitor
;
; Maintained envs (in this file, hardware-tested in-house):
; esp32s3, cyd, esp32s3_zero, ws_lcd_200, ws_lcd_154, jc3248w535, esp32c3
; Community envs (in boards/*.ini, merged via extra_configs):
; tzt_2432, ws_lcd_280, ws_lcd_350, esp32s3_zero_320, sensecap_indicator,
; wt32_sc01_plus, es3n28p (community, issue #125 - manual build, hw-unconfirmed),
; sc05_x (ZX2D80CE02S experimental), esp32c3_round, esp32s3_round
; (DIY GC9A01 1.28" round)
; Generic DIY displays (hand-wired SPI panels, pins from build flags): diy_round240
; (GC9A01 on C3, issue #153), diy_round240_esp32 (same panel on a classic ESP32,
; issue #151) + diy_spi_template (copy/edit). See boards/*.ini + README.
;
; Plain `pio run` builds only the default env (default_envs below).
; Build a specific env with `pio run -e <env>`.
; The official release set (web flasher) lives in tools/release.py.
; --- PlatformIO global settings ---
[platformio]
; Repo-local board manifest for SenseCAP Indicator (not in upstream PlatformIO)
boards_dir = boards
; Build only the primary daily-driver env on plain `pio run`. Other envs are
; opt-in: `pio run -e <env>`. CI / release pipeline iterates explicitly.
default_envs = esp32s3
; Community-maintained envs live in boards/*.ini and are merged in at parse time.
; Build them by name: `pio run -e tzt_2432`, `-e ws_lcd_280`, `-e ws_lcd_350`,
; `-e sensecap_indicator`, `-e wt32_sc01_plus`, `-e es3n28p`, `-e esp32c3_round`,
; `-e esp32s3_round`, `-e sc05_x`. Several community envs ARE in the web flasher
; / release set; which envs ship is defined in tools/release.py (WEB_FLASHER_BOARDS).
; The two GC9A01 round DIY envs are in the flasher set (esp32c3_round is
; hardware-confirmed; esp32s3_round shares its pins with the esp32s3 env).
; sc05_x is included as an experimental build because ZX2D80CE02S users otherwise
; hit a black screen when selecting the unrelated wt32_sc01_plus firmware.
; sensecap_indicator is excluded (custom toolchain forks).
extra_configs = boards/*.ini
; --- Applies to every environment, including the ones in boards/*.ini ---
[env]
; Gzips web/app.css + web/app.js into a generated PROGMEM header before the
; build. Serving them compressed costs ~26 KB of flash instead of the ~106 KB
; the same code took inline in PAGE_HTML.
extra_scripts = pre:tools/gen_web_assets.py
; --- Shared library dependencies ---
[common]
; Improv WiFi Library is vendored in lib/ImprovWiFi (see its library.json) -
; the registry package pulls in arduino-libraries/WiFi via `depends=WiFi`,
; which shadows the ESP32 core WiFi library and breaks the build.
lib_deps =
lovyan03/LovyanGFX@^1.2.19
knolleary/PubSubClient@^2.8
bblanchon/ArduinoJson@^7.0
; --- Shared profile for ESP32-S3 envs (4MB QIO, native USB CDC, OTA) ---
; Used by esp32s3, esp32s3_zero, ws_lcd_200, ws_lcd_154 and the matching
; community envs in boards/*.ini. Envs override `board` and append to
; build_flags with `${s3_common.build_flags}` (PlatformIO does not merge lists
; in `extends` - the variable substitution is explicit re-inclusion).
[s3_common]
platform = espressif32@6.12.0
framework = arduino
monitor_speed = 115200
board_build.partitions = partitions_4mb.csv
board_build.arduino.memory_type = qio_qspi
lib_deps = ${common.lib_deps}
build_flags =
-D ENABLE_OTA_AUTO=1
-D ARDUINO_USB_CDC_ON_BOOT=1
; All current S3 envs drive ST7789 panels which need color inversion.
-D USE_ST7789_INVERT=1
; =============================================================================
; ESP32-S3 Super Mini + ST7789 240x240
; =============================================================================
[env:esp32s3]
extends = s3_common
board = lolin_s3_mini
build_flags =
${s3_common.build_flags}
-D BOARD_VARIANT=\"esp32s3\"
-D BOARD_NAME=\"LOLIN_ESP32-S3_Mini\"
-D BOARD_PANEL=\"ST7789_240x240\"
-D BOARD_IS_S3=1
-D BACKLIGHT_PIN=13
; =============================================================================
; ESP32-2432S028 (CYD - Cheap Yellow Display) + ILI9341 240x320
; Two hardware variants exist (ILI9341 vs ILI9341_2). Panel selection is
; handled at runtime via the "Alternative CYD panel" checkbox in Settings.
; The 2.8" ESP32-32E clone (speaker amp enable on GPIO4, red LED on GPIO22)
; is handled at runtime via the "ESP32-32E clone board" checkbox (issue #141).
; =============================================================================
[env:cyd]
platform = espressif32@6.12.0
board = esp32dev
framework = arduino
monitor_speed = 115200
upload_speed = 230400
board_build.partitions = min_spiffs.csv
lib_deps =
${common.lib_deps}
https://github.com/PaulStoffregen/XPT2046_Touchscreen.git
build_flags =
; --- CYD touch (XPT2046 on separate SPI bus) ---
-D USE_XPT2046=1
-D TOUCH_CS=33
-D TOUCH_IRQ=36
-D TOUCH_MOSI=32
-D TOUCH_MISO=39
-D TOUCH_CLK=25
-D SPI_TOUCH_FREQUENCY=2500000
; --- Layout profile ---
-D DISPLAY_CYD=1
-D DISPLAY_240x320=1
-D BOARD_VARIANT=\"cyd\"
-D BOARD_NAME=\"ESP32-2432S028_CYD\"
-D BOARD_PANEL=\"ILI9341_240x320_resistive\"
-D ENABLE_OTA_AUTO=1
-D BOARD_LOW_RAM=1
-D BACKLIGHT_PIN=21
; tzt_2432 moved to boards/tzt_2432.ini (community-maintained, included via extra_configs)
; =============================================================================
; Waveshare ESP32-S3-Zero + external ST7789 240x240
; https://www.waveshare.com/esp32-s3-zero.htm
; Module ESP32-S3FH4R2: 4MB flash QIO + 2MB PSRAM QSPI (quad).
; Built-in WS2812 RGB LED is on GPIO21 - do not use GPIO21 for external LED.
; =============================================================================
[env:esp32s3_zero]
extends = s3_common
board = lolin_s3_mini
build_flags =
${s3_common.build_flags}
-D BOARD_VARIANT=\"esp32s3_zero\"
-D BOARD_NAME=\"Waveshare_ESP32-S3-Zero\"
-D BOARD_PANEL=\"ST7789_240x240\"
-D BOARD_IS_S3=1
-D BOARD_IS_S3_ZERO=1
-D BOARD_HAS_PSRAM
-D BACKLIGHT_PIN=13
; =============================================================================
; Waveshare ESP32-S3-Touch-LCD-2 (2.0" ST7789 240x320)
; https://www.waveshare.com/esp32-s3-touch-lcd-2.htm
; Core: ESP32-S3R8 with 16MB flash + 8MB octal PSRAM (silicon-ID confirmed:
; esptool reports "Embedded PSRAM 8MB (AP_3v3)", detected flash size 16MB).
; 16MB partition table (was 4MB until v3.7.4) - fielded devices keep the old
; 4MB table (1.75MB OTA slots) until reflashed once via USB/web flasher;
; OTA keeps working on the old table while firmware.bin fits the old slot.
; =============================================================================
[env:ws_lcd_200]
extends = s3_common
board = esp32-s3-devkitc-1
board_build.partitions = partitions_16mb.csv
board_build.arduino.memory_type = qio_opi
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
build_flags =
${s3_common.build_flags}
-D BOARD_HAS_PSRAM=1
-D BOARD_VARIANT=\"ws_lcd_200\"
-D BOARD_NAME=\"Waveshare_ESP32-S3-Touch-LCD-2.0\"
-D BOARD_PANEL=\"ST7789_240x320_CST816D\"
-D BOARD_IS_WS200=1
-D BACKLIGHT_PIN=1
; --- Layout profile (same 240x320 as CYD) ---
-D DISPLAY_240x320=1
; --- Touch (CST816D on I2C) ---
-D USE_CST816=1
-D CST816_SDA=48
-D CST816_SCL=47
; --- Battery sense (ADC on GPIO5 with 3x voltage divider) ---
-D BOARD_HAS_BATTERY=1
-D BOARD_HAS_BAT_ADC=1
-D BAT_ADC_PIN=5
; =============================================================================
; Waveshare ESP32-S3-Touch-LCD-1.54 (1.54" ST7789 240x240)
; https://docs.waveshare.net/ESP32-S3-Touch-LCD-1.54/
; Core: ESP32-S3R8 with 16MB flash + 8MB octal PSRAM (silicon-ID confirmed:
; esptool reports "Embedded PSRAM 8MB (AP_3v3)"; /status psram_kb=8189).
; 16MB partition table (was 4MB until v3.7.4) - fielded devices keep the old
; 4MB table (1.75MB OTA slots) until reflashed once via USB/web flasher;
; OTA keeps working on the old table while firmware.bin fits the old slot.
; =============================================================================
[env:ws_lcd_154]
extends = s3_common
board = esp32-s3-devkitc-1
board_build.partitions = partitions_16mb.csv
board_build.arduino.memory_type = qio_opi
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
build_flags =
${s3_common.build_flags}
-D BOARD_HAS_PSRAM=1
-D BOARD_VARIANT=\"ws_lcd_154\"
-D BOARD_NAME=\"Waveshare_ESP32-S3-Touch-LCD-1.54\"
-D BOARD_PANEL=\"ST7789_240x240_CST816T_ES8311\"
-D BOARD_IS_WS154=1
-D BACKLIGHT_PIN=46
; --- Battery power-hold + VBAT sense via ADC on GPIO1 ---
; Per schematic: VBAT routed through 160k/1% divider to GPIO1 (BAT_ADC).
; The board has NO I2C-readable PMIC - the charger (ETA6098) is standalone.
; Other I2C devices on 42/41 are: 0x15 CST816T touch, 0x18 ES8311 audio,
; 0x40 ES7210 audio ADC, 0x6B QMI8658 IMU.
-D BAT_EN=2
-D BOARD_HAS_BATTERY=1
-D BOARD_HAS_BAT_ADC=1
-D BAT_ADC_PIN=1
; Top resistor confirmed 160K/1% from schematic; bottom resistor is
; not legible in the extracted schematic text. Empirical fit: a
; charged battery reads as 100% only with a 3.0x multiplier (which
; corresponds to 160K + 80K bottom = 240K/80K = 3.0x divider).
-D BAT_VOLT_DIVIDER=3.0f
; --- Built-in buttons (from Waveshare button example) ---
-D BOARD_BTN_1=0
-D BOARD_BTN_2=5
-D BOARD_BTN_3=4
; --- Built-in speaker (ES8311 codec + I2S + PA) ---
-D BOARD_HAS_ES8311_AUDIO=1
-D AUDIO_I2C_ADDR=0x18
-D AUDIO_I2C_SDA=42
-D AUDIO_I2C_SCL=41
-D AUDIO_I2S_PORT=0
-D AUDIO_I2S_MCLK=8
-D AUDIO_I2S_BCLK=9
-D AUDIO_I2S_LRC=10
-D AUDIO_I2S_DOUT=12
-D AUDIO_PA_CTRL=7
; --- Touch (CST816 on I2C, shared bus with ES8311) ---
-D USE_CST816=1
-D CST816_SDA=42
-D CST816_SCL=41
-D CST816_RST=47
-D CST816_IRQ=48
; =============================================================================
; Guition JC3248W535 - 3.5" 320x480 IPS (AXS15231B QSPI + I2C touch)
; https://www.guition.com/ — ESP32-S3-N16R8, 16MB flash / 8MB PSRAM.
; Display driver wraps Arduino_GFX's Arduino_AXS15231B inside a LovyanGFX
; Panel_Device subclass (src/lgfx_panel_axs15231b_agfx.hpp), since
; mainline LovyanGFX does not ship Panel_AXS15231B.
;
; Touch RST/INT pins are not wired on the shipped Guition boards inspected —
; the touch IC shares reset with the display and is polled (no INT). If your
; board revision exposes these pins, add AXS_TOUCH_RST / AXS_TOUCH_IRQ here.
; =============================================================================
[env:jc3248w535]
platform = espressif32@6.12.0
board = esp32-s3-devkitc-1
framework = arduino
monitor_speed = 115200
board_build.partitions = partitions_16mb.csv
board_build.arduino.memory_type = qio_opi
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
board_build.f_flash = 80000000L
board_build.flash_mode = qio
lib_deps =
${common.lib_deps}
moononournation/GFX Library for Arduino@~1.5.0
build_flags =
-D BOARD_VARIANT=\"jc3248w535\"
-D BOARD_NAME=\"Guition_JC3248W535\"
-D BOARD_PANEL=\"AXS15231B_320x480_QSPI\"
-D BOARD_IS_JC3248W535=1
-D ENABLE_OTA_AUTO=1
-D BOARD_HAS_PSRAM=1
-D ARDUINO_USB_CDC_ON_BOOT=1
; --- Display (AXS15231B QSPI, 320x480 portrait native) ---
; Pins are hard-coded inside Panel_AXS15231B_AGFX (src/lgfx_panel_axs15231b_agfx.hpp)
; because Arduino_GFX's databus takes pins at construction, not at begin().
-D DISPLAY_320x480=1
-D BACKLIGHT_PIN=1
; --- Battery sense: cell (BAT node) via R26/R27 divider to GPIO5 (JO5) ---
; Per manufacturer schematic (5-IO pin distribution, sheet 1):
; BAT - R26 - JO5(R25 0R) - R27 - GND. Divider ratio calibrated on hardware:
; metered cell 4.16V vs ADC pin 2.454V => 1.70x.
-D BOARD_HAS_BATTERY=1
-D BOARD_HAS_BAT_ADC=1
-D BAT_ADC_PIN=5
-D BAT_VOLT_DIVIDER=1.70f
; --- Touch (AXS15231B touch controller on I2C @0x3B) ---
-D USE_AXS_TOUCH=1
-D AXS_TOUCH_SDA=4
-D AXS_TOUCH_SCL=8
; --- Built-in speaker (NS4168 I2S mono class-D amp, no MCLK / no I2C) ---
-D BOARD_HAS_NS4168_AUDIO=1
-D AUDIO_I2S_PORT=0
-D AUDIO_I2S_BCLK=42
-D AUDIO_I2S_LRC=2
-D AUDIO_I2S_DOUT=41
; =============================================================================
; ESP32-C3 Super Mini + ST7789 240x240
; =============================================================================
[env:esp32c3]
platform = espressif32@6.12.0
board = lolin_c3_mini
framework = arduino
monitor_speed = 115200
board_build.partitions = partitions_4mb.csv
lib_deps = ${common.lib_deps}
build_flags =
-D BOARD_VARIANT=\"esp32c3\"
-D BOARD_NAME=\"LOLIN_ESP32-C3_Mini\"
-D BOARD_PANEL=\"ST7789_240x240\"
-D BOARD_IS_C3=1
-D ENABLE_OTA_AUTO=1
-D BACKLIGHT_PIN=5
; --- USB Serial (C3 native USB CDC) ---
-D ARDUINO_USB_CDC_ON_BOOT=1
-D BOARD_LOW_RAM=1
-D USE_ST7789_INVERT=1
; --- C3 flash reclaim (~148 KB): compile our TUs without C++ exceptions so
; their DWARF unwind tables (.eh_frame, ~75 KB) and exception landing pads
; (~37 KB off .text) are not emitted. -fexceptions is the framework default
; and forces the tables, so it must be unflagged - the -fno-unwind-tables
; flags alone do nothing while it is on. Trade-off: new/STL OOM in our code
; aborts (reboot) instead of throwing - acceptable on this board, and no
; other env is touched. firmware.bin 1,831,952 -> 1,684,320 (free 3,056 ->
; 150,688 B). Soak-verified on real C3: single- and dual-TLS + live print +
; ~4000-req HTTP hammer, 0 reboots.
-fno-exceptions
-fno-unwind-tables
-fno-asynchronous-unwind-tables
build_unflags =
-fexceptions
; sensecap_indicator moved to boards/sensecap_indicator.ini (community-maintained, included via extra_configs)