diff --git a/Devices/lilygo-tdeck/lilygo,tdeck.dts b/Devices/lilygo-tdeck/lilygo,tdeck.dts index 5819ac1e2..5a53d6c36 100644 --- a/Devices/lilygo-tdeck/lilygo,tdeck.dts +++ b/Devices/lilygo-tdeck/lilygo,tdeck.dts @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include @@ -95,7 +95,7 @@ }; i2c_internal: i2c0 { - compatible = "espressif,esp32-i2c"; + compatible = "espressif,esp32-i2c-master"; port = ; clock-frequency = <100000>; pin-sda = <&gpio0 18 GPIO_FLAG_NONE>; diff --git a/Drivers/gt911-module/source/gt911.cpp b/Drivers/gt911-module/source/gt911.cpp index 098ad0b60..52e23378e 100644 --- a/Drivers/gt911-module/source/gt911.cpp +++ b/Drivers/gt911-module/source/gt911.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include @@ -87,14 +86,10 @@ static esp_err_t create_io_handle(Device* parent, esp_lcd_panel_io_handle_t* out } auto* parent_driver = device_get_driver(parent); - if (driver_is_compatible(parent_driver, "espressif,esp32-i2c")) { - auto port = static_cast(parent->config)->port; - return esp_lcd_new_panel_io_i2c_v1(port, &io_config, out_handle); - } if (driver_is_compatible(parent_driver, "espressif,esp32-i2c-master")) { auto bus = esp32_i2c_master_get_bus_handle(parent); io_config.scl_speed_hz = esp32_i2c_master_get_clock_frequency(parent); - return esp_lcd_new_panel_io_i2c_v2(bus, &io_config, out_handle); + return esp_lcd_new_panel_io_i2c(bus, &io_config, out_handle); } LOG_E(TAG, "Unsupported I2C driver"); diff --git a/Drivers/lilygo-module/CMakeLists.txt b/Drivers/lilygo-module/CMakeLists.txt index 5c5b67056..6a4587f2a 100644 --- a/Drivers/lilygo-module/CMakeLists.txt +++ b/Drivers/lilygo-module/CMakeLists.txt @@ -7,5 +7,5 @@ file(GLOB_RECURSE SOURCE_FILES "source/*.c*") tactility_add_module(lilygo-module SRCS ${SOURCE_FILES} INCLUDE_DIRS include/ - REQUIRES TactilityKernel lvgl driver + REQUIRES TactilityKernel lvgl driver esp_driver_gpio ) diff --git a/Drivers/st7789-module/source/st7789.cpp b/Drivers/st7789-module/source/st7789.cpp index 801b5f12c..687fc54f0 100644 --- a/Drivers/st7789-module/source/st7789.cpp +++ b/Drivers/st7789-module/source/st7789.cpp @@ -83,8 +83,8 @@ static error_t start(Device* device) { } esp_lcd_panel_io_spi_config_t io_config = { - .cs_gpio_num = pin_or_unused(cs_pin), - .dc_gpio_num = pin_or_unused(config->pin_dc), + .cs_gpio_num = static_cast(pin_or_unused(cs_pin)), + .dc_gpio_num = static_cast(pin_or_unused(config->pin_dc)), .spi_mode = 0, .pclk_hz = config->pixel_clock_hz, .trans_queue_depth = config->transaction_queue_depth, @@ -115,13 +115,13 @@ static error_t start(Device* device) { } esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = pin_or_unused(config->pin_reset), .rgb_ele_order = config->bgr_order ? LCD_RGB_ELEMENT_ORDER_BGR : LCD_RGB_ELEMENT_ORDER_RGB, .data_endian = LCD_RGB_DATA_ENDIAN_LITTLE, .bits_per_pixel = config->bits_per_pixel, + .reset_gpio_num = static_cast(pin_or_unused(config->pin_reset)), + .vendor_config = nullptr, // ST7789's reset line is fixed active-low in hardware. .flags = { .reset_active_high = false }, - .vendor_config = nullptr, }; ret = esp_lcd_new_panel_st7789(internal->io_handle, &panel_config, &internal->panel_handle); diff --git a/Libraries/QRCode/src/qrcode.h b/Libraries/QRCode/src/qrcode.h index 6a5745e5d..e1c22c94a 100755 --- a/Libraries/QRCode/src/qrcode.h +++ b/Libraries/QRCode/src/qrcode.h @@ -37,7 +37,7 @@ #ifndef __QRCODE_H_ #define __QRCODE_H_ -#ifndef __cplusplus +#if !defined(__cplusplus) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L) typedef unsigned char bool; static const bool false = 0; static const bool true = 1; diff --git a/Libraries/mbedtls b/Libraries/mbedtls index daca7a397..0a8fda272 160000 --- a/Libraries/mbedtls +++ b/Libraries/mbedtls @@ -1 +1 @@ -Subproject commit daca7a3979c22da155ec9dce49ab1abf3b65d3a9 +Subproject commit 0a8fda272a5a0abef3b47c91bed37185d5a726b1 diff --git a/Modules/crypt-module/CMakeLists.txt b/Modules/crypt-module/CMakeLists.txt index af2dbe1aa..8fd23775d 100644 --- a/Modules/crypt-module/CMakeLists.txt +++ b/Modules/crypt-module/CMakeLists.txt @@ -22,3 +22,7 @@ tactility_add_module(crypt-module INCLUDE_DIRS include/ REQUIRES ${REQUIRES_LIST} ) + +if (NOT DEFINED ENV{ESP_IDF_VERSION}) + target_include_directories(crypt-module PRIVATE "${CMAKE_CURRENT_LIST_DIR}/../../Libraries/mbedtls/tf-psa-crypto/drivers/builtin/include") +endif () diff --git a/Modules/crypt-module/source/crypt.cpp b/Modules/crypt-module/source/crypt.cpp index 8d63765fc..4281aa11e 100644 --- a/Modules/crypt-module/source/crypt.cpp +++ b/Modules/crypt-module/source/crypt.cpp @@ -4,9 +4,14 @@ #include #include -#include +#ifdef ESP_PLATFORM +#include +#else +#define MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS +#include +#endif +#include #include -#include #include #include @@ -22,6 +27,9 @@ constexpr auto* TAG = "crypt"; #define TT_NVS_NAMESPACE "tt_secure" +constexpr int AES_MODE_ENCRYPT = 1; +constexpr int AES_MODE_DECRYPT = 0; + /** * Fills a buffer with cryptographically secure random bytes. * @param[out] out output buffer @@ -145,9 +153,22 @@ static void getKey(uint8_t key[32]) { #endif } +// psa_crypto_init() is safe to call more than once (subsequent calls are a cheap no-op); ESP-IDF +// calls it during startup already, but the simulator has no equivalent, so call it here too +// rather than depend on init order across callers. +static void ensure_psa_crypto_init() { + static bool initialized = false; + if (!initialized) { + psa_crypto_init(); + initialized = true; + } +} + void crypt_get_iv(const void* data, size_t dataLength, uint8_t iv[16]) { + ensure_psa_crypto_init(); uint8_t hash[32]; - mbedtls_sha256(static_cast(data), dataLength, hash, 0); + size_t hash_length; + psa_hash_compute(PSA_ALG_SHA_256, static_cast(data), dataLength, hash, sizeof(hash), &hash_length); memcpy(iv, hash, 16); mbedtls_platform_zeroize(hash, sizeof(hash)); } @@ -170,15 +191,23 @@ static int aes256CryptCbc( return -1; // TODO: Proper error code from mbed lib? } +#ifdef ESP_PLATFORM + esp_aes_context master; + esp_aes_init(&master); + esp_aes_setkey(&master, key, 256); + int result = esp_aes_crypt_cbc(&master, mode, length, iv, input, output); + esp_aes_free(&master); +#else mbedtls_aes_context master; mbedtls_aes_init(&master); - if (mode == MBEDTLS_AES_ENCRYPT) { + if (mode == AES_MODE_ENCRYPT) { mbedtls_aes_setkey_enc(&master, key, 256); } else { mbedtls_aes_setkey_dec(&master, key, 256); } int result = mbedtls_aes_crypt_cbc(&master, mode, length, iv, input, output); mbedtls_aes_free(&master); +#endif return result; } @@ -190,7 +219,7 @@ int crypt_encrypt(const uint8_t iv[16], const uint8_t* inData, uint8_t* outData, uint8_t iv_copy[16]; memcpy(iv_copy, iv, sizeof(iv_copy)); - int result = aes256CryptCbc(key, MBEDTLS_AES_ENCRYPT, dataLength, iv_copy, inData, outData); + int result = aes256CryptCbc(key, AES_MODE_ENCRYPT, dataLength, iv_copy, inData, outData); mbedtls_platform_zeroize(key, sizeof(key)); mbedtls_platform_zeroize(iv_copy, sizeof(iv_copy)); return result; @@ -204,7 +233,7 @@ int crypt_decrypt(const uint8_t iv[16], const uint8_t* inData, uint8_t* outData, uint8_t iv_copy[16]; memcpy(iv_copy, iv, sizeof(iv_copy)); - int result = aes256CryptCbc(key, MBEDTLS_AES_DECRYPT, dataLength, iv_copy, inData, outData); + int result = aes256CryptCbc(key, AES_MODE_DECRYPT, dataLength, iv_copy, inData, outData); mbedtls_platform_zeroize(key, sizeof(key)); mbedtls_platform_zeroize(iv_copy, sizeof(iv_copy)); return result; diff --git a/Modules/mbedtls-module/source/module.cpp b/Modules/mbedtls-module/source/module.cpp index 2f275a688..a73117b05 100644 --- a/Modules/mbedtls-module/source/module.cpp +++ b/Modules/mbedtls-module/source/module.cpp @@ -1,42 +1,20 @@ // SPDX-License-Identifier: Apache-2.0 #include -#include -#include -#include +// mbedTLS 4.x removed or privatized most legacy primitives with no public replacement (ctr_drbg, +// entropy, cipher, bignum, rsa, most of pk, ecp, ecdsa, ecdh - PSA Crypto is the sanctioned +// replacement now). True on both ESP-IDF's bundled mbedTLS and the simulator's vendored +// Libraries/mbedtls, now the same major version. Nothing in this repo consumes any of these +// symbols directly - this table is speculative ABI surface for side-loaded ELF apps - so it +// shrinks to what's still genuinely public: plain message-digest hashing and error strings. +// See ESP_IDF_6.1_BREAKING_CHANGES.md ยง6.1. #include -#include -#include -#include -#include -#include -#include #include extern "C" { static const ModuleSymbol SYMBOLS[] = { - // CTR_DRBG (random number generation) - DEFINE_MODULE_SYMBOL(mbedtls_ctr_drbg_init), - DEFINE_MODULE_SYMBOL(mbedtls_ctr_drbg_free), - DEFINE_MODULE_SYMBOL(mbedtls_ctr_drbg_seed), - DEFINE_MODULE_SYMBOL(mbedtls_ctr_drbg_random), - // Entropy - DEFINE_MODULE_SYMBOL(mbedtls_entropy_init), - DEFINE_MODULE_SYMBOL(mbedtls_entropy_free), - DEFINE_MODULE_SYMBOL(mbedtls_entropy_func), - // Cipher - DEFINE_MODULE_SYMBOL(mbedtls_cipher_init), - DEFINE_MODULE_SYMBOL(mbedtls_cipher_free), - DEFINE_MODULE_SYMBOL(mbedtls_cipher_setup), - DEFINE_MODULE_SYMBOL(mbedtls_cipher_setkey), - DEFINE_MODULE_SYMBOL(mbedtls_cipher_set_iv), - DEFINE_MODULE_SYMBOL(mbedtls_cipher_reset), - DEFINE_MODULE_SYMBOL(mbedtls_cipher_update), - DEFINE_MODULE_SYMBOL(mbedtls_cipher_finish), - DEFINE_MODULE_SYMBOL(mbedtls_cipher_get_block_size), - DEFINE_MODULE_SYMBOL(mbedtls_cipher_info_from_type), - // Message digest / HMAC + // Message digest DEFINE_MODULE_SYMBOL(mbedtls_md), DEFINE_MODULE_SYMBOL(mbedtls_md_init), DEFINE_MODULE_SYMBOL(mbedtls_md_free), @@ -44,54 +22,7 @@ static const ModuleSymbol SYMBOLS[] = { DEFINE_MODULE_SYMBOL(mbedtls_md_starts), DEFINE_MODULE_SYMBOL(mbedtls_md_update), DEFINE_MODULE_SYMBOL(mbedtls_md_finish), - DEFINE_MODULE_SYMBOL(mbedtls_md_hmac_starts), - DEFINE_MODULE_SYMBOL(mbedtls_md_hmac_update), - DEFINE_MODULE_SYMBOL(mbedtls_md_hmac_finish), DEFINE_MODULE_SYMBOL(mbedtls_md_info_from_type), - // Bignum (MPI) - DEFINE_MODULE_SYMBOL(mbedtls_mpi_init), - DEFINE_MODULE_SYMBOL(mbedtls_mpi_free), - DEFINE_MODULE_SYMBOL(mbedtls_mpi_read_binary), - DEFINE_MODULE_SYMBOL(mbedtls_mpi_write_binary), - DEFINE_MODULE_SYMBOL(mbedtls_mpi_size), - DEFINE_MODULE_SYMBOL(mbedtls_mpi_bitlen), - DEFINE_MODULE_SYMBOL(mbedtls_mpi_lset), - DEFINE_MODULE_SYMBOL(mbedtls_mpi_set_bit), - DEFINE_MODULE_SYMBOL(mbedtls_mpi_fill_random), - DEFINE_MODULE_SYMBOL(mbedtls_mpi_exp_mod), - // RSA - DEFINE_MODULE_SYMBOL(mbedtls_rsa_init), - DEFINE_MODULE_SYMBOL(mbedtls_rsa_free), - DEFINE_MODULE_SYMBOL(mbedtls_rsa_copy), - DEFINE_MODULE_SYMBOL(mbedtls_rsa_get_len), - DEFINE_MODULE_SYMBOL(mbedtls_rsa_check_pubkey), - DEFINE_MODULE_SYMBOL(mbedtls_rsa_check_privkey), - DEFINE_MODULE_SYMBOL(mbedtls_rsa_pkcs1_sign), - DEFINE_MODULE_SYMBOL(mbedtls_rsa_pkcs1_verify), - // Public key abstraction - DEFINE_MODULE_SYMBOL(mbedtls_pk_init), - DEFINE_MODULE_SYMBOL(mbedtls_pk_free), - DEFINE_MODULE_SYMBOL(mbedtls_pk_get_type), - DEFINE_MODULE_SYMBOL(mbedtls_pk_parse_key), - DEFINE_MODULE_SYMBOL(mbedtls_pk_parse_keyfile), - // ECP (elliptic curves) - DEFINE_MODULE_SYMBOL(mbedtls_ecp_group_load), - DEFINE_MODULE_SYMBOL(mbedtls_ecp_point_init), - DEFINE_MODULE_SYMBOL(mbedtls_ecp_point_free), - DEFINE_MODULE_SYMBOL(mbedtls_ecp_point_read_binary), - DEFINE_MODULE_SYMBOL(mbedtls_ecp_point_write_binary), - DEFINE_MODULE_SYMBOL(mbedtls_ecp_check_pubkey), - DEFINE_MODULE_SYMBOL(mbedtls_ecp_check_privkey), - DEFINE_MODULE_SYMBOL(mbedtls_ecp_mul), - // ECDSA - DEFINE_MODULE_SYMBOL(mbedtls_ecdsa_init), - DEFINE_MODULE_SYMBOL(mbedtls_ecdsa_free), - DEFINE_MODULE_SYMBOL(mbedtls_ecdsa_genkey), - DEFINE_MODULE_SYMBOL(mbedtls_ecdsa_from_keypair), - DEFINE_MODULE_SYMBOL(mbedtls_ecdsa_sign), - DEFINE_MODULE_SYMBOL(mbedtls_ecdsa_verify), - // ECDH - DEFINE_MODULE_SYMBOL(mbedtls_ecdh_compute_shared), // Error strings DEFINE_MODULE_SYMBOL(mbedtls_strerror), MODULE_SYMBOL_TERMINATOR, diff --git a/Platforms/platform-esp32/CMakeLists.txt b/Platforms/platform-esp32/CMakeLists.txt index 5fa0a61cd..f46a983d6 100644 --- a/Platforms/platform-esp32/CMakeLists.txt +++ b/Platforms/platform-esp32/CMakeLists.txt @@ -16,7 +16,7 @@ idf_component_register( SRCS ${SOURCES} INCLUDE_DIRS "include/" PRIV_INCLUDE_DIRS "private/" - REQUIRES TactilityKernel TactilityKernelCpp driver esp_adc esp_driver_i2c esp_lcd vfs fatfs esp_wifi esp_netif esp_event + REQUIRES TactilityKernel TactilityKernelCpp driver esp_adc esp_driver_i2c esp_driver_i2s esp_driver_ledc esp_driver_uart esp_lcd vfs fatfs esp_wifi esp_netif esp_event PRIV_REQUIRES ${PRIV_REQUIRES_LIST} ) diff --git a/Platforms/platform-esp32/include/tactility/drivers/esp32_esp_hosted_ota.h b/Platforms/platform-esp32/include/tactility/drivers/esp32_esp_hosted_ota.h index 1908d4dd4..69c16597b 100644 --- a/Platforms/platform-esp32/include/tactility/drivers/esp32_esp_hosted_ota.h +++ b/Platforms/platform-esp32/include/tactility/drivers/esp32_esp_hosted_ota.h @@ -3,5 +3,5 @@ struct FirmwareOps; /** @return the esp_hosted co-processor FirmwareOps implementation. Only declared/linked when - * CONFIG_SLAVE_SOC_WIFI_SUPPORTED - callers (esp32_wifi.cpp) must guard with the same #if. */ + * CONFIG_ESP_HOSTED_ENABLED - callers (esp32_wifi.cpp) must guard with the same #if. */ const FirmwareOps* esp32_esp_hosted_ota_get_ops(); diff --git a/Platforms/platform-esp32/include/tactility/drivers/esp32_i2s.h b/Platforms/platform-esp32/include/tactility/drivers/esp32_i2s.h index e72d0e5fa..3abfeb3cf 100644 --- a/Platforms/platform-esp32/include/tactility/drivers/esp32_i2s.h +++ b/Platforms/platform-esp32/include/tactility/drivers/esp32_i2s.h @@ -10,7 +10,7 @@ extern "C" { #endif struct Esp32I2sConfig { - i2s_port_t port; + int port; struct GpioPinSpec pin_bclk; struct GpioPinSpec pin_ws; struct GpioPinSpec pin_data_out; diff --git a/Platforms/platform-esp32/source/drivers/esp32_esp_hosted_ota.cpp b/Platforms/platform-esp32/source/drivers/esp32_esp_hosted_ota.cpp index 69fd6eceb..bc0aed392 100644 --- a/Platforms/platform-esp32/source/drivers/esp32_esp_hosted_ota.cpp +++ b/Platforms/platform-esp32/source/drivers/esp32_esp_hosted_ota.cpp @@ -2,7 +2,7 @@ #include #endif -#if defined(CONFIG_SLAVE_SOC_WIFI_SUPPORTED) +#if defined(CONFIG_ESP_HOSTED_ENABLED) #include #include @@ -251,4 +251,4 @@ const FirmwareOps* esp32_esp_hosted_ota_get_ops() { return &firmwareOps; } -#endif // CONFIG_SLAVE_SOC_WIFI_SUPPORTED +#endif // CONFIG_ESP_HOSTED_ENABLED diff --git a/Platforms/platform-esp32/source/drivers/esp32_i8080.cpp b/Platforms/platform-esp32/source/drivers/esp32_i8080.cpp index 4ec072d6d..b4852c56a 100644 --- a/Platforms/platform-esp32/source/drivers/esp32_i8080.cpp +++ b/Platforms/platform-esp32/source/drivers/esp32_i8080.cpp @@ -110,8 +110,7 @@ static error_t start(Device* device) { }, .bus_width = 8, .max_transfer_bytes = static_cast(config->max_transfer_bytes), - .psram_trans_align = 64, - .sram_trans_align = 4 + .dma_burst_size = 64, }; esp_err_t ret = esp_lcd_new_i80_bus(&bus_cfg, &data->bus_handle); diff --git a/Platforms/platform-esp32/source/drivers/esp32_wifi.cpp b/Platforms/platform-esp32/source/drivers/esp32_wifi.cpp index 248bfa69a..4ea88d9a8 100644 --- a/Platforms/platform-esp32/source/drivers/esp32_wifi.cpp +++ b/Platforms/platform-esp32/source/drivers/esp32_wifi.cpp @@ -20,7 +20,7 @@ #include -#if defined(CONFIG_SLAVE_SOC_WIFI_SUPPORTED) +#if defined(CONFIG_ESP_HOSTED_ENABLED) #include #endif @@ -81,8 +81,6 @@ WifiAuthenticationType to_wifi_authentication_type(wifi_auth_mode_t mode) { case WIFI_AUTH_WAPI_PSK: return WIFI_AUTHENTICATION_TYPE_WAPI_PSK; case WIFI_AUTH_OWE: return WIFI_AUTHENTICATION_TYPE_OWE; case WIFI_AUTH_WPA3_ENT_192: return WIFI_AUTHENTICATION_TYPE_WPA3_ENT_192; - case WIFI_AUTH_WPA3_EXT_PSK: return WIFI_AUTHENTICATION_TYPE_WPA3_EXT_PSK; - case WIFI_AUTH_WPA3_EXT_PSK_MIXED_MODE: return WIFI_AUTHENTICATION_TYPE_WPA3_EXT_PSK_MIXED_MODE; default: return WIFI_AUTHENTICATION_TYPE_OPEN; } } @@ -585,7 +583,7 @@ error_t api_get_firmware_ops(Device* /*device*/, const FirmwareOps** ops, void** if (ops == nullptr || ctx == nullptr) { return ERROR_INVALID_ARGUMENT; } -#if defined(CONFIG_SLAVE_SOC_WIFI_SUPPORTED) +#if defined(CONFIG_ESP_HOSTED_ENABLED) // Only meaningful on a hosted board (P4+C6/C5 etc.) - this wifi device is backed by a real // co-processor with its own updatable firmware there. On a native (non-hosted) chip, this // device's "radio" is the chip's own built-in WiFi, nothing to update via this interface. diff --git a/Tactility/CMakeLists.txt b/Tactility/CMakeLists.txt index ad3b563f8..37d05fa91 100644 --- a/Tactility/CMakeLists.txt +++ b/Tactility/CMakeLists.txt @@ -66,7 +66,7 @@ if (DEFINED ENV{ESP_IDF_VERSION}) esp_http_client esp-tls esp_wifi - json # Effectively cJSON + espressif__cjson nvs_flash spiffs vfs diff --git a/Tactility/Source/app/apphub/AppHubApp.cpp b/Tactility/Source/app/apphub/AppHubApp.cpp index cc1ec12d7..702632778 100644 --- a/Tactility/Source/app/apphub/AppHubApp.cpp +++ b/Tactility/Source/app/apphub/AppHubApp.cpp @@ -25,6 +25,7 @@ #include #include #include +#include namespace tt::app::apphub { @@ -125,7 +126,7 @@ void showApps(Context* ctx) { std::erase_if(ctx->entries, [](const AppHubEntry& entry) { #ifdef ESP_PLATFORM return !entry.targetPlatforms.empty() && - std::ranges::find(entry.targetPlatforms, CONFIG_IDF_TARGET) == entry.targetPlatforms.end(); + std::ranges::find(entry.targetPlatforms, std::string_view(CONFIG_IDF_TARGET)) == entry.targetPlatforms.end(); #else (void)entry; return false; diff --git a/Tactility/Source/service/espnow/EspNowBackendHosted.cpp b/Tactility/Source/service/espnow/EspNowBackendHosted.cpp index b6966795e..ca48054b2 100644 --- a/Tactility/Source/service/espnow/EspNowBackendHosted.cpp +++ b/Tactility/Source/service/espnow/EspNowBackendHosted.cpp @@ -2,7 +2,7 @@ #include #endif -#if defined(CONFIG_SLAVE_SOC_WIFI_SUPPORTED) +#if defined(CONFIG_ESP_HOSTED_ENABLED) #include #include @@ -310,4 +310,4 @@ uint32_t getVersion() { } -#endif // CONFIG_SLAVE_SOC_WIFI_SUPPORTED +#endif // CONFIG_ESP_HOSTED_ENABLED diff --git a/Tactility/Source/service/espnow/EspNowBackendNative.cpp b/Tactility/Source/service/espnow/EspNowBackendNative.cpp index 93b8bc65f..10597cdf7 100644 --- a/Tactility/Source/service/espnow/EspNowBackendNative.cpp +++ b/Tactility/Source/service/espnow/EspNowBackendNative.cpp @@ -2,7 +2,7 @@ #include #endif -#if defined(CONFIG_SOC_WIFI_SUPPORTED) && !defined(CONFIG_SLAVE_SOC_WIFI_SUPPORTED) +#if defined(CONFIG_SOC_WIFI_SUPPORTED) && !defined(CONFIG_ESP_HOSTED_ENABLED) #include #include @@ -205,4 +205,4 @@ uint32_t getVersion() { } -#endif // CONFIG_SOC_WIFI_SUPPORTED && !CONFIG_SLAVE_SOC_WIFI_SUPPORTED +#endif // CONFIG_SOC_WIFI_SUPPORTED && !CONFIG_ESP_HOSTED_ENABLED diff --git a/Tactility/idf_component.yml b/Tactility/idf_component.yml index 50347201d..e513d89d7 100644 --- a/Tactility/idf_component.yml +++ b/Tactility/idf_component.yml @@ -1,4 +1,5 @@ dependencies: + espressif/cjson: "^1.7.19" espressif/esp_codec_dev: "1.5.10" espressif/esp_video: version: "2.2.0" @@ -17,11 +18,11 @@ dependencies: rules: - if: "target in [esp32, esp32s3]" atanisoft/esp_lcd_ili9488: - version: "1.0.10" + version: "1.1.1" rules: - if: "target in [esp32, esp32s3]" - teriyakigod/esp_lcd_st7735: - version: "0.0.1" + waveshare/esp_lcd_st7735: + version: "2.0.0" rules: - if: "target in [esp32, esp32s3]" espressif/elf_loader: "1.3.3" @@ -36,16 +37,16 @@ dependencies: espressif/esp_lcd_axs15231b: "2.0.2" lambage/esp_lcd_touch_ft6336u: "1.0.8" espressif/esp_lcd_st7701: - version: "1.1.3" + version: "2.0.2~2" rules: - if: "target in [esp32s3, esp32p4]" espressif/esp_lcd_st7796: version: "1.3.4" rules: - if: "target in [esp32, esp32s3]" - espressif/esp_lcd_gc9a01: "2.0.3" + espressif/esp_lcd_gc9a01: "2.0.4" espressif/esp_lcd_jd9165: - version: "1.0.3" + version: "2.0.2" rules: # More hardware seems to be supported - enable as needed - if: "target in [esp32p4]" @@ -91,8 +92,8 @@ dependencies: rules: - if: "target in [esp32s3, esp32p4]" jgromes/radiolib: - version: "7.3.0" + version: "7.7.1" rules: - if: "target in [esp32, esp32s3, esp32p4]" - idf: '5.5.2' + idf: '6.1.0' diff --git a/device.py b/device.py index aaa6c58e7..d3b872a5a 100644 --- a/device.py +++ b/device.py @@ -150,6 +150,13 @@ def write_core_variables(output_file, device_properties: dict): idf_target = get_property_or_exit(device_properties, "hardware.target").lower() output_file.write("# Target\n") output_file.write(f"CONFIG_IDF_TARGET=\"{idf_target}\"\n") + # ESP-IDF 6.x defaults default warnings (incl. -Wmissing-field-initializers) to errors; + # this codebase's designated initializers rely on the old warn-only behavior. + output_file.write("CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS=y\n") + # ESP-IDF 6.x defaults to Picolibc, which drops per-task stdio redirection and some + # newlib-internal symbols (_ctype_, __getreent) this repo's ELF-loader ABI exports. + # Stay on Newlib rather than re-auditing every per-task stdio assumption. + output_file.write("CONFIG_LIBC_NEWLIB=y\n") output_file.write("# CPU\n") output_file.write("CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y\n") output_file.write("CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240\n") @@ -157,8 +164,8 @@ def write_core_variables(output_file, device_properties: dict): output_file.write(f"CONFIG_{idf_target.upper()}_DEFAULT_CPU_FREQ_MHZ=240\n") if idf_target != "esp32": # Not available on original ESP32 output_file.write("# Enable usage of MALLOC_CAP_EXEC on IRAM:\n") - output_file.write("CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=n\n") - output_file.write("CONFIG_ESP_SYSTEM_MEMPROT_FEATURE_LOCK=n\n") + output_file.write("CONFIG_ESP_SYSTEM_MEMPROT=n\n") + output_file.write("CONFIG_ESP_SYSTEM_MEMPROT_PMS_LOCK=n\n") else: # Original ESP32 has very limited IRAM (~328KB shared with Wi-Fi/BT). # Disable Wi-Fi IRAM optimizations to free ~27KB; throughput impact is @@ -181,6 +188,13 @@ def write_flash_variables(output_file, device_properties: dict): esptool_flash_freq = get_property_or_none(device_properties, "hardware.esptoolFlashFreq") if esptool_flash_freq is not None: output_file.write(f"CONFIG_ESPTOOLPY_FLASHFREQ_{esptool_flash_freq}=y\n") + if esptool_flash_freq == "120M": + # >80MHz flash needs HPM; HPM-DC (dummy-cycle auto-tuning) requires a bootloader + # built with BOOTLOADER_FLASH_DC_AWARE, which existing units in the field don't have - + # disable it rather than force a bootloader reflash. + output_file.write("CONFIG_SPI_FLASH_HPM_ENA=y\n") + output_file.write("# CONFIG_SPI_FLASH_HPM_AUTO is not set\n") + output_file.write("CONFIG_SPI_FLASH_HPM_DC_DISABLE=y\n") def write_spiram_variables(output_file, device_properties: dict): idf_target = get_property_or_exit(device_properties, "hardware.target").lower()