mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 19:02:00 +00:00
perf(l2): bigger CPU instruction cache, TLS and BLE buffers in PSRAM
The framework libs are rebuilt for the L2's own ESP-IDF options (solo/wio-tracker-l2/idf/sdkconfig): a 32 KB instruction cache and 64-byte data cache lines make frames ~35% faster (map 45 -> 30 ms, settings ~36 -> 22 ms). mbedTLS and the NimBLE host allocate in PSRAM, so internal RAM ends up with more free than before (103 KB, largest block 57 KB; was 89.6 / 45). Wio_Tracker_L2_idf_libs does the rebuild; it has to run before the firmware env, also in CI. idf/arduino_tinyusb gives the rebuild the TinyUSB options and the framework's prebuilt library, which it would otherwise lose. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# Stands in for esp32-arduino-lib-builder's arduino_tinyusb during the
|
||||
# custom_sdkconfig rebuild: its options (Kconfig), and the framework's own
|
||||
# prebuilt library and headers. No sources, so no archive replaces the
|
||||
# prebuilt one.
|
||||
if(CMAKE_BUILD_EARLY_EXPANSION) # the requirements scan: nothing to resolve yet
|
||||
idf_component_register()
|
||||
return()
|
||||
endif()
|
||||
foreach(dir ${EXTRA_COMPONENT_DIRS})
|
||||
if(dir MATCHES "framework-arduinoespressif32$")
|
||||
set(libs "${dir}-libs/${IDF_TARGET}")
|
||||
endif()
|
||||
endforeach()
|
||||
if(NOT libs)
|
||||
message(FATAL_ERROR "arduino_tinyusb: the Arduino framework isn't among EXTRA_COMPONENT_DIRS")
|
||||
endif()
|
||||
idf_component_register(INCLUDE_DIRS "${libs}/include/arduino_tinyusb/tinyusb/src"
|
||||
"${libs}/include/arduino_tinyusb/include")
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE "${libs}/lib/libarduino_tinyusb.a")
|
||||
@@ -0,0 +1,105 @@
|
||||
# The TinyUSB options of the Arduino-ESP32 3.3.12 libs (their values), for
|
||||
# the custom_sdkconfig rebuild: the component that declares them lives in
|
||||
# esp32-arduino-lib-builder, so without this file they'd drop out of
|
||||
# sdkconfig.h and the prebuilt libarduino_tinyusb.a would lose its USB serial.
|
||||
menu "Arduino TinyUSB"
|
||||
config TINYUSB_ENABLED
|
||||
bool
|
||||
default y
|
||||
config TINYUSB_CDC_ENABLED
|
||||
bool
|
||||
default y
|
||||
config TINYUSB_DESC_CDC_STRING
|
||||
string
|
||||
default "Espressif CDC Device"
|
||||
config TINYUSB_CDC_RX_BUFSIZE
|
||||
int
|
||||
default 64
|
||||
config TINYUSB_CDC_TX_BUFSIZE
|
||||
int
|
||||
default 64
|
||||
config TINYUSB_CDC_MAX_PORTS
|
||||
int
|
||||
default 2
|
||||
config TINYUSB_MSC_ENABLED
|
||||
bool
|
||||
default y
|
||||
config TINYUSB_DESC_MSC_STRING
|
||||
string
|
||||
default "Espressif MSC Device"
|
||||
config TINYUSB_MSC_BUFSIZE
|
||||
int
|
||||
default 4096
|
||||
config TINYUSB_HID_ENABLED
|
||||
bool
|
||||
default y
|
||||
config TINYUSB_DESC_HID_STRING
|
||||
string
|
||||
default "Espressif HID Device"
|
||||
config TINYUSB_HID_BUFSIZE
|
||||
int
|
||||
default 64
|
||||
config TINYUSB_MIDI_ENABLED
|
||||
bool
|
||||
default y
|
||||
config TINYUSB_DESC_MIDI_STRING
|
||||
string
|
||||
default "Espressif MIDI Device"
|
||||
config TINYUSB_MIDI_RX_BUFSIZE
|
||||
int
|
||||
default 64
|
||||
config TINYUSB_MIDI_TX_BUFSIZE
|
||||
int
|
||||
default 64
|
||||
config TINYUSB_AUDIO_ENABLED
|
||||
bool
|
||||
default y
|
||||
config TINYUSB_DESC_AUDIO_STRING
|
||||
string
|
||||
default "Espressif AUDIO Device"
|
||||
config TINYUSB_VIDEO_ENABLED
|
||||
bool
|
||||
default y
|
||||
config TINYUSB_DESC_VIDEO_STRING
|
||||
string
|
||||
default "Espressif VIDEO Device"
|
||||
config TINYUSB_VIDEO_STREAMING_BUFSIZE
|
||||
int
|
||||
default 64
|
||||
config TINYUSB_VIDEO_STREAMING_IFS
|
||||
int
|
||||
default 1
|
||||
config TINYUSB_DFU_RT_ENABLED
|
||||
bool
|
||||
default y
|
||||
config TINYUSB_DESC_DFU_RT_STRING
|
||||
string
|
||||
default "Espressif DFU_RT Device"
|
||||
config TINYUSB_DFU_ENABLED
|
||||
bool
|
||||
default y
|
||||
config TINYUSB_DESC_DFU_STRING
|
||||
string
|
||||
default "Espressif DFU Device"
|
||||
config TINYUSB_DFU_BUFSIZE
|
||||
int
|
||||
default 4096
|
||||
config TINYUSB_VENDOR_ENABLED
|
||||
bool
|
||||
default y
|
||||
config TINYUSB_DESC_VENDOR_STRING
|
||||
string
|
||||
default "Espressif VENDOR Device"
|
||||
config TINYUSB_VENDOR_RX_BUFSIZE
|
||||
int
|
||||
default 64
|
||||
config TINYUSB_VENDOR_TX_BUFSIZE
|
||||
int
|
||||
default 64
|
||||
config TINYUSB_NCM_ENABLED
|
||||
bool
|
||||
default y
|
||||
config TINYUSB_DEBUG_LEVEL
|
||||
int
|
||||
default 0
|
||||
endmenu
|
||||
@@ -0,0 +1,27 @@
|
||||
# ESP-IDF options for the L2's LVGL firmware, over the Arduino framework's own
|
||||
# (custom_sdkconfig in solo/wio-tracker-l2/platformio.ini; changing this file
|
||||
# means rebuilding the framework libs: pio run -e Wio_Tracker_L2_idf_libs).
|
||||
|
||||
# The reason for all this: a 32 KB instruction cache (the framework ships
|
||||
# 16 KB) and 64-byte data cache lines. LVGL runs from flash and draws into
|
||||
# PSRAM; frames draw ~35% faster. Costs 16 KB internal RAM.
|
||||
CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y
|
||||
CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y
|
||||
|
||||
# ...won back, and more: TLS (map downloads, live tiles, OTA) and the BLE
|
||||
# host keep their buffers in PSRAM.
|
||||
CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
|
||||
CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL=y
|
||||
|
||||
# What the framework's own build sets for octal-PSRAM boards, which a rebuild
|
||||
# from its generic config would lose: PSRAM up before global constructors
|
||||
# (MESH_IN_PSRAM needs it), WiFi TX buffers allocated as needed.
|
||||
CONFIG_SPIRAM_BOOT_HW_INIT=y
|
||||
CONFIG_SPIRAM_BOOT_INIT=y
|
||||
CONFIG_SPIRAM_IGNORE_NOTFOUND=y
|
||||
CONFIG_SPIRAM_PRE_CONFIGURE_MEMORY_PROTECTION=y
|
||||
# CONFIG_SPIRAM_MEMTEST is not set
|
||||
CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER=y
|
||||
CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=32
|
||||
CONFIG_ESP_WIFI_RX_BA_WIN=6
|
||||
CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4
|
||||
Reference in New Issue
Block a user