@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
@@ -0,0 +1,194 @@
1
+ # Target: ESP32-S31 (Espressif ESP-Mosaico V1.2) -- an ESP-IDF 6.2-dev preview target
2
+ CONFIG_IDF_TARGET="esp32s31"
3
+
4
+ # Flash: 16 MB GD25Q128E quad NOR (ESP-Mosaico V1.2)
5
+ CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
6
+ # Match Waveshare's board-check/audio/template configurations. DIO needlessly
7
+ # halves the flash data lanes feeding native codec instruction-cache misses.
8
+ CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
9
+ CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
10
+
11
+
12
+ # Console over USB Serial/JTAG (native USB-C on this board)
13
+ # Console on UART0. The USB-C port is the S31's high-speed OTG controller, not
14
+ # USB-Serial/JTAG (that is on GPIO33/34, at the left expansion header), and the
15
+ # S31 has no ROM CDC console; board_power.cpp redirects stdio to a TinyUSB CDC
16
+ # interface once the scheduler runs. UART0 keeps the early boot output.
17
+ CONFIG_ESP_CONSOLE_UART_DEFAULT=y
18
+ CONFIG_TINYUSB_CDC_ENABLED=y
19
+ CONFIG_TINYUSB_CDC_COUNT=1
20
+
21
+ # esp_codec_dev should share the existing new-driver I2C bus with touch/PMIC.
22
+ # CONFIG_CODEC_I2C_BACKWARD_COMPATIBLE is not set
23
+
24
+ # Disable secondary console to avoid duplicate output
25
+ CONFIG_ESP_CONSOLE_SECONDARY_NONE=y
26
+
27
+ # FreeRTOS tick rate — 1000 Hz gives 1 ms resolution for modMilliseconds
28
+ CONFIG_FREERTOS_HZ=1000
29
+
30
+ # Run the S31 at its full rated 320 MHz app CPU clock. Bouncing display workloads are
31
+ # otherwise CPU-bound before the 80 MHz QSPI flush finishes.
32
+ CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_320=y
33
+ CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=320
34
+
35
+ # Main task stack for the app event loop. gea TSX frames can build deep
36
+ # reactive call chains before returning to the firmware loop.
37
+ CONFIG_ESP_MAIN_TASK_STACK_SIZE=32768
38
+ # Stock cross-core IPC callbacks do not run the application's reactive chain.
39
+ # Measured high-water use is under 1 KiB; 4 KiB leaves over 3 KiB of margin
40
+ # without withholding 32 KiB from TLS/DMA and the full-duplex audio driver.
41
+ CONFIG_ESP_IPC_TASK_STACK_SIZE=4096
42
+
43
+ # Wi-Fi scan/connect callbacks run on ESP-IDF's system event task.
44
+ CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096
45
+
46
+ # Custom partition table with two OTA slots for wireless updates
47
+ CONFIG_PARTITION_TABLE_CUSTOM=y
48
+ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
49
+
50
+ # On panic: print backtrace then reboot. (Halting was meant to "keep USB alive
51
+ # for reflashing", but a halted ESP32-S3 won't accept an esptool reset — it has
52
+ # to be recovered over JTAG. Rebooting allows the firmware to remain
53
+ # reachable for diagnosis and reflashing.)
54
+ CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y
55
+
56
+ # 16 MB in-package octal PSRAM for the framebuffer, at the 250 MHz the
57
+ # board's own defaults use
58
+ CONFIG_SPIRAM=y
59
+ CONFIG_SPIRAM_MODE_OCT=y
60
+ CONFIG_SPIRAM_SPEED_250M=y
61
+ CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y
62
+ CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM=y
63
+ CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
64
+ CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0
65
+ # IDF defaults this to 32 KiB when SPIRAM malloc is enabled. That creates a
66
+ # second DMA/internal heap by allocating a chunk from internal DRAM and
67
+ # re-registering it, which splits the physical heap map into a middle green
68
+ # reserve island. Keep internal memory globally allocatable; app/display code
69
+ # already asks for MALLOC_CAP_INTERNAL/MALLOC_CAP_DMA when it truly needs it.
70
+ CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=0
71
+
72
+ # Wi-Fi/LwIP memory budget: prefer lower throughput over internal DRAM pressure.
73
+ CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=8
74
+ CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=16
75
+ CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=8
76
+ CONFIG_ESP_WIFI_CACHE_TX_BUFFER_NUM=8
77
+ CONFIG_ESP_WIFI_MGMT_SBUF_NUM=16
78
+ CONFIG_ESP_WIFI_RX_BA_WIN=8
79
+ # CONFIG_ESP_WIFI_IRAM_OPT is not set
80
+ # CONFIG_ESP_WIFI_RX_IRAM_OPT is not set
81
+ # Wi-Fi driver task: IDF 5.5/6.0 no longer exposes a public
82
+ # CONFIG_ESP_WIFI_TASK_STACK_SIZE knob. targets/esp32/connectivity/wifi.cpp
83
+ # wraps wifi_init_config_t.osi_funcs task creation and bumps the closed-source
84
+ # "wifi" task to 8192 bytes there.
85
+ CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=4096
86
+
87
+ # Firmware uses STA mode for OTA/log/mirror; trim unused Wi-Fi/LwIP features.
88
+ # CONFIG_ESP_WIFI_SOFTAP_SUPPORT is not set
89
+ # CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT is not set
90
+ # CONFIG_ESP_WIFI_ENABLE_WPA3_SAE is not set
91
+ # CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA is not set
92
+ # CONFIG_LWIP_IPV6 is not set
93
+ # CONFIG_LWIP_DHCPS is not set
94
+
95
+ # Bluetooth: NimBLE peripheral for BLE HID
96
+ CONFIG_BT_ENABLED=y
97
+ CONFIG_BT_NIMBLE_ENABLED=y
98
+ CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL=y
99
+ CONFIG_BT_NIMBLE_MAX_CONNECTIONS=1
100
+ CONFIG_BT_NIMBLE_ROLE_BROADCASTER=y
101
+ CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=y
102
+ CONFIG_BT_NIMBLE_ROLE_CENTRAL=n
103
+ CONFIG_BT_NIMBLE_ROLE_OBSERVER=n
104
+ CONFIG_BT_NIMBLE_SM_LEGACY=y
105
+ CONFIG_BT_NIMBLE_SM_SC=y
106
+ CONFIG_BT_NIMBLE_NVS_PERSIST=y
107
+ CONFIG_BT_NIMBLE_LOG_LEVEL_NONE=y
108
+
109
+ # Pin WiFi + BT controller + NimBLE host to core 1, leaving core 0 for the app
110
+ # frame/render task (GEA_EMBEDDED_APP_FRAME_TASK_CORE=0). IDF pins all of these
111
+ # to core 0 by default, where they contend with rendering: launching an app
112
+ # through the launcher dropped to ~22 fps because the per-chunk flush wait was
113
+ # preempted (19 ms vs 1.6 ms). Moving them to core 1 restores ~60 fps. Keep
114
+ # WiFi and BT on the SAME core for coexistence (ESP_COEX_SW_COEXIST_ENABLE).
115
+ CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_1=y
116
+ CONFIG_BT_CTRL_PINNED_TO_CORE_1=y
117
+ CONFIG_BT_NIMBLE_PINNED_TO_CORE_1=y
118
+
119
+ # WebRTC: mbedTLS DTLS + DTLS-SRTP for esp_peer
120
+ # Required by espressif/esp_peer (DTLS-SRTP handshake, DTLS cookies, MTU
121
+ # config). Off by default in IDF — turning them on costs ~30-40 kB of
122
+ # mbedTLS code but is non-negotiable for SRTP-protected RTP.
123
+ CONFIG_MBEDTLS_SSL_PROTO_DTLS=y
124
+ CONFIG_MBEDTLS_SSL_DTLS_SRTP=y
125
+ CONFIG_MBEDTLS_SSL_DTLS_HELLO_VERIFY=y
126
+ CONFIG_MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE=y
127
+ CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID=y
128
+ # esp_peer generates a self-signed DTLS cert at runtime via
129
+ # mbedtls_x509write_crt_*; those live behind MBEDTLS_X509_CREATE_C, which
130
+ # ESP-IDF 6.0 flipped to default-off (was implicitly available in 5.5). Without
131
+ # it esp_peer fails to link (implicit-declaration of mbedtls_x509write_crt_*).
132
+ CONFIG_MBEDTLS_X509_CREATE_C=y
133
+ CONFIG_MBEDTLS_X509_CRT_WRITE_C=y
134
+ CONFIG_MBEDTLS_X509_CSR_WRITE_C=y
135
+
136
+ # Allocate mbedTLS memory from PSRAM instead of internal DRAM. IDF defaults to
137
+ # INTERNAL_MEM_ALLOC, but internal RAM is scarce on this board (app + 2-deep
138
+ # flush pipeline + WiFi driver). A TLS handshake's PSA signature verification
139
+ # and 16 KB input buffer then fail to allocate, surfacing as the misleading
140
+ # "esp-x509-crt-bundle: Certificate matched but signature verification failed"
141
+ # with PSA error -141 (PSA_ERROR_INSUFFICIENT_MEMORY) — a heap shortage, not a
142
+ # trust failure. PSRAM has megabytes free; the hardware MPI/crypto path copies
143
+ # operands into the peripheral so PSRAM-resident TLS buffers are fine.
144
+ # CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC is not set
145
+ CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
146
+
147
+ # Release optimization level. ESP-IDF defaults to -Og (DEBUG) which is
148
+ # friendly for debugging but leaves real perf on the table for compute-heavy
149
+ # code paths. -O2 (PERF) is the correct release setting.
150
+ CONFIG_COMPILER_OPTIMIZATION_PERF=y
151
+ # CONFIG_COMPILER_OPTIMIZATION_DEBUG is not set
152
+
153
+ # --- Development logging / diagnostics defaults ---
154
+ # VS Code launch tasks build per-app firmware under build/app-builds/<app>.
155
+ # Keep those dev builds chatty by default so serial monitor shows boot logs,
156
+ # gea.perf fps windows, frame scheduler diagnostics, and assertion failures.
157
+ # Production lockdown can still be enabled via menuconfig, but it is not the
158
+ # default for local flash/monitor iteration.
159
+ # CONFIG_GEA_EMBEDDED_PRODUCTION_LOCKDOWN is not set
160
+
161
+ # Runtime and bootloader logs visible on USB serial/JTAG.
162
+ # CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
163
+ CONFIG_LOG_DEFAULT_LEVEL_INFO=y
164
+ CONFIG_LOG_DEFAULT_LEVEL=3
165
+ CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
166
+ CONFIG_LOG_MAXIMUM_LEVEL=3
167
+
168
+ # Keep assertions enabled in local dev builds.
169
+ # CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set
170
+ CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y
171
+ CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2
172
+
173
+ # Keep early boot output visible too.
174
+ # CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set
175
+ CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
176
+ CONFIG_BOOTLOADER_LOG_LEVEL=3
177
+
178
+ # Diagnostic allocation attribution. Keep standalone heap tracing available for
179
+ # app-init fragmentation investigations; trace records are placed in PSRAM by
180
+ # the caller, and tracing remains idle unless explicitly started.
181
+ # Heap tracing costs about a kilobyte of IRAM (1,067 bytes measured on
182
+ # esp32-s3-touch-amoled-2.06) and puts a hook on the allocator's hot path. On the
183
+ # S3 that IRAM is not free space: the linker sizes .dram0.dummy to whatever IRAM
184
+ # the image used, so every byte of .iram0.text is a byte the internal heap never
185
+ # gets -- and the internal heap is what DMA, USB host enumeration and aligned
186
+ # coefficient banks come out of. The framework's only users, the display and
187
+ # AXP2101 init traces, are already gated on GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG,
188
+ # which defaults to 0. So nothing traced by default and every app paid for it.
189
+ # Turn this and that macro on together when you actually want a trace.
190
+ CONFIG_HEAP_TRACING_OFF=y
191
+ # CONFIG_HEAP_TRACING_STANDALONE is not set
192
+ # CONFIG_HEAP_TRACING_TOHOST is not set
193
+ # CONFIG_HEAP_TRACING is not set
194
+ # CONFIG_HEAP_TRACE_HASH_MAP is not set
@@ -2550,4 +2550,7 @@ void AudioSystem::setVolume(int) {}
2550
2550
  bool AudioSystem::playFile(const std::string &) { return false; }
2551
2551
  bool AudioSystem::playPcm(const std::int16_t *, std::size_t, int, int) { return false; }
2552
2552
  void AudioSystem::stopPlayback() {}
2553
+ // No PCM stream output is queued by this backend (only the ESP32 runtime
2554
+ // streams PCM), so a flush has nothing to discard.
2555
+ void AudioSystem::flushPlayback() {}
2553
2556
  } // namespace gea::platform::audio
package/targets.json CHANGED
@@ -179,5 +179,17 @@
179
179
  "appPlatform": "esp32",
180
180
  "idfTarget": "esp32s3",
181
181
  "esptoolChip": "esp32s3"
182
+ },
183
+ "esp32-s31-espressif-mosaico": {
184
+ "adapter": "esp32-idf",
185
+ "targetPath": "targets/esp32-s31-espressif-mosaico",
186
+ "flashSize": "16MB",
187
+ "appPlatform": "esp32",
188
+ "idfTarget": "esp32s31",
189
+ "esptoolChip": "esp32s31",
190
+ "idfVersion": "6.2",
191
+ "ipcTaskStackSize": "4096",
192
+ "forceDownloadRegister": "0x20700008:0x4",
193
+ "manualBoot": true
182
194
  }
183
195
  }