@geastack/targets 0.1.91 → 0.1.93

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 (26) hide show
  1. package/build-config.json +32 -0
  2. package/package.json +6 -6
  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/chip_bindings/touch/cst9217.cpp +67 -3
  8. package/targets/esp32/display.cpp +35 -32
  9. package/targets/esp32/render_worker_join.h +32 -0
  10. package/targets/esp32/services/device_control.cpp +130 -0
  11. package/targets/esp32-s3-touch-amoled-1.8/main/CMakeLists.txt +8 -1
  12. package/targets/esp32-s3-touch-amoled-1.8/main/app_main.cpp +8 -0
  13. package/targets/esp32-s3-touch-amoled-1.8/main/launcher_button.cpp +6 -1
  14. package/targets/esp32-s31-espressif-mosaico/CMakeLists.txt +10 -0
  15. package/targets/esp32-s31-espressif-mosaico/README.md +65 -0
  16. package/targets/esp32-s31-espressif-mosaico/dependencies.lock +141 -0
  17. package/targets/esp32-s31-espressif-mosaico/main/CMakeLists.txt +77 -0
  18. package/targets/esp32-s31-espressif-mosaico/main/Kconfig.projbuild +12 -0
  19. package/targets/esp32-s31-espressif-mosaico/main/board_power.cpp +440 -0
  20. package/targets/esp32-s31-espressif-mosaico/main/idf_component.yml +37 -0
  21. package/targets/esp32-s31-espressif-mosaico/main/include/board.h +147 -0
  22. package/targets/esp32-s31-espressif-mosaico/main/include/wifi_config.h.example +5 -0
  23. package/targets/esp32-s31-espressif-mosaico/main/touch.cpp +45 -0
  24. package/targets/esp32-s31-espressif-mosaico/partitions.csv +10 -0
  25. package/targets/esp32-s31-espressif-mosaico/sdkconfig.defaults +200 -0
  26. package/targets.json +12 -0
@@ -127,8 +127,16 @@ void runtimeTask(void *)
127
127
 
128
128
  } // namespace
129
129
 
130
+ // The app's stylesheet registration, emitted as a function (--cpp-prelude-symbol)
131
+ // rather than a file-scope global constructor. Static constructors run on the
132
+ // ROM's startup stack before FreeRTOS -- 8 KB on the ESP32-S31 -- and a CSS
133
+ // app's registration body alone takes a 3.5 KB frame, so it overran that stack
134
+ // into the heap. Weak: canvas-only builds emit no registration.
135
+ void gea_plugin_cpp_register_prelude() __attribute__((weak));
136
+
130
137
  extern "C" void app_main(void)
131
138
  {
139
+ if (gea_plugin_cpp_register_prelude) gea_plugin_cpp_register_prelude();
132
140
  // Force the targets/esp32/apps/app_manager.cpp TU to be linked in. That
133
141
  // TU's only side effect is a file-scope `PlatformRegistration` whose
134
142
  // constructor calls AppManager::setPlatform(...). With -Wl,--gc-sections
@@ -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,65 @@
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 CST9220 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, not a ROM console:
35
+ it has no DTR/RTS reset circuit, V1.2 ships with automatic download mode
36
+ disabled, and a software reset into the downloader leaves the ROM silent on
37
+ that port until a power cycle. So `gea flash` installs the app through the app
38
+ already running (`usbAppUpdate: "geadev-ota"`): the image goes over the USB
39
+ console into the next OTA slot and the board restarts into it. No buttons.
40
+
41
+ The ROM downloader is still needed for the first flash, or when no gea app is
42
+ running: **hold BOOT while powering the board on** (POWER until dark, hold
43
+ BOOT, press POWER, release BOOT), then `gea flash --board mosaico --manual-boot`.
44
+ `gea flash` falls back to that by itself when no app answers.
45
+
46
+ ## Console
47
+
48
+ There is no ROM console on the USB-C port. The firmware brings up a TinyUSB
49
+ CDC-ACM interface and routes the console through it. Its USB serial number is
50
+ the chip MAC in the `AA:BB:CC:DD:EE:FF` form the S3 boards report, so register
51
+ the board by that serial and `--board mosaico` resolves the port the usual way.
52
+ UART0 keeps early boot output.
53
+
54
+ ## Board bring-up
55
+
56
+ Everything on the panel side is behind VCC_3V3, a high-side switch enabled by
57
+ GPIO60 (active low). `main/board_power.cpp` soft-starts it through an LEDC
58
+ fade, as the BSP does, and releases the PWR_SW power-off request on GPIO57
59
+ before display init touches the panel.
60
+
61
+ The panel's TE line is wired on GPIO43, so apps that ask for vsync
62
+ (`Display.setVSync(true)`) render locked to the panel's ~60 Hz refresh.
63
+
64
+ Not yet wired: the BQ27220 fuel gauge (the board reports no battery reading),
65
+ the magnetometers and the SPI NAND.
@@ -0,0 +1,141 @@
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_lcd_touch_cst9220:
75
+ component_hash: 519c0aed2d41307a9110f034b1eff8fa9a0e47621b1e1cd1b1a5e76183c8a6e8
76
+ dependencies:
77
+ - name: espressif/cmake_utilities
78
+ registry_url: https://components.espressif.com
79
+ require: private
80
+ version: 0.*
81
+ - name: espressif/esp_lcd_touch
82
+ registry_url: https://components.espressif.com
83
+ require: public
84
+ version: ^1.2.0
85
+ - name: idf
86
+ require: private
87
+ version: '>=5.3'
88
+ source:
89
+ registry_url: https://components.espressif.com/
90
+ type: service
91
+ version: 0.1.1
92
+ espressif/esp_tinyusb:
93
+ component_hash: 0fab24246e07bdf919c6489d17a590cffbffbbf6a9c44d6235641645c8b946b7
94
+ dependencies:
95
+ - name: idf
96
+ require: private
97
+ version: '>=5.0'
98
+ - name: espressif/tinyusb
99
+ registry_url: https://components.espressif.com
100
+ require: public
101
+ version: '>=0.17.0~2'
102
+ source:
103
+ registry_url: https://components.espressif.com/
104
+ type: service
105
+ targets:
106
+ - esp32s2
107
+ - esp32s3
108
+ - esp32p4
109
+ - esp32h4
110
+ - esp32s31
111
+ version: 2.3.0
112
+ espressif/tinyusb:
113
+ component_hash: 16c8d774dab1f484d3e0c0f61105624d2424bbae864efd19818baf7b451b41e7
114
+ dependencies:
115
+ - name: idf
116
+ require: private
117
+ version: '>=5.0'
118
+ source:
119
+ registry_url: https://components.espressif.com
120
+ type: service
121
+ targets:
122
+ - esp32s2
123
+ - esp32s3
124
+ - esp32p4
125
+ - esp32h4
126
+ - esp32s31
127
+ version: 0.21.0~2
128
+ idf:
129
+ source:
130
+ type: idf
131
+ version: 6.2.0
132
+ direct_dependencies:
133
+ - espressif/esp_codec_dev
134
+ - espressif/esp_lcd_co5300
135
+ - espressif/esp_lcd_panel_io_additions
136
+ - espressif/esp_lcd_touch_cst9220
137
+ - espressif/esp_tinyusb
138
+ - idf
139
+ manifest_hash: 7782d7a5b27bfbc269f69f2c3c7e7310e0524b6aeb8064924ee09ef7486f5eb8
140
+ target: esp32s31
141
+ version: 3.0.0
@@ -0,0 +1,77 @@
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
+ )
31
+
32
+ set(GEA_BOARD_EXTRA_COMPILE_DEFINITIONS
33
+ GEA_BOARD_PREPARE_DISPLAY_PANEL=1
34
+ GEA_BOARD_USB_CONSOLE=1
35
+ # `gea flash` installs apps through the running app (usbAppUpdate).
36
+ GEA_DEVICE_CONTROL_USB_OTA=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
+ GEA_BOARD_TOUCH_CST9220=1
45
+ )
46
+
47
+ set(GEA_BOARD_PLATFORM_SOURCES
48
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32-s3-touch-amoled-1.8/main/app_main.cpp"
49
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32-s3-touch-amoled-1.8/main/i2c.cpp"
50
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32-s3-touch-amoled-1.8/main/launcher_button.cpp"
51
+ "${CMAKE_CURRENT_LIST_DIR}/touch.cpp"
52
+ "${CMAKE_CURRENT_LIST_DIR}/board_power.cpp"
53
+ "${GEA_CHIPS}/displays/co5300/co5300.cpp"
54
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32/display.cpp"
55
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32/chip_bindings/displays/co5300.cpp"
56
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32/chip_bindings/touch/cst9217.cpp"
57
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32/chip_bindings/audio/es8311.cpp"
58
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32/chip_bindings/imu/bmi270.cpp"
59
+ # The BQ27220 fuel gauge has no binding yet; report "no battery reading"
60
+ # rather than a number nobody measured.
61
+ "${CMAKE_CURRENT_LIST_DIR}/../../esp32/power_absent.cpp"
62
+ )
63
+
64
+ include("${CMAKE_CURRENT_LIST_DIR}/../../esp32-s3-touch-amoled-1.8/main/CMakeLists.txt")
65
+
66
+ # IDF 6.2 brings GCC 16 + picolibc: picolibc declares fflush() nonnull, so the
67
+ # runtime's fflush(nullptr) trips -Werror=nonnull, and GCC 16 flags generated
68
+ # std::move()s as redundant. Warnings, not errors, until the compiler runtime
69
+ # and emitter are fixed for this toolchain.
70
+ if(NOT CMAKE_BUILD_EARLY_EXPANSION)
71
+ target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-error=nonnull -Wno-error=redundant-move)
72
+ # board_power.cpp keeps a crash's registers and log across the reset (no UART0 here)
73
+ # and makes the USB console wait for the host instead of dropping output.
74
+ target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=esp_panic_handler"
75
+ "-Wl,--wrap=tinyusb_cdcacm_write_queue_char"
76
+ "-Wl,--wrap=uart_hal_write_txfifo")
77
+ endif()
@@ -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