@geastack/targets 0.1.85 → 0.1.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build-config.json CHANGED
@@ -476,6 +476,46 @@
476
476
  }
477
477
  },
478
478
  "supported": []
479
+ },
480
+ "esp32-s3-touch-lcd-3.5b": {
481
+ "supported": [
482
+ "compiler.generatedCodeOptimization",
483
+ "renderer.fuseReplayFlush",
484
+ "renderer.adaptiveCoalescing",
485
+ "renderer.broadDirtyBounds",
486
+ "display.framebufferStream",
487
+ "display.presentStream"
488
+ ],
489
+ "defaults": {
490
+ "compiler": {
491
+ "generatedCodeOptimization": "Os",
492
+ "numberPrecision": "float64"
493
+ },
494
+ "renderer": {
495
+ "fuseReplayFlush": false,
496
+ "subtreeRevealChecks": true,
497
+ "recordInlinePositions": true,
498
+ "adaptiveCoalescing": false,
499
+ "broadDirtyBounds": false
500
+ },
501
+ "display": {
502
+ "framebufferStream": "independent",
503
+ "presentStream": "independent"
504
+ },
505
+ "diagnostics": {
506
+ "performanceCounters": true,
507
+ "frameTiming": true
508
+ }
509
+ },
510
+ "cssDevicePixelRatio": 1.5,
511
+ "constraints": {
512
+ "display.framebufferStream": [
513
+ "independent"
514
+ ],
515
+ "renderer.fuseReplayFlush": [
516
+ false
517
+ ]
518
+ }
479
519
  }
480
520
  }
481
521
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geastack/targets",
3
- "version": "0.1.85",
3
+ "version": "0.1.86",
4
4
  "description": "Native embedded build targets (ESP32-IDF, RP2350) for geastack apps: board sources, target catalog, and CMake glue driven by the gea CLI.",
5
5
  "license": "GPL-3.0-only",
6
6
  "repository": {
@@ -20,6 +20,9 @@
20
20
  #if GEA_EMBEDDED_AXS15231B_PANEL
21
21
  #include "driver/ledc.h"
22
22
  #include "esp_lcd_axs15231b.h"
23
+ #ifdef GEA_BOARD_AXS15231B_INIT_HEADER
24
+ #include GEA_BOARD_AXS15231B_INIT_HEADER
25
+ #endif
23
26
  #else
24
27
  #include "esp_lcd_sh8601.h"
25
28
  #endif
@@ -306,8 +309,13 @@ namespace gea::platform::esp32::chip_bindings::sh8601
306
309
  #if GEA_EMBEDDED_AXS15231B_PANEL
307
310
  ESP_RETURN_ON_ERROR(configureBacklight(), kTag, "backlight setup failed");
308
311
  axs15231b_vendor_config_t vendorConfig = {};
312
+ #ifdef GEA_BOARD_AXS15231B_INIT_HEADER
313
+ vendorConfig.init_cmds = kBoardAxsInitCommands;
314
+ vendorConfig.init_cmds_size = sizeof(kBoardAxsInitCommands) / sizeof(kBoardAxsInitCommands[0]);
315
+ #else
309
316
  vendorConfig.init_cmds = kLilygoInitCommands;
310
317
  vendorConfig.init_cmds_size = sizeof(kLilygoInitCommands) / sizeof(kLilygoInitCommands[0]);
318
+ #endif
311
319
  #elif GEA_EMBEDDED_RM690B0_PANEL
312
320
  sh8601_vendor_config_t vendorConfig = {};
313
321
  vendorConfig.init_cmds = kRm69080InitCommands;
@@ -190,6 +190,13 @@ namespace gea::platform::esp32::display
190
190
  #ifndef GEA_EMBEDDED_DISPLAY_ASYNC_MEMCPY_BURST_BYTES
191
191
  #define GEA_EMBEDDED_DISPLAY_ASYNC_MEMCPY_BURST_BYTES 32
192
192
  #endif
193
+ // Some AXS15231B glass accepts sequential full-frame QSPI writes but cannot
194
+ // reliably restart at a nonzero native row. Keep damage-based rasterization,
195
+ // while sending the retained framebuffer from its origin on these panels.
196
+ #ifndef GEA_EMBEDDED_DISPLAY_FULL_FRAME_TRANSFERS
197
+ #define GEA_EMBEDDED_DISPLAY_FULL_FRAME_TRANSFERS 0
198
+ #endif
199
+
193
200
  // DIAGNOSTIC: collapse all dirty flush windows into a single bounding box, so a
194
201
  // frame flushes as one window's worth of row-chunks instead of N fragmented
195
202
  // windows. Used to A/B whether per-chunk transaction overhead (not pixel
@@ -1263,6 +1270,12 @@ namespace gea::platform::esp32::display
1263
1270
  bool flushFramebufferRectFrom(const std::uint16_t *source, int x0, int y0, int x1, int y1, bool waitAtEnd, bool allowDirect = true, bool allowPerChunkDrain = true,
1264
1271
  platform_display::DisplayStreamRasterFn raster = nullptr, void *rasterUser = nullptr)
1265
1272
  {
1273
+ #if GEA_EMBEDDED_DISPLAY_FULL_FRAME_TRANSFERS
1274
+ x0 = 0;
1275
+ y0 = 0;
1276
+ x1 = logicalDisplayWidth() - 1;
1277
+ y1 = logicalDisplayHeight() - 1;
1278
+ #endif
1266
1279
  #if GEA_EMBEDDED_DISPLAY_SOFTWARE_LANDSCAPE_PRIMARY
1267
1280
  #if GEA_EMBEDDED_DISPLAY_RUNTIME_SOFTWARE_ORIENTATION
1268
1281
  if (softwareLandscapeActive())
@@ -1869,6 +1882,13 @@ namespace gea::platform::esp32::display
1869
1882
  n = 1;
1870
1883
  #endif
1871
1884
 
1885
+ #if GEA_EMBEDDED_DISPLAY_FULL_FRAME_TRANSFERS
1886
+ // Collapse damage to one upload, not one full-frame upload per dirty box.
1887
+ if (n > 0) {
1888
+ win[0] = {0, 0, logicalDisplayWidth() - 1, logicalDisplayHeight() - 1};
1889
+ n = 1;
1890
+ }
1891
+ #endif
1872
1892
  bool ok = true;
1873
1893
  for (int i = 0; i < n; i++)
1874
1894
  {
@@ -0,0 +1,10 @@
1
+ cmake_minimum_required(VERSION 3.16)
2
+
3
+ set(EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/../esp32/components")
4
+ include("${CMAKE_CURRENT_LIST_DIR}/../esp32/app_project.cmake")
5
+ set(GEA_EMBEDDED_APP "tic-tac-toe" CACHE STRING "Example app to build (must match a package.json gea.id)")
6
+ set(PROJECT_VER "${GEA_EMBEDDED_APP}" CACHE STRING "Firmware app id" FORCE)
7
+
8
+ include($ENV{IDF_PATH}/tools/cmake/project.cmake)
9
+ idf_build_set_property(MINIMAL_BUILD ON)
10
+ project(gea_embedded)
@@ -0,0 +1,49 @@
1
+ dependencies:
2
+ espressif/cmake_utilities:
3
+ component_hash: 351350613ceafba240b761b4ea991e0f231ac7a9f59a9ee901f751bddc0bb18f
4
+ dependencies:
5
+ - name: idf
6
+ require: private
7
+ version: '>=4.1'
8
+ source:
9
+ registry_url: https://components.espressif.com
10
+ type: service
11
+ version: 0.5.3
12
+ espressif/esp_lcd_axs15231b:
13
+ component_hash: 62afe3c46789d7a13e3807c5d7a3a734870cd6375a28f14b12498c3382ad43b4
14
+ dependencies:
15
+ - name: espressif/cmake_utilities
16
+ registry_url: https://components.espressif.com
17
+ require: private
18
+ version: 0.*
19
+ - name: espressif/esp_lcd_touch
20
+ registry_url: https://components.espressif.com
21
+ require: public
22
+ version: ^1
23
+ - name: idf
24
+ require: private
25
+ version: '>=5.3'
26
+ source:
27
+ registry_url: https://components.espressif.com/
28
+ type: service
29
+ version: 2.1.1
30
+ espressif/esp_lcd_touch:
31
+ component_hash: 3f85a7d95af876f1a6ecca8eb90a81614890d0f03a038390804e5a77e2caf862
32
+ dependencies:
33
+ - name: idf
34
+ require: private
35
+ version: '>=4.4.2'
36
+ source:
37
+ registry_url: https://components.espressif.com
38
+ type: service
39
+ version: 1.2.1
40
+ idf:
41
+ source:
42
+ type: idf
43
+ version: 6.0.2
44
+ direct_dependencies:
45
+ - espressif/esp_lcd_axs15231b
46
+ - idf
47
+ manifest_hash: cfad2492c50218eed0e2358c2025bb905712d957d84a725ee1d97a28672a0bf0
48
+ target: esp32s3
49
+ version: 3.0.0
@@ -0,0 +1,35 @@
1
+ set(GEA_BOARD_COMPONENT_DIR "${CMAKE_CURRENT_LIST_DIR}")
2
+ set(GEA_BOARD_TARGET_DIR "${CMAKE_CURRENT_LIST_DIR}/..")
3
+ set(GEA_EMBEDDED_CPP_BOARD "esp32-s3-touch-lcd-3.5b")
4
+ set(GEA_EMBEDDED_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../..")
5
+ cmake_path(ABSOLUTE_PATH GEA_EMBEDDED_ROOT NORMALIZE)
6
+ include("${GEA_EMBEDDED_ROOT}/targets/esp32/gea_framework.cmake")
7
+ set(GEA_EMBEDDED_CSS_DEVICE_PIXEL_RATIO "1.5" CACHE STRING "Logical CSS pixel scale")
8
+ set(GEA_BOARD_DISPLAY_WIDTH 320)
9
+ set(GEA_BOARD_DISPLAY_HEIGHT 480)
10
+ set(GEA_BOARD_QSPI_PCLK_HZ 40000000)
11
+ set(GEA_BOARD_FRAMEBUFFER_STREAM_FLUSH 1)
12
+ set(GEA_BOARD_PARTIAL_PAD_X 0)
13
+ set(GEA_BOARD_PARTIAL_PAD_Y 0)
14
+ set(GEA_BOARD_STREAM_PACE_CHUNKS 0)
15
+ set(GEA_BOARD_EXTRA_REQUIRES esp_driver_ledc)
16
+ set(GEA_BOARD_EXTRA_COMPILE_DEFINITIONS
17
+ GEA_EMBEDDED_AXS15231B_PANEL=1
18
+ GEA_EMBEDDED_AXS15231B_BACKLIGHT_GPIO=6
19
+ GEA_BOARD_AXS15231B_INIT_HEADER="axs15231b_panel_init.h"
20
+ GEA_BOARD_HAS_SDMMC=1
21
+ GEA_EMBEDDED_DISPLAY_FULL_FRAME_TRANSFERS=1
22
+ )
23
+ set(GEA_BOARD_PLATFORM_SOURCES
24
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32-s3-touch-amoled-1.8/main/app_main.cpp"
25
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32-s3-touch-amoled-1.8/main/i2c.cpp"
26
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32-s3-touch-amoled-1.8/main/launcher_button.cpp"
27
+ "${CMAKE_CURRENT_LIST_DIR}/touch.cpp"
28
+ "${CMAKE_CURRENT_LIST_DIR}/platform_stubs.cpp"
29
+ "${GEA_CHIPS}/power/axp2101/axp2101.cpp"
30
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/chip_bindings/power/axp2101.cpp"
31
+ "${GEA_CHIPS}/displays/sh8601/sh8601.cpp"
32
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/display.cpp"
33
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/chip_bindings/displays/sh8601.cpp"
34
+ )
35
+ include("${CMAKE_CURRENT_LIST_DIR}/../../esp32-s3-touch-amoled-1.8/main/CMakeLists.txt")
@@ -0,0 +1,12 @@
1
+ menu "Gea Embedded"
2
+
3
+ config GEA_EMBEDDED_PRODUCTION_LOCKDOWN
4
+ bool "Production lockdown"
5
+ default n
6
+ help
7
+ Compile out Gea frame/perf logs, heap diagnostics, and the
8
+ diagnostics server for production firmware. Local development builds
9
+ should leave this disabled so serial monitor and VS Code launch
10
+ tasks show fps and diagnostic logs.
11
+
12
+ endmenu
@@ -0,0 +1,23 @@
1
+ # A managed dependency is a requirement of `main` the moment it is listed here,
2
+ # so gating only the REQUIRES leaves the component downloaded, configured and
3
+ # built. The `if:` rules keep each registry component tied to the capability
4
+ # whose source actually uses it. GEA_EMBEDDED_CAPABILITY_* comes from the gea
5
+ # CLI's app analysis; app_project.cmake defaults each to 1 before project() so a
6
+ # direct `idf.py` build keeps everything (and so the component manager never
7
+ # sees an unset variable, which it treats as an error).
8
+ #
9
+ # No esp_codec_dev: this board carries no audio codec.
10
+ dependencies:
11
+ espressif/esp_lcd_axs15231b: '^2.1.0'
12
+ # host/websocket.cpp
13
+ espressif/esp_websocket_client:
14
+ version: '^1.4'
15
+ rules:
16
+ - if: '$GEA_EMBEDDED_CAPABILITY_NETWORK == 1'
17
+ # host/rtc_esp.cpp -- the WebRTC peer, and libsrtp behind it
18
+ espressif/esp_peer:
19
+ version: '^1.4'
20
+ rules:
21
+ - if: '$GEA_EMBEDDED_CAPABILITY_NETWORK == 1'
22
+ idf:
23
+ version: '>=5.3'
@@ -0,0 +1,38 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ // Waveshare panel register data, adapted from:
3
+ // https://raw.githubusercontent.com/waveshareteam/ESP32-S3-Touch-LCD-3.5B/main/ESP-IDF/01_factory/components/esp_bsp/bsp_display.c
4
+ #pragma once
5
+ static const axs15231b_lcd_init_cmd_t kBoardAxsInitCommands[] = {
6
+ {0xBB, (uint8_t[]){0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5A, 0xA5}, 8, 0},
7
+ {0xA0, (uint8_t[]){0xC0, 0x10, 0x00, 0x02, 0x00, 0x00, 0x04, 0x3F, 0x20, 0x05, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00}, 17, 0},
8
+ {0xA2, (uint8_t[]){0x30, 0x3C, 0x24, 0x14, 0xD0, 0x20, 0xFF, 0xE0, 0x40, 0x19, 0x80, 0x80, 0x80, 0x20, 0xf9, 0x10, 0x02, 0xff, 0xff, 0xF0, 0x90, 0x01, 0x32, 0xA0, 0x91, 0xE0, 0x20, 0x7F, 0xFF, 0x00, 0x5A}, 31, 0},
9
+ {0xD0, (uint8_t[]){0xE0, 0x40, 0x51, 0x24, 0x08, 0x05, 0x10, 0x01, 0x20, 0x15, 0x42, 0xC2, 0x22, 0x22, 0xAA, 0x03, 0x10, 0x12, 0x60, 0x14, 0x1E, 0x51, 0x15, 0x00, 0x8A, 0x20, 0x00, 0x03, 0x3A, 0x12}, 30, 0},
10
+ {0xA3, (uint8_t[]){0xA0, 0x06, 0xAa, 0x00, 0x08, 0x02, 0x0A, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x55, 0x55}, 22, 0},
11
+ {0xC1, (uint8_t[]){0x31, 0x04, 0x02, 0x02, 0x71, 0x05, 0x24, 0x55, 0x02, 0x00, 0x41, 0x00, 0x53, 0xFF, 0xFF, 0xFF, 0x4F, 0x52, 0x00, 0x4F, 0x52, 0x00, 0x45, 0x3B, 0x0B, 0x02, 0x0d, 0x00, 0xFF, 0x40}, 30, 0},
12
+ {0xC3, (uint8_t[]){0x00, 0x00, 0x00, 0x50, 0x03, 0x00, 0x00, 0x00, 0x01, 0x80, 0x01}, 11, 0},
13
+ {0xC4, (uint8_t[]){0x00, 0x24, 0x33, 0x80, 0x00, 0xea, 0x64, 0x32, 0xC8, 0x64, 0xC8, 0x32, 0x90, 0x90, 0x11, 0x06, 0xDC, 0xFA, 0x00, 0x00, 0x80, 0xFE, 0x10, 0x10, 0x00, 0x0A, 0x0A, 0x44, 0x50}, 29, 0},
14
+ {0xC5, (uint8_t[]){0x18, 0x00, 0x00, 0x03, 0xFE, 0x3A, 0x4A, 0x20, 0x30, 0x10, 0x88, 0xDE, 0x0D, 0x08, 0x0F, 0x0F, 0x01, 0x3A, 0x4A, 0x20, 0x10, 0x10, 0x00}, 23, 0},
15
+ {0xC6, (uint8_t[]){0x05, 0x0A, 0x05, 0x0A, 0x00, 0xE0, 0x2E, 0x0B, 0x12, 0x22, 0x12, 0x22, 0x01, 0x03, 0x00, 0x3F, 0x6A, 0x18, 0xC8, 0x22}, 20, 0},
16
+ {0xC7, (uint8_t[]){0x50, 0x32, 0x28, 0x00, 0xa2, 0x80, 0x8f, 0x00, 0x80, 0xff, 0x07, 0x11, 0x9c, 0x67, 0xff, 0x24, 0x0c, 0x0d, 0x0e, 0x0f}, 20, 0},
17
+ {0xC9, (uint8_t[]){0x33, 0x44, 0x44, 0x01}, 4, 0},
18
+ {0xCF, (uint8_t[]){0x2C, 0x1E, 0x88, 0x58, 0x13, 0x18, 0x56, 0x18, 0x1E, 0x68, 0x88, 0x00, 0x65, 0x09, 0x22, 0xC4, 0x0C, 0x77, 0x22, 0x44, 0xAA, 0x55, 0x08, 0x08, 0x12, 0xA0, 0x08}, 27, 0},
19
+ {0xD5, (uint8_t[]){0x40, 0x8E, 0x8D, 0x01, 0x35, 0x04, 0x92, 0x74, 0x04, 0x92, 0x74, 0x04, 0x08, 0x6A, 0x04, 0x46, 0x03, 0x03, 0x03, 0x03, 0x82, 0x01, 0x03, 0x00, 0xE0, 0x51, 0xA1, 0x00, 0x00, 0x00}, 30, 0},
20
+ {0xD6, (uint8_t[]){0x10, 0x32, 0x54, 0x76, 0x98, 0xBA, 0xDC, 0xFE, 0x93, 0x00, 0x01, 0x83, 0x07, 0x07, 0x00, 0x07, 0x07, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x84, 0x00, 0x20, 0x01, 0x00}, 30, 0},
21
+ {0xD7, (uint8_t[]){0x03, 0x01, 0x0b, 0x09, 0x0f, 0x0d, 0x1E, 0x1F, 0x18, 0x1d, 0x1f, 0x19, 0x40, 0x8E, 0x04, 0x00, 0x20, 0xA0, 0x1F}, 19, 0},
22
+ {0xD8, (uint8_t[]){0x02, 0x00, 0x0a, 0x08, 0x0e, 0x0c, 0x1E, 0x1F, 0x18, 0x1d, 0x1f, 0x19}, 12, 0},
23
+ {0xD9, (uint8_t[]){0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F}, 12, 0},
24
+ {0xDD, (uint8_t[]){0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F}, 12, 0},
25
+ {0xDF, (uint8_t[]){0x44, 0x73, 0x4B, 0x69, 0x00, 0x0A, 0x02, 0x90}, 8, 0},
26
+ {0xE0, (uint8_t[]){0x3B, 0x28, 0x10, 0x16, 0x0c, 0x06, 0x11, 0x28, 0x5c, 0x21, 0x0D, 0x35, 0x13, 0x2C, 0x33, 0x28, 0x0D}, 17, 0},
27
+ {0xE1, (uint8_t[]){0x37, 0x28, 0x10, 0x16, 0x0b, 0x06, 0x11, 0x28, 0x5C, 0x21, 0x0D, 0x35, 0x14, 0x2C, 0x33, 0x28, 0x0F}, 17, 0},
28
+ {0xE2, (uint8_t[]){0x3B, 0x07, 0x12, 0x18, 0x0E, 0x0D, 0x17, 0x35, 0x44, 0x32, 0x0C, 0x14, 0x14, 0x36, 0x3A, 0x2F, 0x0D}, 17, 0},
29
+ {0xE3, (uint8_t[]){0x37, 0x07, 0x12, 0x18, 0x0E, 0x0D, 0x17, 0x35, 0x44, 0x32, 0x0C, 0x14, 0x14, 0x36, 0x32, 0x2F, 0x0F}, 17, 0},
30
+ {0xE4, (uint8_t[]){0x3B, 0x07, 0x12, 0x18, 0x0E, 0x0D, 0x17, 0x39, 0x44, 0x2E, 0x0C, 0x14, 0x14, 0x36, 0x3A, 0x2F, 0x0D}, 17, 0},
31
+ {0xE5, (uint8_t[]){0x37, 0x07, 0x12, 0x18, 0x0E, 0x0D, 0x17, 0x39, 0x44, 0x2E, 0x0C, 0x14, 0x14, 0x36, 0x3A, 0x2F, 0x0F}, 17, 0},
32
+ {0xA4, (uint8_t[]){0x85, 0x85, 0x95, 0x82, 0xAF, 0xAA, 0xAA, 0x80, 0x10, 0x30, 0x40, 0x40, 0x20, 0xFF, 0x60, 0x30}, 16, 0},
33
+ {0xA4, (uint8_t[]){0x85, 0x85, 0x95, 0x85}, 4, 0},
34
+ {0xBB, (uint8_t[]){0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 8, 0},
35
+ {0x13, (uint8_t[]){0x00}, 0, 0},
36
+ {0x11, (uint8_t[]){0x00}, 0, 120},
37
+ {0x2C, (uint8_t[]){0x00, 0x00, 0x00, 0x00}, 4, 0},
38
+ };
@@ -0,0 +1,23 @@
1
+ #pragma once
2
+ #include "driver/gpio.h"
3
+ #include "driver/spi_master.h"
4
+
5
+ // Waveshare ESP32-S3-Touch-LCD-3.5B, including the enclosed 3.5B-C.
6
+ // Pin assignments: vendor ESP-IDF/01_factory/components/esp_bsp.
7
+ namespace gea::platform::board {
8
+ struct I2cBusConfig { gpio_num_t sda, scl; };
9
+ struct QspiDisplayConfig {
10
+ spi_host_device_t spiHost;
11
+ gpio_num_t cs, pclk, data0, data1, data2, data3, reset, te;
12
+ };
13
+ struct TouchConfig { gpio_num_t reset, interrupt; };
14
+ struct SdMmcConfig { gpio_num_t clk, cmd, data0; };
15
+ struct LauncherButtonConfig { gpio_num_t pin; int activeLevel; };
16
+ inline constexpr I2cBusConfig i2c{GPIO_NUM_8, GPIO_NUM_7};
17
+ inline constexpr QspiDisplayConfig display{
18
+ SPI2_HOST, GPIO_NUM_12, GPIO_NUM_5, GPIO_NUM_1, GPIO_NUM_2,
19
+ GPIO_NUM_3, GPIO_NUM_4, GPIO_NUM_NC, GPIO_NUM_NC};
20
+ inline constexpr TouchConfig touch{GPIO_NUM_NC, GPIO_NUM_NC};
21
+ inline constexpr SdMmcConfig storage{GPIO_NUM_11, GPIO_NUM_10, GPIO_NUM_9};
22
+ inline constexpr LauncherButtonConfig launcherButton{GPIO_NUM_0, 0};
23
+ }
@@ -0,0 +1,41 @@
1
+ // Onboard codec and IMU are not exposed yet; USB audio is app-owned.
2
+ #include "imu.h"
3
+ #include "power.h"
4
+
5
+ #define GEA_AUDIO_DRIVER_INTERNAL 1
6
+ #include "audio.h"
7
+ #include "host/media.h"
8
+
9
+ namespace gea::platform::sensors {
10
+
11
+ void Accelerometer::init() {}
12
+ void Accelerometer::close() {}
13
+ void Accelerometer::calibrateBias() {}
14
+ int Accelerometer::tiltX() { return 0; }
15
+ int Accelerometer::tiltY() { return 0; }
16
+ double Accelerometer::accelerationX() { return 0.0; }
17
+ double Accelerometer::accelerationY() { return 0.0; }
18
+ double Accelerometer::accelerationZ() { return 1.0; }
19
+ double Accelerometer::gyroscopeX() { return 0.0; }
20
+ double Accelerometer::gyroscopeY() { return 0.0; }
21
+ double Accelerometer::gyroscopeZ() { return 0.0; }
22
+ void Accelerometer::setWebTilt(int, int) {}
23
+
24
+ } // namespace gea::platform::sensors
25
+
26
+ namespace gea::platform::audio {
27
+
28
+ bool OutputDriver::open(int, int, int) { return false; }
29
+ bool OutputDriver::write(const std::int16_t *, std::size_t, int) { return false; }
30
+ void OutputDriver::close() {}
31
+ int OutputDriver::volume() { return 0; }
32
+ void OutputDriver::setVolume(int) {}
33
+
34
+ } // namespace gea::platform::audio
35
+
36
+ namespace gea::host::media {
37
+
38
+ void platform_attach_track(NativeMediaTrackHandle) {}
39
+ void platform_detach_track(NativeMediaTrackHandle) {}
40
+
41
+ } // namespace gea::host::media
@@ -0,0 +1,194 @@
1
+ #include "board.h"
2
+ #include "i2c.h"
3
+ #include "touch.h"
4
+
5
+ #include <atomic>
6
+ #include <cstddef>
7
+ #include <cstdint>
8
+
9
+ #include "driver/gpio.h"
10
+ #include "driver/i2c_master.h"
11
+ #include "esp_attr.h"
12
+ #include "esp_check.h"
13
+ #include "esp_err.h"
14
+ #include "esp_log.h"
15
+ #include "freertos/FreeRTOS.h"
16
+ #include "freertos/task.h"
17
+
18
+ namespace {
19
+
20
+ using Phase = gea::platform::touch::Phase;
21
+ using Touchscreen = gea::platform::touch::Touchscreen;
22
+
23
+ constexpr char kTag[] = "axs15231b-touch";
24
+ constexpr std::uint8_t kAxs15231Address = 0x3b;
25
+ constexpr int kNativeWidth = 320;
26
+ constexpr int kNativeHeight = 480;
27
+ constexpr int kPollIntervalMs = 10;
28
+ #ifndef GEA_EMBEDDED_TOUCH_TASK_PRIORITY
29
+ #define GEA_EMBEDDED_TOUCH_TASK_PRIORITY 4
30
+ #endif
31
+ constexpr int kTaskPriority = GEA_EMBEDDED_TOUCH_TASK_PRIORITY;
32
+ constexpr std::uint32_t kTaskStackWords = 3072;
33
+
34
+ struct TouchSample {
35
+ bool touching = false;
36
+ int x = 0;
37
+ int y = 0;
38
+ };
39
+
40
+ struct HardwareSample {
41
+ bool valid = false;
42
+ TouchSample touch{};
43
+ };
44
+
45
+ Touchscreen::Observer gObserver = nullptr;
46
+ Touchscreen::PointerObserver gPointerObserver = nullptr;
47
+ i2c_master_dev_handle_t gDevice = nullptr;
48
+ TouchSample gCurrent{};
49
+ TouchSample gLatestMove{};
50
+ std::atomic<bool> gLatestMoveQueued{false};
51
+ TaskHandle_t gTask = nullptr;
52
+ StaticTask_t gTaskControlBlock{};
53
+ #if GEA_EMBEDDED_TOUCH_TASK_STACK_EXTERNAL
54
+ EXT_RAM_BSS_ATTR
55
+ #endif
56
+ StackType_t gTaskStack[kTaskStackWords]{};
57
+
58
+ void notify(Phase phase, const TouchSample &sample)
59
+ {
60
+ if (gPointerObserver) {
61
+ gPointerObserver(phase, sample.touching, sample.x, sample.y, 0);
62
+ } else if (gObserver) {
63
+ gObserver(phase, sample.touching, sample.x, sample.y);
64
+ }
65
+ }
66
+
67
+ void notifyMove(const TouchSample &sample)
68
+ {
69
+ gLatestMove = sample;
70
+ if (gLatestMoveQueued.exchange(true, std::memory_order_acq_rel)) return;
71
+ notify(Phase::Move, sample);
72
+ }
73
+
74
+ // AXS15231B has no wired interrupt/reset on this board. Poll both down and up.
75
+ HardwareSample readHardware()
76
+ {
77
+ static constexpr std::uint8_t command[] = {
78
+ 0xb5, 0xab, 0xa5, 0x5a, 0, 0, 0, 0x0e, 0, 0, 0};
79
+ std::uint8_t report[14]{};
80
+ // The controller's command and report are separate transfers, with a STOP
81
+ // between them (as in Espressif's AXS15231B driver).
82
+ if (i2c_master_transmit(gDevice, command, sizeof(command), 20) != ESP_OK ||
83
+ i2c_master_receive(gDevice, report, sizeof(report), 20) != ESP_OK) return {};
84
+ if (report[0] == 0xff || report[1] > 2) return {};
85
+ HardwareSample sample{.valid = true};
86
+ // A lift packet can retain the last point/count. Bits 7:6 are the event:
87
+ // 0 = down, 1 = up, 2 = contact, 3 = no event. Count alone leaves a lifted
88
+ // finger permanently pressed, triggering long holds and trapping captures.
89
+ const unsigned event = report[2] >> 6;
90
+ if (report[1] == 0 || event == 1 || event == 3) return sample;
91
+ sample.touch.x = ((report[2] & 0x0f) << 8) | report[3];
92
+ sample.touch.y = ((report[4] & 0x0f) << 8) | report[5];
93
+ if (sample.touch.x >= kNativeWidth || sample.touch.y >= kNativeHeight) return {};
94
+ sample.touch.touching = true;
95
+ return sample;
96
+ }
97
+
98
+ void pollLoop()
99
+ {
100
+ bool active = false;
101
+ while (true) {
102
+ vTaskDelay(pdMS_TO_TICKS(kPollIntervalMs));
103
+ const HardwareSample result = readHardware();
104
+ if (!result.valid) continue;
105
+
106
+ const TouchSample next = result.touch.touching
107
+ ? result.touch
108
+ : TouchSample{false, gCurrent.x, gCurrent.y};
109
+ if (next.touching && !active) {
110
+ gLatestMove = next;
111
+ notify(Phase::Down, next);
112
+ } else if (next.touching && active &&
113
+ (next.x != gCurrent.x || next.y != gCurrent.y)) {
114
+ notifyMove(next);
115
+ } else if (!next.touching && active) {
116
+ notify(Phase::Up, next);
117
+ }
118
+ gCurrent = next;
119
+ active = next.touching;
120
+ }
121
+ }
122
+
123
+ void taskEntry(void *)
124
+ {
125
+ pollLoop();
126
+ }
127
+
128
+ esp_err_t attachDevice(i2c_master_bus_handle_t bus)
129
+ {
130
+ ESP_RETURN_ON_ERROR(i2c_master_probe(bus, kAxs15231Address, 100), kTag, "touch probe");
131
+ i2c_device_config_t config{};
132
+ config.dev_addr_length = I2C_ADDR_BIT_LEN_7;
133
+ config.device_address = kAxs15231Address;
134
+ config.scl_speed_hz = 400000;
135
+ return i2c_master_bus_add_device(bus, &config, &gDevice);
136
+ }
137
+
138
+ esp_err_t startTask()
139
+ {
140
+ gTask = xTaskCreateStaticPinnedToCore(taskEntry, "axs15231b-touch", kTaskStackWords,
141
+ nullptr, kTaskPriority, gTaskStack, &gTaskControlBlock, 1);
142
+ return gTask ? ESP_OK : ESP_ERR_NO_MEM;
143
+ }
144
+
145
+ } // namespace
146
+
147
+ void gea::platform::touch::Touchscreen::setObserver(Observer observer)
148
+ {
149
+ gObserver = observer;
150
+ }
151
+
152
+ void gea::platform::touch::Touchscreen::setPointerObserver(PointerObserver observer)
153
+ {
154
+ gPointerObserver = observer;
155
+ }
156
+
157
+ bool gea::platform::touch::Touchscreen::init()
158
+ {
159
+ if (gTask) return true;
160
+ auto bus = gea::platform::i2c::Bus::primary();
161
+ if (!bus.available()) return false;
162
+
163
+ if (attachDevice(static_cast<i2c_master_bus_handle_t>(bus.nativeHandle())) != ESP_OK) return false;
164
+ if (startTask() != ESP_OK) return false;
165
+ ESP_LOGI(kTag, "Physical touch ready (polled)");
166
+ return true;
167
+ }
168
+
169
+ int gea::platform::touch::Touchscreen::read(int *x, int *y)
170
+ {
171
+ if (x) *x = gCurrent.x;
172
+ if (y) *y = gCurrent.y;
173
+ return gCurrent.touching ? 1 : 0;
174
+ }
175
+
176
+ int gea::platform::touch::Touchscreen::readCached(int *x, int *y)
177
+ {
178
+ return read(x, y);
179
+ }
180
+
181
+ void gea::platform::touch::Touchscreen::consumeLatestMove(int *x, int *y)
182
+ {
183
+ gLatestMoveQueued.store(false, std::memory_order_release);
184
+ if (x) *x = gLatestMove.x;
185
+ if (y) *y = gLatestMove.y;
186
+ }
187
+
188
+ void gea::platform::touch::Touchscreen::injectEvent(Phase phase, bool touching, int x, int y)
189
+ {
190
+ const TouchSample sample{touching, x, y};
191
+ gCurrent = sample;
192
+ if (phase == Phase::Move) notifyMove(sample);
193
+ else notify(phase, sample);
194
+ }
@@ -0,0 +1,7 @@
1
+ # Name, Type, SubType, Offset, Size
2
+ nvs,data,nvs,0x9000,0x6000
3
+ otadata,data,ota,0xf000,0x2000
4
+ phy_init,data,phy,0x11000,0x1000
5
+ ota_0,app,ota_0,0x20000,0x600000
6
+ ota_1,app,ota_1,0x620000,0x600000
7
+ storage,data,spiffs,0xc20000,0x3e0000
@@ -0,0 +1,273 @@
1
+ # Target: ESP32-S3
2
+ CONFIG_IDF_TARGET="esp32s3"
3
+
4
+ # Flash: 16 MB (Waveshare ESP32-S3-Touch-LCD-3.5B / 3.5B-C)
5
+ CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
6
+
7
+ # Allow bootloader cache-mapped reads from 32-bit SPI flash addresses. This is
8
+ # required for bootable app partitions above 16 MB on the board's DIO flash.
9
+ CONFIG_IDF_EXPERIMENTAL_FEATURES=y
10
+ CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y
11
+
12
+ # Console over USB Serial/JTAG (native USB-C on this board)
13
+ CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
14
+
15
+ # esp_codec_dev should share the existing new-driver I2C bus with touch/PMIC.
16
+ # CONFIG_CODEC_I2C_BACKWARD_COMPATIBLE is not set
17
+
18
+ # Disable secondary console to avoid duplicate output
19
+ CONFIG_ESP_CONSOLE_SECONDARY_NONE=y
20
+
21
+ # FreeRTOS tick rate — 1000 Hz gives 1 ms resolution for modMilliseconds
22
+ CONFIG_FREERTOS_HZ=1000
23
+
24
+ # Run the S3 at its full rated app CPU clock. Bouncing display workloads are
25
+ # otherwise CPU-bound before the 80 MHz QSPI flush finishes.
26
+ CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
27
+ CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240
28
+
29
+ # Main task stack for the app event loop. gea TSX frames can build deep
30
+ # reactive call chains before returning to the firmware loop.
31
+ CONFIG_ESP_MAIN_TASK_STACK_SIZE=32768
32
+ # The IPC task is per-core and its stack is internal DRAM, so 16384 cost 32 KiB of
33
+ # the scarcest memory on this board for tasks that only ever run ESP-IDF's own
34
+ # cross-core callbacks (intr_alloc is the single caller of esp_ipc_call_blocking
35
+ # in this firmware). IDF's default is 1024; 4096 keeps a 4x margin and hands ~24
36
+ # KiB back to the DMA-capable heap that the display staging and the WiFi RX
37
+ # frames were fighting over.
38
+ CONFIG_ESP_IPC_TASK_STACK_SIZE=4096
39
+
40
+ # Wi-Fi scan/connect callbacks run on ESP-IDF's system event task.
41
+ CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096
42
+
43
+ # Custom partition table with two OTA slots for wireless updates
44
+ CONFIG_PARTITION_TABLE_CUSTOM=y
45
+ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
46
+
47
+ # On panic: print backtrace then reboot. (Halting was meant to "keep USB alive
48
+ # for reflashing", but a halted ESP32-S3 won't accept an esptool reset — it has
49
+ # to be recovered over JTAG. Rebooting allows the firmware to remain
50
+ # reachable for diagnosis and reflashing.)
51
+ CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y
52
+
53
+ # Enable octal PSRAM for framebuffer
54
+ CONFIG_SPIRAM=y
55
+ CONFIG_SPIRAM_MODE_OCT=y
56
+ CONFIG_SPIRAM_SPEED_80M=y
57
+ CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y
58
+ CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM=y
59
+ CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
60
+ CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0
61
+ # IDF defaults this to 32 KiB when SPIRAM malloc is enabled. That creates a
62
+ # second DMA/internal heap by allocating a chunk from internal DRAM and
63
+ # re-registering it, which splits the physical heap map into a middle green
64
+ # reserve island. Keep internal memory globally allocatable; app/display code
65
+ # already asks for MALLOC_CAP_INTERNAL/MALLOC_CAP_DMA when it truly needs it.
66
+ CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=0
67
+
68
+ # Wi-Fi/LwIP memory budget: prefer lower throughput over internal DRAM pressure.
69
+ CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=8
70
+ CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=16
71
+ CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=4
72
+ CONFIG_ESP_WIFI_CACHE_TX_BUFFER_NUM=2
73
+ CONFIG_ESP_WIFI_MGMT_SBUF_NUM=16
74
+ CONFIG_ESP_WIFI_RX_BA_WIN=8
75
+ # RX-MGMT buffers DYNAMIC, not static. A RAM-tight app (maps: full-screen canvas
76
+ # + tile cache) leaves esp_wifi_init only ~11 KB internal DMA, but its STATIC
77
+ # esf_buf pool (static_rx 3 + rx_mgmt 5 + cache_tx 2 = 10 DMA-capable internal
78
+ # buffers) overflows it → esf_buf_setup_static NO_MEM → WiFi never comes up (no
79
+ # map tiles). Dynamic mgmt buffers leave the static pool and, with
80
+ # CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y above, allocate on demand from PSRAM.
81
+ # MUST be set here, not via the runtime wifi_init_config: flipping rx_mgmt_buf_type
82
+ # at runtime against a static-configured build asserts inside esp_wifi_init
83
+ # (panic/reboot loop). Doing it in sdkconfig keeps WIFI_INIT_CONFIG_DEFAULT consistent.
84
+ # CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER is not set
85
+ CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER=y
86
+ # CONFIG_ESP_WIFI_IRAM_OPT is not set
87
+ # Measured on this board, NOT worth it for OTA. Putting the WiFi RX path in IRAM
88
+ # does what it promises — the receive phase of a 3.8 MB image went from 277 KB/s
89
+ # to 488 KB/s, because RX keeps running through the cache-disabled windows that
90
+ # esp_ota_write opens. But the same live RX path then contends with the flash
91
+ # operation it is running alongside, and the write phase fell from 502 KB/s to
92
+ # 213 KB/s. End to end that is 116 KB/s against 133 KB/s, plus ~10 KB of internal
93
+ # DRAM. Left off deliberately; do not re-enable without re-measuring both phases.
94
+ # CONFIG_ESP_WIFI_RX_IRAM_OPT is not set
95
+ # Wi-Fi driver task: IDF 5.5/6.0 no longer exposes a public
96
+ # CONFIG_ESP_WIFI_TASK_STACK_SIZE knob. targets/esp32/connectivity/wifi.cpp
97
+ # wraps wifi_init_config_t.osi_funcs task creation and bumps the closed-source
98
+ # "wifi" task to 8192 bytes there.
99
+ CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=4096
100
+
101
+ # Allow lwIP to buffer out-of-sequence TCP segments. Without them a single dropped
102
+ # segment forces go-back-N retransmission of everything in flight, which (with RTO
103
+ # backoff 1.5+3+6+...s) turns one packet loss into a ~15s stall on an otherwise-fast
104
+ # link. 0 means UNCAPPED here, which is also IDF's own default whenever
105
+ # CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is set, because the pbufs then come from
106
+ # PSRAM and are only held while a gap actually exists. The previous cap of 8 was
107
+ # below the widened receive window, so a loss early in a 16-segment window could
108
+ # not be bridged: an OTA transfer was bimodal, either ~17 s or ~87 s for the same
109
+ # 3.9 MB image under identical conditions, with the slow mode sitting in RTO backoff.
110
+ CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=0
111
+
112
+ # Advertise selective acknowledgements. An OTA receiver drops frames every time
113
+ # esp_ota_write disables the flash cache, and without SACK the sender cannot tell
114
+ # which single segment went missing — it retransmits the whole window and backs
115
+ # off. This is the other half of the bimodal-throughput fix above.
116
+ CONFIG_LWIP_TCP_SACK_OUT=y
117
+
118
+ # TCP receive window. The IDF default of 5760 is four segments: an OTA image
119
+ # arrives through a receiver that has to stop and write to flash, and with a
120
+ # four-segment window the sender spends most of the transfer blocked waiting for
121
+ # a window update instead of keeping the link busy. Sixteen segments give the
122
+ # flash writes something to overlap with. The buffering behind the window is
123
+ # lwIP pbufs and WiFi dynamic RX frames, both of which prefer PSRAM here
124
+ # (CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP above), so this does not spend internal
125
+ # DRAM. 23040 stays under 65535, so no window scaling is required.
126
+ CONFIG_LWIP_TCP_WND_DEFAULT=23040
127
+ CONFIG_LWIP_TCP_RECVMBOX_SIZE=16
128
+
129
+ # Firmware uses STA mode for OTA/log/mirror; trim unused Wi-Fi/LwIP features.
130
+ # CONFIG_ESP_WIFI_SOFTAP_SUPPORT is not set
131
+ # CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT is not set
132
+ # CONFIG_ESP_WIFI_ENABLE_WPA3_SAE is not set
133
+ # CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA is not set
134
+ # CONFIG_LWIP_IPV6 is not set
135
+ # CONFIG_LWIP_DHCPS is not set
136
+
137
+ # Bluetooth: NimBLE dual-role for the BLE control surface. This board serves
138
+ # HID + BLE-MIDI as a peripheral AND hosts remote peripherals as a central
139
+ # (XPPen ACK05 macro pad, WIDI/pedal BLE-MIDI adapter) — 4 simultaneous links:
140
+ # desktop (our HID), DAW (our MIDI), XPPen, pedal.
141
+ CONFIG_BT_ENABLED=y
142
+ CONFIG_BT_NIMBLE_ENABLED=y
143
+ CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL=y
144
+ CONFIG_BT_NIMBLE_MAX_CONNECTIONS=4
145
+ CONFIG_BT_NIMBLE_ROLE_BROADCASTER=y
146
+ CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=y
147
+ CONFIG_BT_NIMBLE_ROLE_CENTRAL=y
148
+ CONFIG_BT_NIMBLE_ROLE_OBSERVER=y
149
+ CONFIG_BT_NIMBLE_SM_LEGACY=y
150
+ CONFIG_BT_NIMBLE_SM_SC=y
151
+ CONFIG_BT_NIMBLE_NVS_PERSIST=y
152
+ CONFIG_BT_NIMBLE_LOG_LEVEL_NONE=y
153
+
154
+ # Pin WiFi + BT controller + NimBLE host to core 1, leaving core 0 for the app
155
+ # frame/render task (GEA_EMBEDDED_APP_FRAME_TASK_CORE=0). IDF pins all of these
156
+ # to core 0 by default, where they contend with rendering: launching an app
157
+ # through the launcher dropped to ~22 fps because the per-chunk flush wait was
158
+ # preempted (19 ms vs 1.6 ms). Moving them to core 1 restores ~60 fps. Keep
159
+ # WiFi and BT on the SAME core for coexistence (ESP_COEX_SW_COEXIST_ENABLE).
160
+ CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_1=y
161
+ CONFIG_BT_CTRL_PINNED_TO_CORE_1=y
162
+ CONFIG_BT_NIMBLE_PINNED_TO_CORE_1=y
163
+
164
+ # WebRTC: mbedTLS DTLS + DTLS-SRTP for esp_peer
165
+ # Required by espressif/esp_peer (DTLS-SRTP handshake, DTLS cookies, MTU
166
+ # config). Off by default in IDF — turning them on costs ~30-40 kB of
167
+ # mbedTLS code but is non-negotiable for SRTP-protected RTP.
168
+ CONFIG_MBEDTLS_SSL_PROTO_DTLS=y
169
+ CONFIG_MBEDTLS_SSL_DTLS_SRTP=y
170
+ CONFIG_MBEDTLS_SSL_DTLS_HELLO_VERIFY=y
171
+ CONFIG_MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE=y
172
+ CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID=y
173
+ # esp_peer generates a self-signed DTLS cert at runtime via
174
+ # mbedtls_x509write_crt_*; those live behind MBEDTLS_X509_CREATE_C, which
175
+ # ESP-IDF 6.0 flipped to default-off (was implicitly available in 5.5). Without
176
+ # it esp_peer fails to link (implicit-declaration of mbedtls_x509write_crt_*).
177
+ CONFIG_MBEDTLS_X509_CREATE_C=y
178
+ CONFIG_MBEDTLS_X509_CRT_WRITE_C=y
179
+ CONFIG_MBEDTLS_X509_CSR_WRITE_C=y
180
+
181
+ # Allocate mbedTLS memory from PSRAM instead of internal DRAM. IDF defaults to
182
+ # INTERNAL_MEM_ALLOC, but internal RAM is scarce on this board (app + 2-deep
183
+ # flush pipeline + WiFi driver). A TLS handshake's PSA signature verification
184
+ # and 16 KB input buffer then fail to allocate, surfacing as the misleading
185
+ # "esp-x509-crt-bundle: Certificate matched but signature verification failed"
186
+ # with PSA error -141 (PSA_ERROR_INSUFFICIENT_MEMORY) — a heap shortage, not a
187
+ # trust failure. PSRAM has megabytes free; the hardware MPI/crypto path copies
188
+ # operands into the peripheral so PSRAM-resident TLS buffers are fine.
189
+ # CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC is not set
190
+ CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
191
+
192
+ # Run TLS crypto in SOFTWARE so it allocates from PSRAM (via EXTERNAL_MEM_ALLOC
193
+ # above) rather than DMA-capable internal SRAM. EXTERNAL_MEM_ALLOC moves the
194
+ # mbedTLS input/output buffers to PSRAM, but the ESP32-S3 SHA/MPI/AES hardware
195
+ # drivers bypass the mbedTLS allocator and demand MALLOC_CAP_DMA|MALLOC_CAP_INTERNAL
196
+ # scratch buffers (e.g. sha.c allocates a DMA buffer sized to the data being
197
+ # hashed). Once WiFi is up, internal 8-bit RAM is ~1 KB free, so those allocations
198
+ # fail mid-handshake — surfacing as mbedtls_ssl_setup -> MBEDTLS_ERR_SSL_ALLOC_FAILED
199
+ # (PSA -141) and ESP_ERR_HTTP_CONNECT on every HTTPS fetch. Software crypto keeps
200
+ # everything in PSRAM and is amply fast for the app's occasional small fetches.
201
+ # CONFIG_MBEDTLS_HARDWARE_SHA is not set
202
+ # CONFIG_MBEDTLS_HARDWARE_MPI is not set
203
+ # CONFIG_MBEDTLS_MPI_USE_INTERRUPT is not set
204
+ # CONFIG_MBEDTLS_HARDWARE_AES is not set
205
+
206
+ # Release optimization level. ESP-IDF defaults to -Og (DEBUG) which is
207
+ # friendly for debugging but leaves real perf on the table for compute-heavy
208
+ # code paths. -O2 (PERF) is the correct release setting.
209
+ CONFIG_COMPILER_OPTIMIZATION_PERF=y
210
+ # CONFIG_COMPILER_OPTIMIZATION_DEBUG is not set
211
+
212
+ # --- Development logging / diagnostics defaults ---
213
+ # VS Code launch tasks build per-app firmware under build/app-builds/<app>.
214
+ # Keep those dev builds chatty by default so serial monitor shows boot logs,
215
+ # gea.perf fps windows, frame scheduler diagnostics, and assertion failures.
216
+ # Production lockdown can still be enabled via menuconfig, but it is not the
217
+ # default for local flash/monitor iteration.
218
+ # CONFIG_GEA_EMBEDDED_PRODUCTION_LOCKDOWN is not set
219
+
220
+ # Runtime and bootloader logs visible on USB serial/JTAG.
221
+ # CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
222
+ CONFIG_LOG_DEFAULT_LEVEL_INFO=y
223
+ CONFIG_LOG_DEFAULT_LEVEL=3
224
+ CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
225
+ CONFIG_LOG_MAXIMUM_LEVEL=3
226
+
227
+ # Keep assertions enabled in local dev builds.
228
+ # CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set
229
+ CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
230
+ CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2
231
+ # geatsc lowers a program's `throw`/`try`/`catch` to real C++ exceptions, and
232
+ # its runtime header (`gea_runtime.h`, e.g. the regex cache's std::regex_error
233
+ # translation) contains typed catch handlers unconditionally. ESP-IDF's default
234
+ # stubs __cxa_throw to abort and compiles with -fno-exceptions, under which
235
+ # gcc rejects those handlers -- so no geatsc-generated app compiles for this
236
+ # board without exception support. The emergency pool stays 0: the cost is
237
+ # unwind tables in flash and ~500 B of heap on the first throw, nothing at rest.
238
+ CONFIG_COMPILER_CXX_EXCEPTIONS=y
239
+ CONFIG_COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE=0
240
+
241
+ # Keep early boot output visible too.
242
+ # CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set
243
+ CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
244
+ CONFIG_BOOTLOADER_LOG_LEVEL=3
245
+
246
+ # Diagnostic allocation attribution. Keep standalone heap tracing available for
247
+ # app-init fragmentation investigations; trace records are placed in PSRAM by
248
+ # the caller, and tracing remains idle unless explicitly started.
249
+ # Heap tracing costs about a kilobyte of IRAM (1,067 bytes measured on
250
+ # esp32-s3-touch-amoled-2.06) and puts a hook on the allocator's hot path. On the
251
+ # S3 that IRAM is not free space: the linker sizes .dram0.dummy to whatever IRAM
252
+ # the image used, so every byte of .iram0.text is a byte the internal heap never
253
+ # gets -- and the internal heap is what DMA, USB host enumeration and aligned
254
+ # coefficient banks come out of. The framework's only users, the display and
255
+ # AXP2101 init traces, are already gated on GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG,
256
+ # which defaults to 0. So nothing traced by default and every app paid for it.
257
+ # Turn this and that macro on together when you actually want a trace.
258
+ CONFIG_HEAP_TRACING_OFF=y
259
+ # CONFIG_HEAP_TRACING_STANDALONE is not set
260
+ # CONFIG_HEAP_TRACING_TOHOST is not set
261
+ # CONFIG_HEAP_TRACING is not set
262
+ # CONFIG_HEAP_TRACE_HASH_MAP is not set
263
+
264
+ # Instruction cache: the default 16 KB / 32-byte-line I-cache thrashes on
265
+ # frame loops that touch libm. Measured on bubble-grid: a Math.pow costs
266
+ # 25.4k cycles cold but 6.5k warm back-to-back, and Date.now 11.5k vs 4.1k --
267
+ # i.e. ~19k and ~7.4k cycles per frame are pure cold-flash refetch, because
268
+ # the rest of the frame evicts the routine before the next frame calls it.
269
+ # 32 KB holds more of the frame's working set. (S3's I-cache line size is
270
+ # 16B or 32B only -- there is no 64B option.) the gea CLI also enforces this
271
+ # on every build, because the generated sdkconfig is sticky and defaults only
272
+ # fill values that an existing build directory has not already frozen.
273
+ CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y
package/targets.json CHANGED
@@ -160,5 +160,13 @@
160
160
  "appPlatform": "esp32",
161
161
  "idfTarget": "esp32s3",
162
162
  "esptoolChip": "esp32s3"
163
+ },
164
+ "esp32-s3-touch-lcd-3.5b": {
165
+ "adapter": "esp32-idf",
166
+ "targetPath": "targets/esp32-s3-touch-lcd-3.5b",
167
+ "flashSize": "16MB",
168
+ "appPlatform": "esp32",
169
+ "idfTarget": "esp32s3",
170
+ "esptoolChip": "esp32s3"
163
171
  }
164
172
  }