Repository navigation
Expand file tree
/
Copy pathplatformio.ini
More file actions
763 lines (722 loc) · 28.6 KB
/
Copy pathplatformio.ini
File metadata and controls
763 lines (722 loc) · 28.6 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
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
[platformio]
default_envs = default
build_cache_dir = .cache
extra_configs = platformio.local.ini
[crosspoint]
version = 2.0.0
[base]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.311/platform-espressif32.zip
board = esp32-c3-devkitm-1
framework = arduino
monitor_speed = 115200
upload_speed = 921600
check_tool = cppcheck
; missingInclude (project headers) is suppressed alongside missingIncludeSystem: on a
; fresh CI checkout cppcheck has no resolved include paths, so it reports every
; project header as missing (~400 information-level lines) and fails the job.
check_flags =
--enable=all
--check-level=exhaustive
--suppress=missingIncludeSystem
--suppress=missingInclude
--suppress=unusedFunction
--suppress=unmatchedSuppression
--suppress=*:*/.pio/*
; The SDK is maintained separately; keep this check scoped to reader-owned code.
--suppress=*:*/freeink-sdk/*
; Analyzer status output is not a source-code defect.
--suppress=checkersReport
--inline-suppr
check_skip_packages = yes
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
board_upload.offset_address = 0x10000
build_flags =
${ble_page_turner.build_flags}
-DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT=1
-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
# 0 keeps Expat's input buffer at 2 KB; it disables XML_GetInputContext, which nothing calls
-DXML_CONTEXT_BYTES=0
# WebSocket upload server: the web UI runs one upload at a time; the second slot
# lets the next upload connect while the last one closes. Each slot is 240 B.
-DWEBSOCKETS_SERVER_CLIENT_MAX=2
-std=gnu++2a
# Enable UTF-8 long file names in SdFat
-DUSE_UTF8_LONG_NAMES=1
# Allow AnimatedGIF to size its scanline buffer for ebook images wider than 480px
-DMAX_WIDTH=3072
# Keep FAT table sectors separate from file/directory data on ESP32.
# Requires scripts/patch_sdfat.py; reserves one additional inline sector cache.
-DUSE_SEPARATE_FAT_CACHE=1
# SdFat transfers SPI a byte at a time on ESP32: SdFatConfig.h defaults
# USE_SPI_ARRAY_TRANSFER to 0 for every target but RP2040 and the UNO R4, and each
# Arduino transfer(uint8_t) writes the data register, starts the transfer and spins.
# 1 routes through transfer(buf, count) -> transferBytes() -> spiTransferBytesNL(),
# which batches into the SPI FIFO: ~3x on SD reads, at the cost of a 512-byte stack
# buffer on the send path. Inert on SDMMC boards, which bypass SdFat's SPI 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
# FreeInkFont optional FreeType modules. The auto-hinter (~50KB text, PSRAM
# boards only via the vector-font gate) is REQUIRED by the BW-aware 2-bit
# quantizer in TtfEpdFont: with the ink threshold at 50% coverage, unhinted
# thin strokes that straddle pixel columns drop below threshold and break up;
# Light hinting snaps stems to full-coverage pixels so they survive. (An
# earlier "no improvement" A/B was confounded by the old always-ink quantizer
# flooding the differences.) Still OFF: the B/W raster (_MONOCHROME, ~5KB) is
# dead while every TtfEpdFont::load() is 2-bit; psnames (_PSNAMES, ~64KB)
# only serves glyph-NAME lookups a codepoint-driven renderer never makes;
# gzip (_GZIP, ~13KB) only decompresses .gz/WOFF, and the registry accepts
# .ttf/.otf/.ttc.
-DFREEINK_FONT_ENABLE_AUTOHINT=1
-DFREEINK_NET_WOLFSSL=1
; Content protection. Decrypt-on-read + the crypto primitives the browser
; account plugin drives (activation runs in the browser; the device does the
; crypto). KEY_GEN = RSA keypair generation; WC_RC2 = the legacy PBE-SHA1-RC2
; cipher the PKCS#12 signing bundle uses. Inflate binds to CrossPoint's miniz.
-DFREEINK_CONTENT_WOLFSSL=1
-DCONTENT_EXTERNAL_MINIZ=1
-DWOLFSSL_KEY_GEN
-DWC_RC2
; Force software RSA. The Espressif wolfSSL port hardcodes ESP_HW_RSAMAX_BIT
; at 4096, but the ESP32-C3 MPI peripheral only handles operands up to
; 3072-bit — so encrypting to a 4096-bit account/auth certificate on the HW
; path returns MP_EXPTMOD_E (-112) instead of falling back. Software
; fp_exptmod handles up to FP_MAX_BITS/2; RSA is only used at activation and
; for the 1024-bit content-key unwrap, so the speed cost is irrelevant.
-DNO_WOLFSSL_ESP32_CRYPT_RSA_PRI
-DWOLFSSL_USER_SETTINGS
-DWOLFSSL_OPTIONS_H
-DWOLFSSL_CLIENT_EXAMPLE
-DWOLFSSL_TLS13
# MEMFIX-PORT: single-precision ECC (sp_c32.c). Without it every P-256 operation
# (TLS 1.3 key_share keygen, ECDHE, ECDSA cert verify) runs on fast-math bignums
# that WOLFSSL_SMALL_STACK heap-allocates at FP_MAX_BITS size -- tens of KB of
# temporaries, which OOMs (MP_MEM) at the ~50KB free heap a reading session
# leaves. SP uses fixed 256-bit arrays: a few KB, and several times faster.
# SP_SMALL trades the large precomputed point tables for smaller flash.
-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
-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
; 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
extra_scripts =
pre:scripts/patch_pioarduino_cache.py
pre:scripts/patch_wolfssl.py
pre:scripts/build_html.py
pre:scripts/gen_i18n.py
pre:scripts/git_branch.py
pre:scripts/patch_jpegdec.py
pre:scripts/patch_animatedgif.py
post:scripts/patch_sdfat.py
post:scripts/register_unit_tests_target.py
post:scripts/patch_arduino_rom_libc.py
post:scripts/patch_arduino_ble_controller.py
; Libraries
lib_deps =
${ble_page_turner.lib_deps}
BatteryMonitor=symlink://freeink-sdk/libs/hardware/BatteryMonitor
InputManager=symlink://freeink-sdk/libs/hardware/InputManager
HapticManager=symlink://freeink-sdk/libs/hardware/HapticManager
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
MemoryManager=symlink://freeink-sdk/libs/hardware/MemoryManager
FrontlightManager=symlink://freeink-sdk/libs/hardware/FrontlightManager
Rtc=symlink://freeink-sdk/libs/hardware/Rtc
Imu=symlink://freeink-sdk/libs/hardware/Imu
SecureNet=symlink://freeink-sdk/libs/network/SecureNet
JsonSax=symlink://freeink-sdk/libs/network/JsonSax
Opds=symlink://freeink-sdk/libs/network/Opds
CatalogList=symlink://freeink-sdk/libs/network/CatalogList
ContentProtection=symlink://freeink-sdk/libs/book/ContentProtection
FreeInkUI=symlink://freeink-sdk/libs/ui/FreeInkUI
Icons=symlink://freeink-sdk/libs/assets/Icons
; Standalone FreeType/stb TTF engine backing lib/EpdFont/TtfEpdFont (runtime
; .ttf/.otf rendering). Vendors only stb_truetype + FreeType (no expat), so it
; does not hit the FreeInkBook duplicate-XML_* symbol problem.
FreeInkFont=symlink://freeink-sdk/libs/font/FreeInkFont
bblanchon/ArduinoJson @ 7.4.2
; Pinned for the reviewed cache patches in scripts/sdfat_patches/.
greiman/SdFat @ 2.3.1
ricmoo/QRCode @ 0.0.1
bitbank2/PNGdec @ 1.1.6
https://github.com/bitbank2/JPEGDEC.git#86282979224c8a32fd51e091ed5a35b0c699a52b
https://github.com/bitbank2/AnimatedGIF.git#67cfacafe12ef4926c7713342c57d2a4af040e5e
links2004/WebSockets @ 2.7.3
wolfssl/Arduino-wolfSSL @ 5.7.2
lib_ignore =
BLE
; The standard firmware profiles reclaim heap by rebuilding the Arduino core.
; USB-OTG (FREEINK_CAP_USB_MSC) profiles like the X4 Pro and Paper Mono
; intentionally do not inherit this section: they need PioArduino's complete
; prebuilt TinyUSB component graph, which the custom core rebuild omits.
[firmware_tuned]
; MEMFIX-PORT: custom_sdkconfig heap reclamation (~32-37 KB). Rebuilds the
; Arduino core libs on first build (slower once, cached after; needs the CMake
; pin in platformio.local.ini on macOS).
;
; If an interrupted rebuild fails with "multiple definition of 'app_main'"
; (stale generated scaffold), clean it up with:
; rm -rf .dummy CMakeLists.txt sdkconfig.default sdkconfig.defaults .pio/build/default
; Do NOT use `git clean -fdX` — it deletes platformio.local.ini.
custom_sdkconfig =
; Task stack right-sizing from measured high-water marks (heap block map +
; per-task stack audit, July 2026): esp_timer used ~0.8 KB of 8 KB across
; every capture; the FreeRTOS timer service used ~0.5 KB
; of 4 KB. Neither runs TLS or app code. ~7 KB back to the heap.
CONFIG_ESP_TIMER_TASK_STACK_SIZE=4096
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2560
; Move the WiFi stack's non-critical hot paths out of IRAM into flash.
; On the C3, IRAM and DRAM share one SRAM pool, so the ~25-30 KB this
; frees lands directly in the heap — paid for with lower WiFi throughput
; during transfers (occasional sync/OTA use, not streaming: acceptable).
; IRAM cost is static, so the heap gain applies even with WiFi off.
CONFIG_ESP_WIFI_IRAM_OPT=n
CONFIG_ESP_WIFI_RX_IRAM_OPT=n
${ble_page_turner.custom_sdkconfig}
; Omit unused Arduino wrappers from the hybrid framework build.
CONFIG_ARDUINO_SELECTIVE_COMPILATION=y
CONFIG_ARDUINO_SELECTIVE_ArduinoOTA=n
CONFIG_ARDUINO_SELECTIVE_BLE=n
CONFIG_ARDUINO_SELECTIVE_BluetoothSerial=n
CONFIG_ARDUINO_SELECTIVE_EEPROM=n
CONFIG_ARDUINO_SELECTIVE_ESP_Video=n
CONFIG_ARDUINO_SELECTIVE_Ethernet=n
CONFIG_ARDUINO_SELECTIVE_FFat=n
CONFIG_ARDUINO_SELECTIVE_HTTPUpdate=n
CONFIG_ARDUINO_SELECTIVE_LittleFS=n
CONFIG_ARDUINO_SELECTIVE_Matter=n
CONFIG_ARDUINO_SELECTIVE_NetBIOS=n
CONFIG_ARDUINO_SELECTIVE_OpenThread=n
CONFIG_ARDUINO_SELECTIVE_PPP=n
CONFIG_ARDUINO_SELECTIVE_SD=n
CONFIG_ARDUINO_SELECTIVE_SD_MMC=n
CONFIG_ARDUINO_SELECTIVE_SimpleBLE=n
CONFIG_ARDUINO_SELECTIVE_SPIFFS=n
CONFIG_ARDUINO_SELECTIVE_Ticker=n
CONFIG_ARDUINO_SELECTIVE_WiFiProv=n
CONFIG_ARDUINO_SELECTIVE_Zigbee=n
CONFIG_ARDUINO_SELECTIVE_RainMaker=n
CONFIG_ARDUINO_SELECTIVE_Insights=n
; ESP_SR (speech recognition) only exists in the S3 core; its wrapper includes
; ESP_I2S.h, which the isolated core rebuild can't resolve. Unused here anyway,
; so drop it or the sticky env fails to build.
CONFIG_ARDUINO_SELECTIVE_ESP_SR=n
; esp-modbus requires its API blocking limit to cover the response timeout.
CONFIG_FMB_MASTER_MAX_API_BLOCKING_TIME_MS=10000
; Drop unused cloud and Zigbee components. esp_insights/rainmaker
; require embedded server certs the lib builder can't generate
; ("https_server.crt.S not found"); this firmware uses none of them.
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
espressif/esp-zboss-lib
espressif/esp-zigbee-lib
; Bluetooth page turner (lib/BlePageTurner): the NimBLE central under the SDK's BleKeyboardHost,
; sized for one HID remote. Rebuilt cores use the settings below; USB-MSC
; profiles retain their prebuilt core and its Bluetooth defaults.
[ble_page_turner]
custom_sdkconfig =
CONFIG_BT_ENABLED=y
CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=n
CONFIG_BT_NIMBLE_ROLE_BROADCASTER=n
CONFIG_BT_NIMBLE_MAX_CONNECTIONS=1
CONFIG_BT_NIMBLE_MAX_BONDS=4
CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU=23
CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=4096
; One connection and one scan need two activities at most; four is headroom.
CONFIG_BT_CTRL_BLE_MAX_ACT=4
; Room for GATT discovery of a full keyboard (many services).
CONFIG_BT_NIMBLE_MSYS_1_BLOCK_COUNT=12
CONFIG_BT_NIMBLE_MSYS_2_BLOCK_COUNT=12
CONFIG_BT_NIMBLE_TRANSPORT_ACL_FROM_LL_COUNT=8
lib_deps =
BleKeyboardHost=symlink://freeink-sdk/libs/network/BleKeyboardHost
h2zero/NimBLE-Arduino@2.5.1
build_flags =
-DFREEINK_CAP_BLE_HID_HOST=1
-DCONFIG_BT_NIMBLE_ROLE_PERIPHERAL_DISABLED=1
-DCONFIG_BT_NIMBLE_ROLE_BROADCASTER_DISABLED=1
; NimBLE's host in PSRAM on boards that have it (BOARD_HAS_PSRAM).
-include scripts/s3_nimble_psram.h
; Keep C3-specific defaults separate from the S3 firmware profiles.
[firmware_tuned_c3]
extends = firmware_tuned
build_flags =
${base.build_flags}
custom_sdkconfig =
${firmware_tuned.custom_sdkconfig}
; The C3 controller archive is selected by patch_arduino_ble_controller.py.
CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY=y
; Use ROM libc routines to preserve the C3's shared instruction/data RAM.
CONFIG_LIBC_OPTIMIZED_MISALIGNED_ACCESS=n
; Match the configurable defaults from the Arduino 3.3.7 build.
CONFIG_ESP_IPC_TASK_STACK_SIZE=1024
CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK=4096
CONFIG_ESP_WIFI_GCMP_SUPPORT=n
CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND=3000
CONFIG_FMB_QUEUE_LENGTH=20
CONFIG_FMB_TCP_CONNECTION_TOUT_SEC=20
[env:default]
extends = base, firmware_tuned_c3
build_flags =
${firmware_tuned_c3.build_flags}
; CROSSPOINT_VERSION is set by scripts/git_branch.py (includes branch + short SHA)
-DFREEINK_DEVICE_X4=1
-DFREEINK_DEVICE_X3=1
-DENABLE_SERIAL_LOG
-DCROSSPOINT_WAIT_FOR_USB_SERIAL
-DLOG_LEVEL=2 ; Set log level to debug for development builds
[env:gh_release]
extends = base, firmware_tuned_c3
build_flags =
${firmware_tuned_c3.build_flags}
-DFREEINK_DEVICE_X4=1
-DFREEINK_DEVICE_X3=1
-DCROSSPOINT_VERSION=\"${crosspoint.version}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1 ; Set log level to info for release builds
[env:gh_release_rc]
extends = base, firmware_tuned_c3
build_flags =
${firmware_tuned_c3.build_flags}
-DFREEINK_DEVICE_X4=1
-DFREEINK_DEVICE_X3=1
-DCROSSPOINT_VERSION=\"${crosspoint.version}-rc+${sysenv.CROSSPOINT_RC_HASH}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1 ; Set log level to info for release candidate builds
[env:slim]
extends = base, firmware_tuned_c3
build_flags =
${firmware_tuned_c3.build_flags}
-DFREEINK_DEVICE_X4=1
-DFREEINK_DEVICE_X3=1
-DCROSSPOINT_VERSION=\"${crosspoint.version}-slim\"
; serial output is disabled in slim builds to save space
-UENABLE_SERIAL_LOG
; --- 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
; N16R8 board definition enables octal PSRAM.
; pio run -e sticky -t upload
[env:sticky]
extends = base, firmware_tuned
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_STICKY=1
-DENABLE_SERIAL_LOG
-DCROSSPOINT_WAIT_FOR_USB_SERIAL
-DLOG_LEVEL=2
[env:sticky-gh_release]
extends = base, firmware_tuned
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_STICKY=1
-DCROSSPOINT_VERSION=\"${crosspoint.version}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1 ; Set log level to info for release builds
[env:sticky-gh_release_rc]
extends = base, firmware_tuned
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_STICKY=1
-DCROSSPOINT_VERSION=\"${crosspoint.version}-rc+${sysenv.CROSSPOINT_RC_HASH}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1 ; Set log level to info for release candidate builds
; --- Xteink X4 Pro — ESP32-S3, 16MB flash / 8MB PSRAM, SSD1677 + GT911 --------
; The SDK profile supplies the X4 Pro pinout, display, touch controller, and
; capacitive Home key. USB Serial/JTAG is the normal USB personality so
; PlatformIO can monitor and flash the reader. USB Drive starts MSC only for
; that File Transfer activity, then reboots back to this default on exit.
; pio run -e x4pro -t upload
[env:x4pro]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
; Use the prebuilt dio_opi Arduino variant: its TinyUSB component is enabled
; for CDC and MSC. This profile deliberately extends base rather than
; firmware_tuned, whose custom SDK rebuild omits that component.
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_X4PRO=1
-DFREEINK_CAP_USB_MSC=1
-DBOARD_HAS_PSRAM
-DUSB_PRODUCT=\"CrossPoint_X4_Pro\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DCROSSPOINT_VERSION=\"${crosspoint.version}-x4pro\"
-DENABLE_SERIAL_LOG
-DCROSSPOINT_WAIT_FOR_USB_SERIAL
-DLOG_LEVEL=2
; X4 Pro SD is native SDMMC (1-bit), mounted through SdFat's block-device API.
-DUSE_BLOCK_DEVICE_INTERFACE=1
; --- Metalio E-Ink 4 — ESP32-S3, 16MB flash / 8MB octal PSRAM -------------------
; Native USB Serial/JTAG normally; File Transfer -> USB Drive exports the SD.
; Uses the existing base SDK dependencies, including local checkout overrides.
; pio run -e metalio_eink4 -t upload
[env:metalio_eink4]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_METALIO_EINK4=1
-DFREEINK_CAP_USB_MSC=1
-DUSB_PRODUCT=\"CrossPoint_Metalio_EInk4\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DBOARD_HAS_PSRAM
-DUSE_BLOCK_DEVICE_INTERFACE=1
-DCROSSPOINT_VERSION=\"${crosspoint.version}-metalio_eink4\"
-DENABLE_SERIAL_LOG
-DCROSSPOINT_WAIT_FOR_USB_SERIAL
-DLOG_LEVEL=2
[env:metalio_eink4-gh_release]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_METALIO_EINK4=1
-DFREEINK_CAP_USB_MSC=1
-DUSB_PRODUCT=\"CrossPoint_Metalio_EInk4\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DBOARD_HAS_PSRAM
-DUSE_BLOCK_DEVICE_INTERFACE=1
-DCROSSPOINT_VERSION=\"${crosspoint.version}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1 ; Set log level to info for release builds
[env:metalio_eink4-gh_release_rc]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_METALIO_EINK4=1
-DFREEINK_CAP_USB_MSC=1
-DUSB_PRODUCT=\"CrossPoint_Metalio_EInk4\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DBOARD_HAS_PSRAM
-DUSE_BLOCK_DEVICE_INTERFACE=1
-DCROSSPOINT_VERSION=\"${crosspoint.version}-rc+${sysenv.CROSSPOINT_RC_HASH}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1 ; Set log level to info for release candidate builds
; --- Xteink X4 Classic (X4C) ---------------------------------------------------
; Same ESP32-S3 board and display stack as the X4 Pro (SSD1677/UC8179/UC8279 auto-
; detected at boot) but buttons-only: no touchscreen and no frontlight, so the
; freed pins become four extra front buttons (two side page-turn keys + four bottom
; keys). Native 1-bit SDMMC + USB-MSC file transfer as on the X4 Pro; drops the
; frontlight flag. See freeink-sdk/docs/xteink-x4c-support.md.
; pio run -e x4c -t upload
[env:x4c]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_X4CLASSIC=1
-DFREEINK_CAP_USB_MSC=1
-DBOARD_HAS_PSRAM
-DUSB_PRODUCT=\"CrossPoint_X4_Classic\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DCROSSPOINT_VERSION=\"${crosspoint.version}-x4c\"
-DENABLE_SERIAL_LOG
-DCROSSPOINT_WAIT_FOR_USB_SERIAL
-DLOG_LEVEL=2
; X4C SD is native SDMMC (1-bit), mounted through SdFat's block-device API.
-DUSE_BLOCK_DEVICE_INTERFACE=1
[env:x4c-gh_release]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_X4CLASSIC=1
-DFREEINK_CAP_USB_MSC=1
-DBOARD_HAS_PSRAM
-DUSB_PRODUCT=\"CrossPoint_X4_Classic\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DCROSSPOINT_VERSION=\"${crosspoint.version}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1 ; Set log level to info for release builds
-DUSE_BLOCK_DEVICE_INTERFACE=1
[env:x4c-gh_release_rc]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_X4CLASSIC=1
-DFREEINK_CAP_USB_MSC=1
-DBOARD_HAS_PSRAM
-DUSB_PRODUCT=\"CrossPoint_X4_Classic\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DCROSSPOINT_VERSION=\"${crosspoint.version}-rc+${sysenv.CROSSPOINT_RC_HASH}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1 ; Set log level to info for release candidate builds
-DUSE_BLOCK_DEVICE_INTERFACE=1
[env:x4pro-gh_release]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_X4PRO=1
-DFREEINK_CAP_USB_MSC=1
-DBOARD_HAS_PSRAM
-DUSB_PRODUCT=\"CrossPoint_X4_Pro\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DCROSSPOINT_VERSION=\"${crosspoint.version}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1 ; Set log level to info for release builds
-DUSE_BLOCK_DEVICE_INTERFACE=1
[env:x4pro-gh_release_rc]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_X4PRO=1
-DFREEINK_CAP_USB_MSC=1
-DBOARD_HAS_PSRAM
-DUSB_PRODUCT=\"CrossPoint_X4_Pro\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DCROSSPOINT_VERSION=\"${crosspoint.version}-rc+${sysenv.CROSSPOINT_RC_HASH}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1 ; Set log level to info for release candidate builds
-DUSE_BLOCK_DEVICE_INTERFACE=1
; --- M5Stack Paper Mono — ESP32-S3, SSD1683 800x480 + FT6336 touch + frontlight
; Power/reset plumbing runs through the M5PM1 PMIC and M5IOE1 expander; the SDK
; sequences them itself. Touch, frontlight, RTC, and other capabilities are
; selected by the Paper Mono BoardConfig profile.
; Extends base (not firmware_tuned): USB Drive needs the prebuilt dio_opi
; Arduino variant, whose TinyUSB component is enabled for CDC and MSC.
; pio run -e papermono -t upload
[env:papermono]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_PAPERMONO=1
-DFREEINK_CAP_USB_MSC=1
; The SSD1683 grayscale target planes are batched in PSRAM.
-DBOARD_HAS_PSRAM
-DUSB_PRODUCT=\"CrossPoint_Paper_Mono\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DCROSSPOINT_VERSION=\"${crosspoint.version}-papermono\"
-DENABLE_SERIAL_LOG
-DCROSSPOINT_WAIT_FOR_USB_SERIAL
-DLOG_LEVEL=2
; Native 1-bit SDMMC is mounted through SdFat's block-device interface.
-DUSE_BLOCK_DEVICE_INTERFACE=1
[env:papermono-gh_release]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_PAPERMONO=1
-DFREEINK_CAP_USB_MSC=1
-DBOARD_HAS_PSRAM
-DUSB_PRODUCT=\"CrossPoint_Paper_Mono\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DCROSSPOINT_VERSION=\"${crosspoint.version}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1 ; Set log level to info for release builds
-DUSE_BLOCK_DEVICE_INTERFACE=1
[env:papermono-gh_release_rc]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_PAPERMONO=1
-DFREEINK_CAP_USB_MSC=1
-DBOARD_HAS_PSRAM
-DUSB_PRODUCT=\"CrossPoint_Paper_Mono\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DCROSSPOINT_VERSION=\"${crosspoint.version}-rc+${sysenv.CROSSPOINT_RC_HASH}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1 ; Set log level to info for release candidate builds
-DUSE_BLOCK_DEVICE_INTERFACE=1
; --- EEGO Reader A4 — ESP32-S3 N16R8, UC8279C 768x552 + GSLX680 touch ---------
; UC8279C SPI panel, GSLX680 touch, PCF8563 RTC, dedicated HSPI MicroSD (SPI,
; not SDMMC). 16MB DIO flash + 8MB OPI PSRAM. One binary serves the frontlit
; and lightless variants: FrontlightManager probes the I2C LED driver (0x36)
; at begin() and the firmware hides the light UI when it does not ACK.
; Native USB Serial/JTAG normally; USB Drive exports the SPI SD card through
; the SDK's block-device handoff using the prebuilt dio_opi TinyUSB core.
; pio run -e eego_a4 -t upload
[env:eego_a4]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.flash_mode = dio
board_build.arduino.memory_type = dio_opi
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_EEGO_A4=1
-DFREEINK_CAP_USB_MSC=1
-DBOARD_HAS_PSRAM
-DUSB_PRODUCT=\"CrossPoint_EEGO_A4\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DCROSSPOINT_VERSION=\"${crosspoint.version}-eego_a4\"
-DENABLE_SERIAL_LOG
-DCROSSPOINT_WAIT_FOR_USB_SERIAL
-DLOG_LEVEL=2
[env:eego_a4-gh_release]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.flash_mode = dio
board_build.arduino.memory_type = dio_opi
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_EEGO_A4=1
-DFREEINK_CAP_USB_MSC=1
-DBOARD_HAS_PSRAM
-DUSB_PRODUCT=\"CrossPoint_EEGO_A4\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DCROSSPOINT_VERSION=\"${crosspoint.version}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1 ; Set log level to info for release builds
[env:eego_a4-gh_release_rc]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.flash_mode = dio
board_build.arduino.memory_type = dio_opi
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_EEGO_A4=1
-DFREEINK_CAP_USB_MSC=1
-DBOARD_HAS_PSRAM
-DUSB_PRODUCT=\"CrossPoint_EEGO_A4\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DCROSSPOINT_VERSION=\"${crosspoint.version}-rc+${sysenv.CROSSPOINT_RC_HASH}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1 ; Set log level to info for release candidate builds
; --- Onyx Picco / BOOX Tiles — ESP32-S3, 16MB flash / 8MB octal PSRAM ----------
; 3.97" 800x480 SSD1677/SSD2677 (auto-detected), capacitive touch, warm/cool I2C
; frontlight, SGM41562 charger, slide switch. The stock image declares 16MB flash
; and its app alone is ~9MB. Builds target the STOCK partition table
; (partitions_picco.csv) and `pio run -t upload` writes only the app into the
; stock `app` slot at 0xE0000, so the vendor bootloader, NVS and the safeboot
; recovery partition survive. The same firmware.bin works with the stock web
; flasher's "OTA update" mode. Native 4-bit SDMMC + USB-MSC file transfer as on
; the X4 Pro.
; pio run -e picco -t upload
[env:picco]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
board_build.partitions = partitions_picco.csv
extra_scripts =
${base.extra_scripts}
post:scripts/app_only_upload.py
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_PICCO=1
-DFREEINK_CAP_USB_MSC=1
-DBOARD_HAS_PSRAM
-DUSB_PRODUCT=\"CrossPoint_Picco\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DCROSSPOINT_VERSION=\"${crosspoint.version}-picco\"
-DENABLE_SERIAL_LOG
-DCROSSPOINT_WAIT_FOR_USB_SERIAL
-DLOG_LEVEL=2
; Picco SD is native SDMMC (4-bit), mounted through SdFat's block-device API.
-DUSE_BLOCK_DEVICE_INTERFACE=1
[env:picco-gh_release]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
board_build.partitions = partitions_picco.csv
extra_scripts =
${base.extra_scripts}
post:scripts/app_only_upload.py
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_PICCO=1
-DFREEINK_CAP_USB_MSC=1
-DBOARD_HAS_PSRAM
-DUSB_PRODUCT=\"CrossPoint_Picco\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DCROSSPOINT_VERSION=\"${crosspoint.version}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1 ; Set log level to info for release builds
; Picco SD is native SDMMC (4-bit), mounted through SdFat's block-device API.
-DUSE_BLOCK_DEVICE_INTERFACE=1
[env:picco-gh_release_rc]
extends = base
board = esp32-s3-devkitc1-n16r8
board_build.mcu = esp32s3
board_build.arduino.memory_type = dio_opi
board_build.partitions = partitions_picco.csv
extra_scripts =
${base.extra_scripts}
post:scripts/app_only_upload.py
build_flags =
${base.build_flags}
-DFREEINK_DEVICE_PICCO=1
-DFREEINK_CAP_USB_MSC=1
-DBOARD_HAS_PSRAM
-DUSB_PRODUCT=\"CrossPoint_Picco\"
-DUSB_MANUFACTURER=\"CrossPoint\"
-DCROSSPOINT_VERSION=\"${crosspoint.version}-rc+${sysenv.CROSSPOINT_RC_HASH}\"
-DENABLE_SERIAL_LOG
-DLOG_LEVEL=1 ; Set log level to info for release candidate builds
; Picco SD is native SDMMC (4-bit), mounted through SdFat's block-device API.
-DUSE_BLOCK_DEVICE_INTERFACE=1