forked from uxjulia/CrossInk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplatformio.ini
More file actions
700 lines (663 loc) · 25 KB
/
Copy pathplatformio.ini
File metadata and controls
700 lines (663 loc) · 25 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
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
[platformio]
default_envs = default, sticky, x4-pro, x4-classic
extra_configs = platformio.local.ini
[crossink]
version = 1.6.1
; UI languages compiled into the firmware, as comma-separated codes from lib/I18n/translations
; (e.g. "en,de,fr"). English is always included. Languages left out are not offered in the
; language picker; a device whose saved language is not built in falls back to English.
custom_i18n_builtin_langs = all
[base]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.39/platform-espressif32.zip
custom_i18n_builtin_langs = ${crossink.custom_i18n_builtin_langs}
board = esp32-c3-devkitm-1
framework = arduino
monitor_speed = 115200
upload_speed = 921600
check_tool = cppcheck
; The FreeInk SDK is maintained separately; report defects in CrossInk-owned code here.
check_flags = --enable=all --suppress=missingInclude --suppress=missingIncludeSystem --suppress=unusedFunction --suppress=unmatchedSuppression --suppress=*:*/.pio/* --inline-suppr --suppress=*:*freeink-sdk/* --suppress=normalCheckLevelMaxBranches --suppress=checkersReport
check_skip_packages = yes
board_upload.flash_size = 16MB
board_upload.maximum_size = 6553600
board_upload.offset_address = 0x10000
; Rebuild the Arduino/ESP-IDF SDK with lower runtime RAM reservations. Timer
; stacks are still substantially above their measured high-water marks, while
; disabling WiFi IRAM placement trades some throughput for more usable heap.
build_flags =
-Iinclude
-DEINK_DISPLAY_SINGLE_BUFFER_MODE=1
-DDISABLE_FS_H_WARNING=1
-DDESTRUCTOR_CLOSES_FILE=1
# https://libexpat.github.io/doc/api/latest/#XML_GE
-DXML_GE=0
-DXML_CONTEXT_BYTES=1024
-std=gnu++2a
# Enable UTF-8 long file names in SdFat
-DUSE_UTF8_LONG_NAMES=1
# Batch ESP32 SdFat SPI transfers through the hardware FIFO. This speeds up
# SPI SD reads at the cost of a transient 512-byte write-path stack buffer;
# SDMMC boards bypass this driver.
-DUSE_SPI_ARRAY_TRANSFER=1
# Increase PNG scanline buffer to support up to 2048px wide images
# Default is (320*4+1)*2=2562, we need more for larger images
-DPNG_MAX_BUFFERED_PIXELS=16416
-DFREEINK_NET_WOLFSSL=1
-DWOLFSSL_USER_SETTINGS
-DWOLFSSL_OPTIONS_H
-DWOLFSSL_CLIENT_EXAMPLE
-DWOLFSSL_TLS13
-DWOLFSSL_HAVE_SP_ECC
-DWOLFSSL_SP_SMALL
# Arduino-wolfSSL's user_settings.h enables TLS extensions, supported curves,
# HKDF, and RSA-PSS when WOLFSSL_TLS13 is set. Do not repeat those defines here:
# GCC reports every library translation unit as a macro redefinition.
-DHAVE_FFDHE_2048
-DHAVE_CURVE25519
-DHAVE_SNI
# SecureClient asks servers for 2 KB records (max_fragment_length) so wolfSSL
# never needs a 16 KB receive buffer on the C3. The request is compiled out
# unless this is defined (options.h, which would set it, is skipped above).
-DHAVE_MAX_FRAGMENT
# The C3/S3 variants define RGB_BUILTIN, which makes digitalWrite() reference
# rgbLedWrite() and drags in esp32-hal-rgb-led, esp32-hal-rmt, and the whole
# esp_driver_rmt component (~19.6 KB). No CrossInk reader has an addressable
# RGB LED.
-DESP32_ARDUINO_NO_RGB_BUILTIN
-Wno-bidi-chars
-Wl,--wrap=panic_print_backtrace,--wrap=panic_abort,--wrap=bootloader_common_check_efuse_blk_validity
-fno-exceptions
build_unflags =
-std=gnu++11
-fexceptions
; Board configuration
board_build.flash_mode = dio
board_build.flash_size = 16MB
board_build.partitions = partitions.csv
extra_scripts =
pre:scripts/patch_wolfssl.py
pre:scripts/build_web.py
pre:scripts/build_scalable_font_assets.py
pre:scripts/gen_i18n.py
pre:scripts/git_branch.py
pre:scripts/patch_jpegdec.py
pre:scripts/patch_websockets.py
post:scripts/check_firmware_size.py
post:scripts/check_app_touch_gate.py
post:scripts/rename_firmware.py
; Libraries
lib_deps =
BatteryMonitor=symlink://freeink-sdk/libs/hardware/BatteryMonitor
InputManager=symlink://freeink-sdk/libs/hardware/InputManager
EInkDisplay=symlink://freeink-sdk/libs/display/FreeInkDisplay
SDCardManager=symlink://freeink-sdk/libs/hardware/SDCardManager
UsbMassStorage=symlink://freeink-sdk/libs/hardware/UsbMassStorage
BoardConfig=symlink://freeink-sdk/libs/hardware/BoardConfig
XteinkDetect=symlink://freeink-sdk/libs/hardware/XteinkDetect
PowerManager=symlink://freeink-sdk/libs/hardware/PowerManager
Rtc=symlink://freeink-sdk/libs/hardware/Rtc
Imu=symlink://freeink-sdk/libs/hardware/Imu
FrontlightManager=symlink://freeink-sdk/libs/hardware/FrontlightManager
XteinkDetect=symlink://freeink-sdk/libs/hardware/XteinkDetect
SecureNet=symlink://freeink-sdk/libs/network/SecureNet
NearbyTransfer=symlink://freeink-sdk/libs/network/NearbyTransfer
FreeInkUI=symlink://freeink-sdk/libs/ui/FreeInkUI
Icons=symlink://freeink-sdk/libs/assets/Icons
bblanchon/ArduinoJson @ 7.4.2
ricmoo/QRCode @ 0.0.1
bitbank2/PNGdec @ 1.1.6
https://github.com/bitbank2/JPEGDEC.git#86282979224c8a32fd51e091ed5a35b0c699a52b
links2004/WebSockets @ 2.7.3
wolfssl/Arduino-wolfSSL @ 5.7.2
lib_ignore =
BLE
HalClockSim
; Automatic light sleep. With ESP-IDF power management enabled, FreeRTOS
; tickless idle drops the SoC into light sleep whenever every task is blocked
; and no PM lock is held, and wakes on the next scheduled tick. RAM, peripheral
; state, and the panel image survive. InputWake (src/platform/InputWake.h) arms
; GPIO wake lines for digital keys and the GT911 INT pin so a press ends an idle
; wait early; other inputs keep being polled on the loop tick.
;
; This is only safe because HalDisplay wires EInkDisplay::setBusyWaitHooks() to
; HalPowerManager's displayPmLock (ESP_PM_NO_LIGHT_SLEEP), so the SDK's BUSY-pin
; poll never light-sleeps mid-refresh, and — on frontlight boards —
; FREEINK_FRONTLIGHT_LS (freeink-sdk #39), which keeps the LEDC light lit
; through a sleep window. The prebuilt Arduino libs ship with PM off, so every
; env that wants this must rebuild the SDK via custom_sdkconfig.
;
; USB-Serial-JTAG stops answering the host under light sleep, so every PM build
; (the C3 X3/X4 use it for serial too) skips auto light sleep while a USB host is
; connected (detected from SOF frames, so a plain charger still allows it). The
; option depends on the IDF console including USJ; where it does not, Kconfig
; drops it and nothing changes.
[pm_autosleep]
custom_sdkconfig =
CONFIG_PM_ENABLE=y
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
CONFIG_USJ_NO_AUTO_LS_ON_CONNECTION=y
; Rebuild the Arduino/ESP-IDF SDK with lower runtime RAM reservations. Timer
; stacks are still substantially above their measured high-water marks, while
; disabling WiFi IRAM placement trades some throughput for more usable heap.
; X4 Pro intentionally does not inherit this: its USB-OTG profile uses
; pioarduino's complete prebuilt arduino_tinyusb component.
[firmware_tuned]
extends = base
; These managed ESP-IDF components support Arduino cloud, diagnostics, and
; radio-co-processor features that CrossInk does not use.
; X4 Pro intentionally keeps PioArduino's prebuilt component graph intact so
; its USB-OTG sdkconfig and arduino_tinyusb headers stay in sync.
custom_component_remove =
espressif/esp_insights
espressif/esp_rainmaker
espressif/esp_diagnostics
espressif/esp_diag_data_store
espressif/esp_schedule
espressif/esp_rcp_update
espressif/esp_secure_cert_mgr
espressif/cbor
; Arduino 3.3.9 pulls esp-modbus ^2.1.2. From 2.1.3 its new API blocking
; threshold (default 6000 ms) must be >= the prebuilt respond timeout
; (10000 ms), which fails the hybrid rebuild. CrossInk has no Modbus use.
espressif/esp-modbus
custom_sdkconfig =
${pm_autosleep.custom_sdkconfig}
CONFIG_ESP_TIMER_TASK_STACK_SIZE=4096
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2560
CONFIG_ESP_WIFI_IRAM_OPT=n
CONFIG_ESP_WIFI_RX_IRAM_OPT=n
CONFIG_ARDUINO_SELECTIVE_COMPILATION=y
CONFIG_ARDUINO_SELECTIVE_RainMaker=n
CONFIG_ARDUINO_SELECTIVE_Insights=n
CONFIG_ARDUINO_SELECTIVE_ESP_SR=n
; Xteink wake is a power-on reset, which otherwise verifies the whole app
; image before every wake. OTA validates the image before switching slots;
; non-power-on resets retain bootloader validation and OTA fallback coverage.
CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON=y
; mbedTLS stays for WPA2/WPA3 and the esp_http_client TLS path, but CrossInk
; only ever acts as a TLS client over TCP with mainstream ciphers.
[env:default]
extends = firmware_tuned
custom_firmware_device_type = x3-x4
build_flags =
${base.build_flags}
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1
-DCROSSINK_APP_CAP_USB_DRIVE=0
-DFREEINK_DEVICE_X4=1
-DFREEINK_DEVICE_X3=1
-DCROSSINK_APP_CAP_TOUCH=0
; CROSSINK_VERSION is set by scripts/git_branch.py (includes current branch)
-DCROSSINK_FIRMWARE_DEVICE_TYPE=\"x3-x4\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1 ; Set log level to debug for development builds
[env:debug]
extends = firmware_tuned
custom_firmware_device_type = x3-x4
build_flags =
${base.build_flags}
-DARDUINO_USB_MODE=1
-DCROSSINK_APP_CAP_USB_DRIVE=0
-DFREEINK_DEVICE_X4=1
-DFREEINK_DEVICE_X3=1
-DCROSSINK_APP_CAP_TOUCH=0
; CROSSINK_VERSION injected by scripts/git_branch.py
; (uses $CROSSINK_RC_HASH env var in CI, or git short hash locally)
-DCROSSINK_FIRMWARE_DEVICE_TYPE=\"x3-x4\"
-DCROSSINK_BUILD_ENV=\"debug\"
-DCROSSINK_SHOW_SLEEP_BUILD_INFO
; Appends battery telemetry to /battery_log.csv on wake and sleep, for
; diagnosing a gauge that misreports state of charge. Opt in for debug builds.
;-DCROSSINK_BATTERY_DIAG_LOG=1
-DENABLE_SERIAL_LOG
-DCROSSPOINT_WAIT_FOR_USB_SERIAL
-DLOG_LEVEL=2 ; Set log level to debug for development builds
[simulator-base]
platform = native
custom_i18n_builtin_langs = ${crossink.custom_i18n_builtin_langs}
custom_run_simulator_target_owner = project
lib_compat_mode = off
build_src_filter =
+<*>
-<network/FirmwareBoardTag.cpp>
-<network/FirmwareFlasher.cpp>
-<network/OtaBootSwitch.cpp>
-<network/OtaUpdater.cpp>
-<platform/skip_efuse_blk_check.c>
build_flags =
-std=gnu++2a
!sdl2-config --cflags --libs
-DSIMULATOR
-DCROSSPOINT_SIMULATOR_PROJECT_WEBSERVER
-Wno-c++11-narrowing
-DCROSSINK_VERSION=\"${crossink.version}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=2
-DEINK_DISPLAY_SINGLE_BUFFER_MODE=1
-DXML_GE=0
-DXML_CONTEXT_BYTES=1024
-DMINIZ_NO_ZLIB_COMPATIBLE_NAMES=1
-DUSE_UTF8_LONG_NAMES=1
-DPNG_MAX_BUFFERED_PIXELS=16416
-DDISABLE_FS_H_WARNING=1
-DDESTRUCTOR_CLOSES_FILE=1
;-DSIMULATOR_DEVICE_X3 ; uncomment to simulate X3 screen size
-Iinclude
-Isrc
-DCROSSPOINT_SIM_USE_NATIVE_DECODERS
-Dmemcpy_P=memcpy ; For native JPEGDEC
lib_ignore = hal, WebSockets
extra_scripts =
pre:scripts/build_scalable_font_assets.py
pre:scripts/gen_i18n.py
pre:scripts/git_branch.py
pre:scripts/build_web.py
post:.pio/libdeps/$PIOENV/simulator/run_simulator_project.py
lib_deps =
simulator=https://github.com/uxjulia/crossink-simulator
FreeInkUI=symlink://freeink-sdk/libs/ui/FreeInkUI
Icons=symlink://freeink-sdk/libs/assets/Icons
NearbyTransfer=symlink://freeink-sdk/libs/network/NearbyTransfer
bblanchon/ArduinoJson @ 7.4.2
ricmoo/QRCode @ ^0.0.1
bitbank2/PNGdec @ 1.1.6
https://github.com/bitbank2/JPEGDEC.git#86282979224c8a32fd51e091ed5a35b0c699a52b
links2004/WebSockets @ 2.7.3
[env:simulator]
extends = simulator-base
build_flags =
${simulator-base.build_flags}
-DCROSSINK_APP_CAP_TOUCH=0
-DCROSSINK_APP_CAP_USB_DRIVE=0
-DCROSSINK_FIRMWARE_DEVICE_TYPE=\"x3-x4\"
[env:simulator-X3]
extends = simulator-base
build_flags =
${simulator-base.build_flags}
-DCROSSINK_APP_CAP_TOUCH=0
-DCROSSINK_APP_CAP_USB_DRIVE=0
-DCROSSINK_FIRMWARE_DEVICE_TYPE=\"x3-x4\"
-DSIMULATOR_DEVICE_X3
[env:sticky-simulator]
extends = simulator-base
lib_deps =
${simulator-base.lib_deps}
FreeInkFont=symlink://freeink-sdk/libs/font/FreeInkFont
build_flags =
-DCROSSINK_SCALABLE_FONTS=1
-DFREEINK_FONT_ENABLE_AUTOHINT=1
-DFREEINK_FONT_ENABLE_NATIVE_HINTING=1
-DFREEINK_FONT_ENABLE_MONOCHROME=1
${simulator-base.build_flags}
-DSIMULATOR_DEVICE_STICKY
-DFREEINK_DEVICE_STICKY=1
-DCROSSINK_APP_CAP_TOUCH=1
-DCROSSINK_APP_CAP_USB_DRIVE=0
-DCROSSINK_FIRMWARE_DEVICE_TYPE=\"sticky\"
; pio run -e sticky-simulator -t run_simulator
; --- Xteink X4 Pro simulator -----------------------------------------------
; Use the simulator's native X4 Pro profile so it exposes its Home key and
; PWM frontlight capabilities.
[env:x4-pro-simulator]
extends = simulator-base
lib_deps =
${simulator-base.lib_deps}
FreeInkFont=symlink://freeink-sdk/libs/font/FreeInkFont
build_flags =
-DCROSSINK_SCALABLE_FONTS=1
-DFREEINK_FONT_ENABLE_AUTOHINT=1
-DFREEINK_FONT_ENABLE_NATIVE_HINTING=1
-DFREEINK_FONT_ENABLE_MONOCHROME=1
${simulator-base.build_flags}
-DSIMULATOR_DEVICE_X4_PRO
-DCROSSINK_APP_CAP_TOUCH=1
-DCROSSINK_APP_CAP_USB_DRIVE=1
-DCROSSINK_FIRMWARE_DEVICE_TYPE=\"x4-pro\"
; pio run -e x4-pro-simulator -t run_simulator
; --- Xteink X4 Classic simulator -------------------------------------------
; The X4 Classic uses the S3-era X4 panel and USB Drive support, but has
; physical buttons only: no touchscreen or frontlight.
[env:x4-classic-simulator]
extends = simulator-base
build_flags =
${simulator-base.build_flags}
-DSIMULATOR_DEVICE_X4_CLASSIC
-DCROSSINK_APP_CAP_TOUCH=0
-DCROSSINK_APP_CAP_USB_DRIVE=1
-DCROSSINK_FIRMWARE_DEVICE_TYPE=\"x4-classic\"
; pio run -e x4-classic-simulator -t run_simulator
; --- Seeed Sticky - ESP32-S3R8, 3.97" 800x480 SSD1677 + GT911 touch -----------
; Different MCU family than the C3 envs (one binary per family). The SDK
; auto-enables CAP_TOUCH (GT911) and the BQ27220 gauge for this device. The
; framebuffer is placed in PSRAM to leave more internal DRAM for EPUB rendering.
; pio run -e sticky -t upload
[env:sticky]
extends = firmware_tuned
lib_deps =
${base.lib_deps}
FreeInkFont=symlink://freeink-sdk/libs/font/FreeInkFont
custom_sdkconfig =
${firmware_tuned.custom_sdkconfig}
; Prefer PSRAM for medium EPUB allocations while leaving tiny hot objects internal.
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=1024
custom_firmware_device_type = sticky
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
build_flags =
-DCROSSINK_SCALABLE_FONTS=1
-DFREEINK_FONT_ENABLE_AUTOHINT=1
-DFREEINK_FONT_ENABLE_NATIVE_HINTING=1
-DFREEINK_FONT_ENABLE_MONOCHROME=1
${base.build_flags}
-DARDUINO_USB_MODE=1
-DCROSSINK_APP_CAP_USB_DRIVE=0
-DFREEINK_DEVICE_STICKY=1
-DCROSSINK_APP_CAP_TOUCH=1
-DFREEINK_FB_PSRAM=1
; CROSSINK_VERSION is set by scripts/git_branch.py so RC builds include the
; commit hash shown in Settings > System.
-DCROSSINK_FIRMWARE_DEVICE_TYPE=\"sticky\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1
[env:sticky-debug]
extends = firmware_tuned
lib_deps =
${base.lib_deps}
FreeInkFont=symlink://freeink-sdk/libs/font/FreeInkFont
custom_sdkconfig =
${firmware_tuned.custom_sdkconfig}
; Prefer PSRAM for medium EPUB allocations while leaving tiny hot objects internal.
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=1024
custom_firmware_device_type = sticky
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
build_flags =
-DCROSSINK_SCALABLE_FONTS=1
-DFREEINK_FONT_ENABLE_AUTOHINT=1
-DFREEINK_FONT_ENABLE_NATIVE_HINTING=1
-DFREEINK_FONT_ENABLE_MONOCHROME=1
${base.build_flags}
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1
-DCROSSINK_APP_CAP_USB_DRIVE=0
-DFREEINK_DEVICE_STICKY=1
-DCROSSINK_APP_CAP_TOUCH=1
-DFREEINK_FB_PSRAM=1
; CROSSINK_VERSION injected by scripts/git_branch.py
-DCROSSINK_FIRMWARE_DEVICE_TYPE=\"sticky\"
-DENABLE_SERIAL_LOG
-DCROSSPOINT_WAIT_FOR_USB_SERIAL
-DCROSSINK_SHOW_SLEEP_BUILD_INFO
-DLOG_LEVEL=2
; --- Xteink X4 Pro - ESP32-S3R8, 4.2" 800x480 SSD1677 + GT911 touch ---------
; The framebuffer lives in PSRAM. The SDK profile also enables its SDMMC slot,
; capacitive Home key, CW2017 battery gauge, and warm/cool PWM frontlight.
; USB-Serial/JTAG is the normal USB personality so PlatformIO can monitor and
; flash the reader. UsbDriveActivity starts TinyUSB MSC only while USB Drive is
; active, then restarts back into this default when the session ends.
[env:x4-pro]
extends = base
lib_deps =
${base.lib_deps}
FreeInkFont=symlink://freeink-sdk/libs/font/FreeInkFont
custom_firmware_device_type = x4-pro
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
; PioArduino's qio_opi SDK variant omits arduino_tinyusb. Match CrossInk's
; DIO flash setting to the dio_opi variant, which supplies TinyUSB MSC for the
; on-demand USB Drive activity.
board_build.arduino.memory_type = dio_opi
build_flags =
-DCROSSINK_SCALABLE_FONTS=1
-DFREEINK_FONT_ENABLE_AUTOHINT=1
-DFREEINK_FONT_ENABLE_NATIVE_HINTING=1
-DFREEINK_FONT_ENABLE_MONOCHROME=1
${base.build_flags}
-DARDUINO_USB_CDC_ON_BOOT=1
-DFREEINK_DEVICE_X4PRO=1
-DCROSSINK_APP_CAP_TOUCH=1
-DFREEINK_CAP_USB_MSC=1
-DCROSSINK_APP_CAP_USB_DRIVE=1
-DARDUINO_USB_MODE=1
-DCONFIG_TINYUSB_ENABLED=1
-DCONFIG_TINYUSB_CDC_ENABLED=1
-DCONFIG_TINYUSB_MSC_ENABLED=1
-DUSB_PRODUCT=\"CrossInk_X4_Pro\"
-DUSB_MANUFACTURER=\"CrossInk\"
-DFREEINK_FB_PSRAM=1
; X4 Pro uses native SDMMC. Select SdFat's generic block-device seam so the
; SDK's SDMMC adapter can back the normal FsFile/FsVolume API.
-DUSE_BLOCK_DEVICE_INTERFACE=1
; CROSSINK_VERSION is set by scripts/git_branch.py so RC builds include the
; commit hash shown in Settings > System.
-DCROSSINK_FIRMWARE_DEVICE_TYPE=\"x4-pro\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1
[env:x4-pro-debug]
extends = base
lib_deps =
${base.lib_deps}
FreeInkFont=symlink://freeink-sdk/libs/font/FreeInkFont
custom_firmware_device_type = x4-pro
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
build_unflags =
-DARDUINO_USB_CDC_ON_BOOT=1
build_flags =
-DCROSSINK_SCALABLE_FONTS=1
-DFREEINK_FONT_ENABLE_AUTOHINT=1
-DFREEINK_FONT_ENABLE_NATIVE_HINTING=1
-DFREEINK_FONT_ENABLE_MONOCHROME=1
${base.build_flags}
-DARDUINO_USB_CDC_ON_BOOT=1
-DFREEINK_DEVICE_X4PRO=1
-DCROSSINK_APP_CAP_TOUCH=1
-DFREEINK_CAP_USB_MSC=1
-DCROSSINK_APP_CAP_USB_DRIVE=1
-DARDUINO_USB_MODE=1
-DCONFIG_TINYUSB_ENABLED=1
-DCONFIG_TINYUSB_CDC_ENABLED=1
-DCONFIG_TINYUSB_MSC_ENABLED=1
-DUSB_PRODUCT=\"CrossInk_X4_Pro\"
-DUSB_MANUFACTURER=\"CrossInk\"
-DFREEINK_FB_PSRAM=1
-DCROSSINK_SHOW_SLEEP_BUILD_INFO
; X4 Pro uses native SDMMC. Select SdFat's generic block-device seam so the
; SDK's SDMMC adapter can back the normal FsFile/FsVolume API.
-DUSE_BLOCK_DEVICE_INTERFACE=1
; CROSSINK_VERSION is injected by scripts/git_branch.py for debug builds.
-DCROSSINK_FIRMWARE_DEVICE_TYPE=\"x4-pro\"
-DENABLE_SERIAL_LOG
-DCROSSPOINT_WAIT_FOR_USB_SERIAL
-DLOG_LEVEL=2
; --- Xteink X4 Pro light-sleep profile -------------------------------------
; Use the S3's built-in USB-Serial-JTAG CDC for logging and serial transfers.
; USB-Serial-JTAG cannot work under light sleep, so USJ_NO_AUTO_LS_ON_CONNECTION
; holds a no-light-sleep PM lock while a USB host is attached (detected from
; SOF frames, so a plain charger still allows light sleep).
;
; The custom SDK rebuild required for automatic light sleep drops every
; CONFIG_TINYUSB_* key, because their Kconfig lives in the lib-builder's
; arduino_tinyusb component rather than in arduino-esp32. The prebuilt
; libarduino_tinyusb.a and its headers are still on disk, so restate the
; prebuilt SDK's TinyUSB config here to compile the Arduino USB/MSC core
; against the same class set the library was built with. USB Drive holds its
; own no-light-sleep lock while the USB-OTG PHY is claimed.
[x4_pro_tinyusb_prebuilt]
build_flags =
; The hybrid build takes its include paths from the IDF component graph,
; which has no arduino_tinyusb, so point at the prebuilt headers directly.
-I${platformio.packages_dir}/framework-arduinoespressif32-libs/esp32s3/include/arduino_tinyusb/tinyusb/src
-I${platformio.packages_dir}/framework-arduinoespressif32-libs/esp32s3/include/arduino_tinyusb/include
-DCONFIG_TINYUSB_ENABLED=1
-DCONFIG_TINYUSB_CDC_ENABLED=1
-DCONFIG_TINYUSB_CDC_MAX_PORTS=2
-DCONFIG_TINYUSB_CDC_RX_BUFSIZE=64
-DCONFIG_TINYUSB_CDC_TX_BUFSIZE=64
-DCONFIG_TINYUSB_MSC_ENABLED=1
-DCONFIG_TINYUSB_MSC_BUFSIZE=4096
-DCONFIG_TINYUSB_HID_ENABLED=1
-DCONFIG_TINYUSB_HID_BUFSIZE=64
-DCONFIG_TINYUSB_MIDI_ENABLED=1
-DCONFIG_TINYUSB_MIDI_RX_BUFSIZE=64
-DCONFIG_TINYUSB_MIDI_TX_BUFSIZE=64
-DCONFIG_TINYUSB_AUDIO_ENABLED=1
-DCONFIG_TINYUSB_VIDEO_ENABLED=1
-DCONFIG_TINYUSB_VIDEO_STREAMING_BUFSIZE=64
-DCONFIG_TINYUSB_VIDEO_STREAMING_IFS=1
-DCONFIG_TINYUSB_DFU_RT_ENABLED=1
-DCONFIG_TINYUSB_DFU_ENABLED=1
-DCONFIG_TINYUSB_DFU_BUFSIZE=4096
-DCONFIG_TINYUSB_VENDOR_ENABLED=1
-DCONFIG_TINYUSB_VENDOR_RX_BUFSIZE=64
-DCONFIG_TINYUSB_VENDOR_TX_BUFSIZE=64
-DCONFIG_TINYUSB_NCM_ENABLED=1
-DCONFIG_TINYUSB_DEBUG_LEVEL=0
-DUSB_PRODUCT=\"CrossInk_X4_Pro\"
-DUSB_MANUFACTURER=\"CrossInk\"
[env:x4-pro-light-sleep]
extends = firmware_tuned
lib_deps =
${base.lib_deps}
FreeInkFont=symlink://freeink-sdk/libs/font/FreeInkFont
custom_sdkconfig =
CONFIG_PM_ENABLE=y
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
CONFIG_ESP_TIMER_TASK_STACK_SIZE=4096
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2560
CONFIG_ESP_WIFI_IRAM_OPT=n
CONFIG_ESP_WIFI_RX_IRAM_OPT=n
CONFIG_ARDUINO_SELECTIVE_COMPILATION=y
CONFIG_ARDUINO_SELECTIVE_RainMaker=n
CONFIG_ARDUINO_SELECTIVE_Insights=n
CONFIG_ARDUINO_SELECTIVE_ESP_SR=n
CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON=y
CONFIG_USJ_NO_AUTO_LS_ON_CONNECTION=y
custom_firmware_device_type = x4-pro
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
build_flags =
-DCROSSINK_SCALABLE_FONTS=1
-DFREEINK_FONT_ENABLE_AUTOHINT=1
-DFREEINK_FONT_ENABLE_NATIVE_HINTING=1
-DFREEINK_FONT_ENABLE_MONOCHROME=1
${base.build_flags}
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1
-DFREEINK_DEVICE_X4PRO=1
-DCROSSINK_APP_CAP_TOUCH=1
-DFREEINK_CAP_USB_MSC=1
-DCROSSINK_APP_CAP_USB_DRIVE=1
${x4_pro_tinyusb_prebuilt.build_flags}
-DFREEINK_FB_PSRAM=1
-DFREEINK_FRONTLIGHT_LS=1
-DUSE_BLOCK_DEVICE_INTERFACE=1
-DCROSSINK_FIRMWARE_DEVICE_TYPE=\"x4-pro\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1
[env:x4-pro-light-sleep-debug]
extends = firmware_tuned
lib_deps =
${base.lib_deps}
FreeInkFont=symlink://freeink-sdk/libs/font/FreeInkFont
custom_sdkconfig =
CONFIG_PM_ENABLE=y
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
CONFIG_ESP_TIMER_TASK_STACK_SIZE=4096
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2560
CONFIG_ESP_WIFI_IRAM_OPT=n
CONFIG_ESP_WIFI_RX_IRAM_OPT=n
CONFIG_ARDUINO_SELECTIVE_COMPILATION=y
CONFIG_ARDUINO_SELECTIVE_RainMaker=n
CONFIG_ARDUINO_SELECTIVE_Insights=n
CONFIG_ARDUINO_SELECTIVE_ESP_SR=n
CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON=y
CONFIG_USJ_NO_AUTO_LS_ON_CONNECTION=y
custom_firmware_device_type = x4-pro
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
build_flags =
-DCROSSINK_SCALABLE_FONTS=1
-DFREEINK_FONT_ENABLE_AUTOHINT=1
-DFREEINK_FONT_ENABLE_NATIVE_HINTING=1
-DFREEINK_FONT_ENABLE_MONOCHROME=1
${base.build_flags}
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1
-DFREEINK_DEVICE_X4PRO=1
-DCROSSINK_APP_CAP_TOUCH=1
-DFREEINK_CAP_USB_MSC=1
-DCROSSINK_APP_CAP_USB_DRIVE=1
${x4_pro_tinyusb_prebuilt.build_flags}
-DFREEINK_FB_PSRAM=1
-DFREEINK_FRONTLIGHT_LS=1
-DUSE_BLOCK_DEVICE_INTERFACE=1
-DCROSSINK_FIRMWARE_DEVICE_TYPE=\"x4-pro\"
-DENABLE_SERIAL_LOG
-DCROSSINK_ENABLE_READING_STATS_TOGGLE
-DCROSSINK_SHOW_SLEEP_BUILD_INFO
-DLOG_LEVEL=2
; --- Xteink X4 Classic - ESP32-S3R8, 4.2" 800x480, buttons only ------------
; Shares the X4 Pro's panel, SDMMC slot, USB Drive support, and PSRAM-backed
; framebuffer, but has no touchscreen or frontlight. Its SDK profile exposes
; two edge page-turn buttons plus four front buttons.
[env:x4-classic]
extends = base
lib_deps =
${base.lib_deps}
FreeInkFont=symlink://freeink-sdk/libs/font/FreeInkFont
custom_firmware_device_type = x4-classic
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
build_flags =
-DCROSSINK_SCALABLE_FONTS=1
-DFREEINK_FONT_ENABLE_AUTOHINT=1
-DFREEINK_FONT_ENABLE_NATIVE_HINTING=1
-DFREEINK_FONT_ENABLE_MONOCHROME=1
${base.build_flags}
-DARDUINO_USB_CDC_ON_BOOT=1
-DFREEINK_DEVICE_X4CLASSIC=1
-DCROSSINK_APP_CAP_TOUCH=0
-DFREEINK_CAP_USB_MSC=1
-DCROSSINK_APP_CAP_USB_DRIVE=1
-DARDUINO_USB_MODE=1
-DUSB_PRODUCT=\"CrossInk_X4_Classic\"
-DUSB_MANUFACTURER=\"CrossInk\"
-DFREEINK_FB_PSRAM=1
-DUSE_BLOCK_DEVICE_INTERFACE=1
-DCROSSINK_FIRMWARE_DEVICE_TYPE=\"x4-classic\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1
[env:x4-classic-debug]
extends = base
lib_deps =
${base.lib_deps}
FreeInkFont=symlink://freeink-sdk/libs/font/FreeInkFont
custom_firmware_device_type = x4-classic
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
build_flags =
-DCROSSINK_SCALABLE_FONTS=1
-DFREEINK_FONT_ENABLE_AUTOHINT=1
-DFREEINK_FONT_ENABLE_NATIVE_HINTING=1
-DFREEINK_FONT_ENABLE_MONOCHROME=1
${base.build_flags}
-DARDUINO_USB_CDC_ON_BOOT=1
-DFREEINK_DEVICE_X4CLASSIC=1
-DCROSSINK_APP_CAP_TOUCH=0
-DFREEINK_CAP_USB_MSC=1
-DCROSSINK_APP_CAP_USB_DRIVE=1
-DARDUINO_USB_MODE=1
-DUSB_PRODUCT=\"CrossInk_X4_Classic\"
-DUSB_MANUFACTURER=\"CrossInk\"
-DFREEINK_FB_PSRAM=1
-DUSE_BLOCK_DEVICE_INTERFACE=1
-DCROSSINK_FIRMWARE_DEVICE_TYPE=\"x4-classic\"
-DENABLE_SERIAL_LOG
-DCROSSPOINT_WAIT_FOR_USB_SERIAL
-DLOG_LEVEL=2