@geastack/targets 0.1.89 → 0.1.90

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.
Files changed (25) hide show
  1. package/build-config.json +32 -0
  2. package/package.json +2 -2
  3. package/targets/cmake/geatsc_generated_archive.cmake +18 -2
  4. package/targets/esp32/chip_bindings/audio/es8311.cpp +10 -1
  5. package/targets/esp32/chip_bindings/displays/co5300.cpp +40 -0
  6. package/targets/esp32/chip_bindings/imu/bmi270.cpp +6 -1
  7. package/targets/esp32/display.cpp +15 -0
  8. package/targets/esp32/services/audio_runtime_stub.cpp +2 -0
  9. package/targets/esp32-s3-epaper-1.54/main/CMakeLists.txt +15 -5
  10. package/targets/esp32-s3-touch-amoled-1.8/main/CMakeLists.txt +5 -1
  11. package/targets/esp32-s3-touch-amoled-1.8/main/launcher_button.cpp +6 -1
  12. package/targets/esp32-s31-espressif-mosaico/CMakeLists.txt +10 -0
  13. package/targets/esp32-s31-espressif-mosaico/README.md +56 -0
  14. package/targets/esp32-s31-espressif-mosaico/dependencies.lock +137 -0
  15. package/targets/esp32-s31-espressif-mosaico/main/CMakeLists.txt +63 -0
  16. package/targets/esp32-s31-espressif-mosaico/main/Kconfig.projbuild +12 -0
  17. package/targets/esp32-s31-espressif-mosaico/main/board_power.cpp +386 -0
  18. package/targets/esp32-s31-espressif-mosaico/main/idf_component.yml +36 -0
  19. package/targets/esp32-s31-espressif-mosaico/main/include/board.h +147 -0
  20. package/targets/esp32-s31-espressif-mosaico/main/include/wifi_config.h.example +5 -0
  21. package/targets/esp32-s31-espressif-mosaico/main/touch.cpp +45 -0
  22. package/targets/esp32-s31-espressif-mosaico/partitions.csv +10 -0
  23. package/targets/esp32-s31-espressif-mosaico/sdkconfig.defaults +194 -0
  24. package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_gea_platform.cpp +3 -0
  25. package/targets.json +12 -0
package/build-config.json CHANGED
@@ -516,6 +516,38 @@
516
516
  false
517
517
  ]
518
518
  }
519
+ },
520
+ "esp32-s31-espressif-mosaico": {
521
+ "supported": [
522
+ "compiler.generatedCodeOptimization",
523
+ "renderer.fuseReplayFlush",
524
+ "renderer.adaptiveCoalescing",
525
+ "renderer.broadDirtyBounds",
526
+ "display.framebufferStream",
527
+ "display.presentStream"
528
+ ],
529
+ "defaults": {
530
+ "compiler": {
531
+ "generatedCodeOptimization": "O2",
532
+ "numberPrecision": "float32"
533
+ },
534
+ "renderer": {
535
+ "fuseReplayFlush": false,
536
+ "subtreeRevealChecks": true,
537
+ "recordInlinePositions": true,
538
+ "adaptiveCoalescing": true,
539
+ "broadDirtyBounds": true
540
+ },
541
+ "display": {
542
+ "framebufferStream": "continuous",
543
+ "presentStream": "continuous"
544
+ },
545
+ "diagnostics": {
546
+ "performanceCounters": false,
547
+ "frameTiming": false
548
+ }
549
+ },
550
+ "cssDevicePixelRatio": 1.5
519
551
  }
520
552
  }
521
553
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geastack/targets",
3
- "version": "0.1.89",
3
+ "version": "0.1.90",
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": {
@@ -43,7 +43,7 @@
43
43
  "@geastack/engine": "^0.1.9",
44
44
  "@geastack/geaos": "^0.1.3",
45
45
  "@geastack/geatsc-plugin-gea": "^0.1.15",
46
- "@geastack/host": "^0.1.13"
46
+ "@geastack/host": "^0.1.14"
47
47
  },
48
48
  "scripts": {
49
49
  "test": "for f in $(git ls-files | grep -E '(^|/)(test[-_][^/]*|[^/]*\\.test)\\.mjs$'); do echo \"==> $f\"; node \"$f\" || exit 1; done"
@@ -88,6 +88,22 @@ function(gea_geatsc_add_generated_archive)
88
88
  # forward the launcher explicitly to retain clean-build cache hits.
89
89
  get_property(_compiler_launcher GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
90
90
 
91
+ # The archive builder runs outside CMake's rules, so a tool CMake knows only
92
+ # by name would be looked up relative to the build directory. IDF 6.2's
93
+ # RISC-V toolchain file sets CMAKE_AR/CMAKE_RANLIB to bare names
94
+ # (riscv32-esp-elf-gcc-ar); resolve them beside the compiler, then on PATH.
95
+ get_filename_component(_compiler_dir "${CMAKE_CXX_COMPILER}" DIRECTORY)
96
+ foreach(_tool IN ITEMS AR RANLIB)
97
+ set(_tool_path "${CMAKE_${_tool}}")
98
+ if(_tool_path AND NOT IS_ABSOLUTE "${_tool_path}")
99
+ find_program(_resolved_${_tool} NAMES "${_tool_path}" HINTS "${_compiler_dir}" NO_CACHE)
100
+ if(_resolved_${_tool})
101
+ set(_tool_path "${_resolved_${_tool}}")
102
+ endif()
103
+ endif()
104
+ set(_geatsc_${_tool} "${_tool_path}")
105
+ endforeach()
106
+
91
107
  add_custom_command(
92
108
  OUTPUT "${GEA_GEATSC_OUTPUT}"
93
109
  COMMAND "${CMAKE_COMMAND}"
@@ -98,8 +114,8 @@ function(gea_geatsc_add_generated_archive)
98
114
  "-DGEA_GEATSC_FLAGS_FILE=${_flags_file}"
99
115
  "-DGEA_GEATSC_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
100
116
  "-DGEA_GEATSC_COMPILER_LAUNCHER=${_compiler_launcher}"
101
- "-DGEA_GEATSC_AR=${CMAKE_AR}"
102
- "-DGEA_GEATSC_RANLIB=${CMAKE_RANLIB}"
117
+ "-DGEA_GEATSC_AR=${_geatsc_AR}"
118
+ "-DGEA_GEATSC_RANLIB=${_geatsc_RANLIB}"
103
119
  -P "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/geatsc_generated_archive_build.cmake"
104
120
  DEPENDS
105
121
  ${GEA_GEATSC_DEPENDS}
@@ -86,6 +86,15 @@ esp_err_t setAmplifierEnabled(bool enabled) {
86
86
 
87
87
  constexpr int kCodecDataPort = 0;
88
88
 
89
+ // esp_codec_dev takes the 8-bit address. CE low answers at 7-bit 0x18, the
90
+ // component default; a board that straps CE high (the ESP-Mosaico, 0x19)
91
+ // names its 7-bit address with GEA_BOARD_ES8311_I2C_ADDRESS.
92
+ #ifdef GEA_BOARD_ES8311_I2C_ADDRESS
93
+ constexpr std::uint8_t kCodecI2cAddress = static_cast<std::uint8_t>(GEA_BOARD_ES8311_I2C_ADDRESS << 1);
94
+ #else
95
+ constexpr std::uint8_t kCodecI2cAddress = ES8311_CODEC_DEFAULT_ADDR;
96
+ #endif
97
+
89
98
  // Boards whose microphones sit on an ES7210 ADC sharing this I2S bus (Waveshare AMOLED 2.06) name its
90
99
  // 7-bit I2C address as `audio.es7210Address`; everywhere else the ES8311's own ADC records.
91
100
  template <typename AudioConfig>
@@ -647,7 +656,7 @@ private:
647
656
  }
648
657
 
649
658
  audio_codec_i2c_cfg_t i2cConfig = {};
650
- i2cConfig.addr = ES8311_CODEC_DEFAULT_ADDR;
659
+ i2cConfig.addr = kCodecI2cAddress;
651
660
  i2cConfig.bus_handle = static_cast<i2c_master_bus_handle_t>(i2cBus.nativeHandle());
652
661
  i2cCtrlIf_ = audio_codec_new_i2c_ctrl(&i2cConfig);
653
662
  if (!i2cCtrlIf_) return ESP_ERR_NO_MEM;
@@ -69,6 +69,42 @@ namespace gea::platform::esp32::chip_bindings::co5300
69
69
  };
70
70
  #endif
71
71
 
72
+ #if GEA_EMBEDDED_CO5300_MOSAICO_INIT
73
+ // ESP-Mosaico 480x480 panel, transcribed from the board's own BSP
74
+ // (esp-mosaico-bsp components/esp-mosaico-bsp/onboard/display.c,
75
+ // s_vendor_init). Sleep Out comes first here, unlike the Waveshare 1.75
76
+ // sequence, and the window spans the full 480 columns with no gap.
77
+ static const std::uint8_t kMosaicoFe20[] = {0x20};
78
+ static const std::uint8_t kMosaico19[] = {0x10};
79
+ static const std::uint8_t kMosaico1c[] = {0xA0};
80
+ static const std::uint8_t kMosaicoFe00[] = {0x00};
81
+ static const std::uint8_t kMosaicoC4[] = {0x80};
82
+ static const std::uint8_t kMosaico3a[] = {0x55};
83
+ static const std::uint8_t kMosaico35[] = {0x00};
84
+ static const std::uint8_t kMosaico53[] = {0x20};
85
+ static const std::uint8_t kMosaico51[] = {0xFF};
86
+ static const std::uint8_t kMosaico63[] = {0xFF};
87
+ static const std::uint8_t kMosaico2a[] = {0x00, 0x00, 0x01, 0xDF};
88
+ static const std::uint8_t kMosaico2b[] = {0x00, 0x00, 0x01, 0xDF};
89
+
90
+ static const co5300_lcd_init_cmd_t kMosaicoInitCommands[] = {
91
+ {0x11, nullptr, 0, 600},
92
+ {0xFE, kMosaicoFe20, sizeof(kMosaicoFe20), 0},
93
+ {0x19, kMosaico19, sizeof(kMosaico19), 0},
94
+ {0x1C, kMosaico1c, sizeof(kMosaico1c), 0},
95
+ {0xFE, kMosaicoFe00, sizeof(kMosaicoFe00), 0},
96
+ {0xC4, kMosaicoC4, sizeof(kMosaicoC4), 0},
97
+ {0x3A, kMosaico3a, sizeof(kMosaico3a), 0},
98
+ {0x35, kMosaico35, sizeof(kMosaico35), 0},
99
+ {0x53, kMosaico53, sizeof(kMosaico53), 0},
100
+ {0x51, kMosaico51, sizeof(kMosaico51), 0},
101
+ {0x63, kMosaico63, sizeof(kMosaico63), 0},
102
+ {0x2A, kMosaico2a, sizeof(kMosaico2a), 0},
103
+ {0x2B, kMosaico2b, sizeof(kMosaico2b), 0},
104
+ {0x29, nullptr, 0, 600},
105
+ };
106
+ #endif
107
+
72
108
  esp_lcd_panel_handle_t panelHandle(void *panel)
73
109
  {
74
110
  return static_cast<esp_lcd_panel_handle_t>(panel);
@@ -246,6 +282,10 @@ namespace gea::platform::esp32::chip_bindings::co5300
246
282
  #if GEA_EMBEDDED_CO5300_WAVESHARE_175_INIT
247
283
  vendorConfig.init_cmds = kWaveshare175InitCommands;
248
284
  vendorConfig.init_cmds_size = sizeof(kWaveshare175InitCommands) / sizeof(kWaveshare175InitCommands[0]);
285
+ #endif
286
+ #if GEA_EMBEDDED_CO5300_MOSAICO_INIT
287
+ vendorConfig.init_cmds = kMosaicoInitCommands;
288
+ vendorConfig.init_cmds_size = sizeof(kMosaicoInitCommands) / sizeof(kMosaicoInitCommands[0]);
249
289
  #endif
250
290
  vendorConfig.flags.use_qspi_interface = 1;
251
291
 
@@ -30,7 +30,12 @@ namespace {
30
30
  #include "bmi270_config.inl" // static constexpr const uint8_t bmi270_config_file[8192]
31
31
 
32
32
  constexpr char kTag[] = "bmi270";
33
- constexpr std::uint8_t kI2cAddress = 0x68;
33
+ // SDO strapped low gives 0x68 (M5StickC S3); boards that strap it high (the
34
+ // ESP-Mosaico) answer at 0x69 and say so with GEA_BOARD_BMI270_I2C_ADDRESS.
35
+ #ifndef GEA_BOARD_BMI270_I2C_ADDRESS
36
+ #define GEA_BOARD_BMI270_I2C_ADDRESS 0x68
37
+ #endif
38
+ constexpr std::uint8_t kI2cAddress = GEA_BOARD_BMI270_I2C_ADDRESS;
34
39
  constexpr std::uint32_t kI2cFrequencyHz = 400000;
35
40
  constexpr int kI2cTimeoutMs = 100;
36
41
  constexpr int64_t kRetryIntervalUs = 5000000;
@@ -27,6 +27,8 @@
27
27
  #endif
28
28
  #include "esp_err.h"
29
29
  #include "esp_heap_caps.h"
30
+ // esp_ptr_external_ram/esp_ptr_dma_capable; reached transitively on Xtensa only.
31
+ #include "esp_memory_utils.h"
30
32
  #if GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG && CONFIG_HEAP_TRACING_STANDALONE
31
33
  #include "esp_attr.h"
32
34
  #include "esp_heap_trace.h"
@@ -5261,6 +5263,16 @@ extern "C" std::uint16_t *gea_bg_cache(int *cap_px)
5261
5263
  return buffer;
5262
5264
  }
5263
5265
 
5266
+ // The S3's PIE vector unit is Xtensa-only. On every other chip these kernels
5267
+ // are absent and render.cpp's weak fallbacks report them unavailable, so the
5268
+ // renderer takes its scalar paths.
5269
+ #if CONFIG_IDF_TARGET_ESP32S3
5270
+ #define GEA_DISPLAY_HAS_PIE 1
5271
+ #else
5272
+ #define GEA_DISPLAY_HAS_PIE 0
5273
+ #endif
5274
+
5275
+ #if GEA_DISPLAY_HAS_PIE
5264
5276
  // ── PIE/SIMD throughput probe ──────────────────────────────────────────────
5265
5277
  // Decisive question before investing in a full RGB565 blend kernel: does the S3
5266
5278
  // PIE actually deliver multiply-add throughput over a PSRAM buffer (the per-pixel
@@ -5394,6 +5406,7 @@ static void pieBlendSpan8(std::uint16_t *dst, const std::uint16_t *fgN, const st
5394
5406
  : [cb] "r"(cb2)
5395
5407
  : "memory");
5396
5408
  }
5409
+ #endif // GEA_DISPLAY_HAS_PIE
5397
5410
 
5398
5411
  // ── face-drawer hooks (consumed by render.cpp via weak symbols) ──────────────
5399
5412
  // The PIE vector regs aren't preserved across FreeRTOS context switches, so a
@@ -5430,6 +5443,7 @@ extern "C" void *gea_render_fast_scratch(int bytes, int align)
5430
5443
  return p;
5431
5444
  }
5432
5445
 
5446
+ #if GEA_DISPLAY_HAS_PIE
5433
5447
  extern "C" bool gea_pie_blend_available() { return true; }
5434
5448
  extern "C" void gea_pie_blend_span8(std::uint16_t *dst, const std::uint16_t *fgN, const std::int16_t *a5, int count8)
5435
5449
  {
@@ -5835,6 +5849,7 @@ extern "C" void gea_pie_bench()
5835
5849
  heap_caps_free(b);
5836
5850
  heap_caps_free(ref);
5837
5851
  }
5852
+ #endif // GEA_DISPLAY_HAS_PIE
5838
5853
 
5839
5854
  // Full-screen PSRAM scratch for the static-backdrop cache (bg gradient + stage +
5840
5855
  // dithered floor baked once). Separate from gea_bg_cache so the Phase-1 gradient
@@ -84,3 +84,5 @@ void audio::AudioSystem::setVolume(int value)
84
84
  bool audio::AudioSystem::playFile(const std::string &) { return false; }
85
85
  bool audio::AudioSystem::playPcm(const std::int16_t *, std::size_t, int, int) { return false; }
86
86
  void audio::AudioSystem::stopPlayback() {}
87
+ // Audio is compiled out here, so nothing is ever queued to flush.
88
+ void audio::AudioSystem::flushPlayback() {}
@@ -504,6 +504,21 @@ if(TARGET idf::fatfs)
504
504
  "SHELL:-include ${CMAKE_CURRENT_LIST_DIR}/fatfs_ffconf.h")
505
505
  endif()
506
506
 
507
+ # Board id as a C string for app native sources (e.g. the diagnostics
508
+ # deviceInfo facade keys its capability catalog off deviceId()). Without this
509
+ # the facade's #ifndef fallback returns "unknown" and every subsystem shows up
510
+ # absent/N/A. gea_framework.cmake already defines GEA_EMBEDDED_CPP_BOARD bare
511
+ # for the whole build (the runtime's board pool layout tests only that it is
512
+ # defined), so the id REPLACES that build-wide define rather than adding a
513
+ # second, conflicting one beside it: every component still agrees on the pool
514
+ # layout, and the framework sources stop failing with "redefined" -Werror.
515
+ if(COMMAND idf_build_get_property)
516
+ idf_build_get_property(_GEA_BUILD_DEFINES COMPILE_DEFINITIONS)
517
+ list(REMOVE_ITEM _GEA_BUILD_DEFINES "GEA_EMBEDDED_CPP_BOARD")
518
+ list(APPEND _GEA_BUILD_DEFINES "GEA_EMBEDDED_CPP_BOARD=\"${GEA_EMBEDDED_CPP_BOARD}\"")
519
+ idf_build_set_property(COMPILE_DEFINITIONS "${_GEA_BUILD_DEFINES}")
520
+ endif()
521
+
507
522
  set(GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG_VALUE 0)
508
523
  if(DEFINED ENV{GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG})
509
524
  set(GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG_VALUE "$ENV{GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG}")
@@ -519,11 +534,6 @@ target_compile_definitions(${COMPONENT_LIB} PRIVATE
519
534
  # 1-bit panels (epaper family default): stylesheets can theme via
520
535
  # `@media (monochrome)`. Color boards reusing this definition set 0.
521
536
  GEA_EMBEDDED_DISPLAY_MONOCHROME=${GEA_EMBEDDED_TARGET_DISPLAY_MONOCHROME}
522
- # Board id as a C string for app native sources (e.g. the diagnostics
523
- # deviceInfo facade keys its capability catalog off deviceId()). Without this
524
- # the facade's #ifndef fallback returns "unknown" and every subsystem shows
525
- # up absent/N/A.
526
- GEA_EMBEDDED_CPP_BOARD=\"${GEA_EMBEDDED_CPP_BOARD}\"
527
537
  GEA_CPP_ENABLE_REGEX=0
528
538
  GEA_CPP_USE_TO_CHARS_DOUBLE=0
529
539
  GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG=${GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG_VALUE}
@@ -307,7 +307,9 @@ set(GEATSC_COMPILE_OPTIONS
307
307
  -Wno-dangling-reference
308
308
  -Wno-dangling-pointer
309
309
  -${GEA_BUILD_COMPILER_GENERATED_CODE_OPTIMIZATION}
310
- -mtext-section-literals
310
+ # Xtensa only (gea_framework.cmake); a RISC-V board on this base (the
311
+ # ESP32-S31 Mosaico) has no such option and gcc refuses the whole archive.
312
+ ${GEA_XTENSA_LITERALS}
311
313
  )
312
314
  set(GEATSC_COMPILE_DEFINITIONS "")
313
315
  if(NOT CMAKE_SCRIPT_MODE_FILE)
@@ -499,6 +501,8 @@ idf_component_register(
499
501
  esp_netif
500
502
  esp_event
501
503
  nvs_flash
504
+ # storage_service.cpp mounts the storage partition (esp_spiffs.h).
505
+ spiffs
502
506
  esp_lcd
503
507
  driver
504
508
  esp_driver_i2c
@@ -19,7 +19,12 @@ namespace gea::platform::esp32::apps {
19
19
  namespace {
20
20
 
21
21
  constexpr const char *kTag = "launcher_button";
22
- constexpr gpio_num_t kGpio = GPIO_NUM_0;
22
+ // BOOT/GPIO0 on the S3 boards. A board whose GPIO0 is something else (on the
23
+ // ESP-Mosaico it is the expansion I2C bus) names its button pin instead.
24
+ #ifndef GEA_BOARD_LAUNCHER_BUTTON_GPIO
25
+ #define GEA_BOARD_LAUNCHER_BUTTON_GPIO 0
26
+ #endif
27
+ constexpr gpio_num_t kGpio = static_cast<gpio_num_t>(GEA_BOARD_LAUNCHER_BUTTON_GPIO);
23
28
  constexpr int kActiveLevel = 0;
24
29
  constexpr int kDebounceMs = 50;
25
30
  constexpr int kPollMs = 25;
@@ -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,56 @@
1
+ # Espressif ESP-Mosaico
2
+
3
+ Target ID: `esp32-s31-espressif-mosaico`. Select **Espressif ESP-Mosaico
4
+ (V1.2)** in `gea setup`; the suggested board alias is `mosaico`.
5
+
6
+ This target supports hardware **V1.2** (V1.1 shares the pin mapping). The board
7
+ is an ESP32-S31 (dual-core RISC-V at 320 MHz) with 16 MB in-package octal
8
+ PSRAM, 16 MB quad NOR flash, a 480x480 CO5300 QSPI AMOLED with CST92xx touch,
9
+ an ES8311 codec with NS4150B amplifier, a BMI270 IMU, two BMM150
10
+ magnetometers, a BQ27220 fuel gauge and 128 MB SPI NAND. V1.0 swaps the LCD
11
+ clock and reset lines and moves the onboard I2C bus, so it is not supported.
12
+
13
+ Pins come from Espressif's board support package
14
+ ([esp-mosaico-bsp](https://github.com/esp-mosaico/esp-mosaico-bsp)) and the
15
+ V1.2 user guide; see `main/include/board.h`.
16
+
17
+ ## Toolchain
18
+
19
+ The ESP32-S31 exists only in ESP-IDF master (6.2-dev, a preview target).
20
+ `targets.json` pins this target to `idfVersion: "6.2"`, so the CLI selects an
21
+ installed ESP-IDF 6.2 checkout for it, and keeps the newest stable install for
22
+ every other board. Install one next to your other IDF versions, for example
23
+ `~/esp32/esp-idf-v6.2-dev`, with `./install.sh esp32s31`.
24
+
25
+ ## Flashing
26
+
27
+ From an application directory:
28
+
29
+ ```sh
30
+ gea build --board mosaico
31
+ gea flash --board mosaico
32
+ ```
33
+
34
+ The USB-C port is the S31's high-speed USB OTG controller. It has no
35
+ DTR/RTS reset circuit, and V1.2 ships with automatic download mode disabled,
36
+ so the target flashes in manual boot mode (`manualBoot: true`): **hold BOOT
37
+ while power-cycling the board** (or pressing reset) to enter the ROM loader,
38
+ then run `gea flash`.
39
+
40
+ ## Console
41
+
42
+ There is no ROM console on the USB-C port. The firmware brings up a TinyUSB
43
+ CDC-ACM interface and routes the console through it. Its USB serial number is
44
+ the chip MAC in the `AA:BB:CC:DD:EE:FF` form the S3 boards report, so register
45
+ the board by that serial and `--board mosaico` resolves the port the usual way.
46
+ UART0 keeps early boot output.
47
+
48
+ ## Board bring-up
49
+
50
+ Everything on the panel side is behind VCC_3V3, a high-side switch enabled by
51
+ GPIO60 (active low). `main/board_power.cpp` soft-starts it through an LEDC
52
+ fade, as the BSP does, and releases the PWR_SW power-off request on GPIO57
53
+ before display init touches the panel.
54
+
55
+ Not yet wired: the BQ27220 fuel gauge (the board reports no battery reading),
56
+ the panel's TE line on GPIO43, the magnetometers and the SPI NAND.
@@ -0,0 +1,137 @@
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_codec_dev:
13
+ component_hash: 4779f31a3ba3f9b38aee1afe6ccb9ba8f6108dc3a6e77d39d7d714e9a215371b
14
+ dependencies:
15
+ - name: idf
16
+ require: private
17
+ version: '>=4.0'
18
+ source:
19
+ registry_url: https://components.espressif.com/
20
+ type: service
21
+ version: 1.6.2
22
+ espressif/esp_io_expander:
23
+ component_hash: 7b7f91270172e46ca4597e3874f48d8412e280e8c295559f5922ec38656e3e5f
24
+ dependencies:
25
+ - name: idf
26
+ require: private
27
+ version: '>=4.4.2'
28
+ source:
29
+ registry_url: https://components.espressif.com
30
+ type: service
31
+ version: 1.2.1
32
+ espressif/esp_lcd_co5300:
33
+ component_hash: 1a5cbaa0069c3c72c238e5a1eb32ec9dd390ec1c7c46b24bf44b9037f2fe6c56
34
+ dependencies:
35
+ - name: espressif/cmake_utilities
36
+ registry_url: https://components.espressif.com
37
+ require: private
38
+ version: 0.*
39
+ - name: idf
40
+ require: private
41
+ version: '>=5.4'
42
+ source:
43
+ registry_url: https://components.espressif.com/
44
+ type: service
45
+ version: 2.2.0
46
+ espressif/esp_lcd_panel_io_additions:
47
+ component_hash: 1856c8b2c11aaa8a9fd67481582162bcad25f7064661a995f35c2ee8dd10ebcc
48
+ dependencies:
49
+ - name: espressif/cmake_utilities
50
+ registry_url: https://components.espressif.com
51
+ require: private
52
+ version: 0.*
53
+ - name: espressif/esp_io_expander
54
+ registry_url: https://components.espressif.com
55
+ require: public
56
+ version: ^1
57
+ - name: idf
58
+ require: private
59
+ version: '>=4.4.2'
60
+ source:
61
+ registry_url: https://components.espressif.com/
62
+ type: service
63
+ version: 1.0.1~1
64
+ espressif/esp_lcd_touch:
65
+ component_hash: 3f85a7d95af876f1a6ecca8eb90a81614890d0f03a038390804e5a77e2caf862
66
+ dependencies:
67
+ - name: idf
68
+ require: private
69
+ version: '>=4.4.2'
70
+ source:
71
+ registry_url: https://components.espressif.com
72
+ type: service
73
+ version: 1.2.1
74
+ espressif/esp_tinyusb:
75
+ component_hash: 0fab24246e07bdf919c6489d17a590cffbffbbf6a9c44d6235641645c8b946b7
76
+ dependencies:
77
+ - name: idf
78
+ require: private
79
+ version: '>=5.0'
80
+ - name: espressif/tinyusb
81
+ registry_url: https://components.espressif.com
82
+ require: public
83
+ version: '>=0.17.0~2'
84
+ source:
85
+ registry_url: https://components.espressif.com/
86
+ type: service
87
+ targets:
88
+ - esp32s2
89
+ - esp32s3
90
+ - esp32p4
91
+ - esp32h4
92
+ - esp32s31
93
+ version: 2.3.0
94
+ espressif/tinyusb:
95
+ component_hash: 16c8d774dab1f484d3e0c0f61105624d2424bbae864efd19818baf7b451b41e7
96
+ dependencies:
97
+ - name: idf
98
+ require: private
99
+ version: '>=5.0'
100
+ source:
101
+ registry_url: https://components.espressif.com
102
+ type: service
103
+ targets:
104
+ - esp32s2
105
+ - esp32s3
106
+ - esp32p4
107
+ - esp32h4
108
+ - esp32s31
109
+ version: 0.21.0~2
110
+ idf:
111
+ source:
112
+ type: idf
113
+ version: 6.2.0
114
+ waveshare/esp_lcd_touch_cst9217:
115
+ component_hash: 27a00845832b7987cacf4c4125cbed5415d940987583065b01870ac080930856
116
+ dependencies:
117
+ - name: espressif/esp_lcd_touch
118
+ registry_url: https://components.espressif.com
119
+ require: public
120
+ version: ^1.1.0
121
+ - name: idf
122
+ require: private
123
+ version: '>=4.4.2'
124
+ source:
125
+ registry_url: https://components.espressif.com/
126
+ type: service
127
+ version: 1.0.4
128
+ direct_dependencies:
129
+ - espressif/esp_codec_dev
130
+ - espressif/esp_lcd_co5300
131
+ - espressif/esp_lcd_panel_io_additions
132
+ - espressif/esp_tinyusb
133
+ - idf
134
+ - waveshare/esp_lcd_touch_cst9217
135
+ manifest_hash: d00ef0d696c011ff4e97bae2f217371293df338c57deca4f5e143663d8e1a2fe
136
+ target: esp32s31
137
+ version: 3.0.0
@@ -0,0 +1,63 @@
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-s31-espressif-mosaico")
4
+ set(GEA_EMBEDDED_CSS_DEVICE_PIXEL_RATIO "1.5" CACHE STRING "Logical CSS px to physical pixel scale for this board")
5
+
6
+ # The shared base resolves the npm packages (and with them GEA_CHIPS) only
7
+ # after this file has run, so resolve them here too: the source list below
8
+ # names chip drivers by that path and would otherwise expand to `/displays/...`.
9
+ set(GEA_EMBEDDED_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../..")
10
+ cmake_path(ABSOLUTE_PATH GEA_EMBEDDED_ROOT NORMALIZE)
11
+ include("${GEA_EMBEDDED_ROOT}/targets/esp32/gea_framework.cmake")
12
+
13
+ # 480x480 square CO5300 AMOLED, no column gap.
14
+ set(GEA_BOARD_DISPLAY_WIDTH 480)
15
+ set(GEA_BOARD_DISPLAY_HEIGHT 480)
16
+
17
+ # The board's own BSP drives the panel at 40 MHz. The panel latches at 80 MHz,
18
+ # as on the 1.75 and 2.06 CO5300 boards: bouncing-balls went from 36.5 to
19
+ # 61.6 fps, the full-width flush from 23 ms to 11.8 ms per frame.
20
+ set(GEA_BOARD_QSPI_PCLK_HZ 80000000)
21
+ set(GEA_BOARD_PARTIAL_PAD_X 0)
22
+ set(GEA_BOARD_PARTIAL_PAD_Y 0)
23
+
24
+ # No AXP2101, no ESP-Mosaico BSP: the VCC_3V3 rail and the USB console are
25
+ # board_power.cpp's, and it gives display init its prepareDisplayPanel().
26
+ set(GEA_BOARD_EXTRA_REQUIRES
27
+ esp_codec_dev
28
+ esp_driver_ledc
29
+ espressif__esp_tinyusb
30
+ # The RTC watchdog reset behind the USB downloader request (board_power.cpp).
31
+ esp_hal_wdt
32
+ )
33
+
34
+ set(GEA_BOARD_EXTRA_COMPILE_DEFINITIONS
35
+ GEA_BOARD_PREPARE_DISPLAY_PANEL=1
36
+ GEA_BOARD_USB_CONSOLE=1
37
+ GEA_EMBEDDED_CO5300_MOSAICO_INIT=1
38
+ GEA_EMBEDDED_CO5300_PANEL_X_GAP=0
39
+ GEA_EMBEDDED_CO5300_PANEL_Y_GAP=0
40
+ GEA_BOARD_BMI270_I2C_ADDRESS=0x69
41
+ GEA_BOARD_ES8311_I2C_ADDRESS=0x19
42
+ # The side "AI" button; GPIO0 is the expansion I2C bus on this board.
43
+ GEA_BOARD_LAUNCHER_BUTTON_GPIO=7
44
+ )
45
+
46
+ set(GEA_BOARD_PLATFORM_SOURCES
47
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32-s3-touch-amoled-1.8/main/app_main.cpp"
48
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32-s3-touch-amoled-1.8/main/i2c.cpp"
49
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32-s3-touch-amoled-1.8/main/launcher_button.cpp"
50
+ "${CMAKE_CURRENT_LIST_DIR}/touch.cpp"
51
+ "${CMAKE_CURRENT_LIST_DIR}/board_power.cpp"
52
+ "${GEA_CHIPS}/displays/co5300/co5300.cpp"
53
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32/display.cpp"
54
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32/chip_bindings/displays/co5300.cpp"
55
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32/chip_bindings/touch/cst9217.cpp"
56
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32/chip_bindings/audio/es8311.cpp"
57
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32/chip_bindings/imu/bmi270.cpp"
58
+ # The BQ27220 fuel gauge has no binding yet; report "no battery reading"
59
+ # rather than a number nobody measured.
60
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32/power_absent.cpp"
61
+ )
62
+
63
+ 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