From b115acea40b2381bc00e07944d926fe726d05ef5 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Thu, 1 May 2025 02:15:03 +0300 Subject: [PATCH] IDF master (#11289) * fix(libs): Ensure compilation with ESP32-C5 * fix(i2c): Update I2C Slave init call * IDF master 465b159c * ci(simple_ble): Add check for BLE supported * IDF master 38628f98 --------- Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> --- cores/esp32/esp32-hal-i2c-slave.c | 7 ++ idf_component.yml | 18 ++--- libraries/BluetoothSerial/src/BTAddress.cpp | 4 +- libraries/BluetoothSerial/src/BTAddress.h | 4 +- .../BluetoothSerial/src/BTAdvertisedDevice.h | 6 +- .../src/BTAdvertisedDeviceSet.cpp | 4 +- libraries/BluetoothSerial/src/BTScan.h | 7 +- .../BluetoothSerial/src/BTScanResultsSet.cpp | 4 +- .../BluetoothSerial/src/BluetoothSerial.cpp | 3 +- .../BluetoothSerial/src/BluetoothSerial.h | 3 +- .../examples/SimpleBleDevice/ci.json | 1 + libraries/SimpleBLE/src/SimpleBLE.cpp | 3 +- libraries/SimpleBLE/src/SimpleBLE.h | 3 +- package/package_esp32_index.template.json | 68 +++++++++---------- 14 files changed, 80 insertions(+), 55 deletions(-) diff --git a/cores/esp32/esp32-hal-i2c-slave.c b/cores/esp32/esp32-hal-i2c-slave.c index 0e01259da..1d92a55ae 100644 --- a/cores/esp32/esp32-hal-i2c-slave.c +++ b/cores/esp32/esp32-hal-i2c-slave.c @@ -43,6 +43,7 @@ #include "soc/i2c_struct.h" #include "soc/periph_defs.h" #include "hal/i2c_ll.h" +#include "hal/i2c_types.h" #ifndef CONFIG_IDF_TARGET_ESP32C5 #include "hal/clk_gate_ll.h" #endif @@ -337,7 +338,13 @@ esp_err_t i2cSlaveInit(uint8_t num, int sda, int scl, uint16_t slaveID, uint32_t } #endif // !defined(CONFIG_IDF_TARGET_ESP32P4) +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 5, 0) + i2c_ll_set_mode(i2c->dev, I2C_BUS_MODE_SLAVE); + i2c_ll_enable_pins_open_drain(i2c->dev, true); +#else i2c_ll_slave_init(i2c->dev); +#endif + #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) i2c_ll_enable_fifo_mode(i2c->dev, true); #else diff --git a/idf_component.yml b/idf_component.yml index c1fc614ca..f0e3f84b2 100644 --- a/idf_component.yml +++ b/idf_component.yml @@ -57,12 +57,12 @@ dependencies: version: "==1.6.3" require: public rules: - - if: "target not in [esp32c2, esp32p4]" + - if: "target not in [esp32c2, esp32p4, esp32c5]" espressif/esp-zigbee-lib: version: "==1.6.3" require: public rules: - - if: "target not in [esp32c2, esp32p4]" + - if: "target not in [esp32c2, esp32p4, esp32c5]" espressif/esp-dsp: version: "^1.3.4" rules: @@ -73,32 +73,32 @@ dependencies: espressif/esp_rainmaker: version: "1.5.2" rules: - - if: "target not in [esp32c2, esp32p4]" + - if: "target not in [esp32c2, esp32p4, esp32c5]" espressif/rmaker_common: version: "1.4.6" rules: - - if: "target not in [esp32c2, esp32p4]" + - if: "target not in [esp32c2, esp32p4, esp32c5]" espressif/esp_insights: version: "1.2.2" rules: - - if: "target not in [esp32c2, esp32p4]" + - if: "target not in [esp32c2, esp32p4, esp32c5]" # New version breaks esp_insights 1.0.1 espressif/esp_diag_data_store: version: "1.0.2" rules: - - if: "target not in [esp32c2, esp32p4]" + - if: "target not in [esp32c2, esp32p4, esp32c5]" espressif/esp_diagnostics: version: "1.2.1" rules: - - if: "target not in [esp32c2, esp32p4]" + - if: "target not in [esp32c2, esp32p4, esp32c5]" espressif/cbor: version: "0.6.0~1" rules: - - if: "target not in [esp32c2, esp32p4]" + - if: "target not in [esp32c2, esp32p4, esp32c5]" espressif/qrcode: version: "0.1.0~2" rules: - - if: "target not in [esp32c2, esp32p4]" + - if: "target not in [esp32c2, esp32p4, esp32c5]" # RainMaker End espressif/esp-sr: version: "^1.4.2" diff --git a/libraries/BluetoothSerial/src/BTAddress.cpp b/libraries/BluetoothSerial/src/BTAddress.cpp index 6a6de6522..6dc05f3aa 100644 --- a/libraries/BluetoothSerial/src/BTAddress.cpp +++ b/libraries/BluetoothSerial/src/BTAddress.cpp @@ -7,7 +7,9 @@ * Author: Thomas M. (ArcticSnowSky) */ #include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) +#include "soc/soc_caps.h" + +#if SOC_BT_SUPPORTED && defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) #include "BTAddress.h" #include diff --git a/libraries/BluetoothSerial/src/BTAddress.h b/libraries/BluetoothSerial/src/BTAddress.h index a2af9247f..ece3ae835 100644 --- a/libraries/BluetoothSerial/src/BTAddress.h +++ b/libraries/BluetoothSerial/src/BTAddress.h @@ -10,7 +10,9 @@ #ifndef COMPONENTS_CPP_UTILS_BTADDRESS_H_ #define COMPONENTS_CPP_UTILS_BTADDRESS_H_ #include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) +#include "soc/soc_caps.h" + +#if SOC_BT_SUPPORTED && defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) #include // ESP32 BT #include diff --git a/libraries/BluetoothSerial/src/BTAdvertisedDevice.h b/libraries/BluetoothSerial/src/BTAdvertisedDevice.h index 63c19c908..53aa2629b 100644 --- a/libraries/BluetoothSerial/src/BTAdvertisedDevice.h +++ b/libraries/BluetoothSerial/src/BTAdvertisedDevice.h @@ -5,9 +5,11 @@ * Author: Thomas M. (ArcticSnowSky) */ -#ifndef __BTADVERTISEDDEVICE_H__ -#define __BTADVERTISEDDEVICE_H__ +#pragma once +#include "sdkconfig.h" +#include "soc/soc_caps.h" +#if SOC_BT_SUPPORTED && defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) #include "BTAddress.h" #include diff --git a/libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp b/libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp index ed6076a31..9afc28547 100644 --- a/libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp +++ b/libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp @@ -6,7 +6,9 @@ */ #include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) +#include "soc/soc_caps.h" + +#if SOC_BT_SUPPORTED && defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) //#include diff --git a/libraries/BluetoothSerial/src/BTScan.h b/libraries/BluetoothSerial/src/BTScan.h index a08f68cd7..6fd2daf9f 100644 --- a/libraries/BluetoothSerial/src/BTScan.h +++ b/libraries/BluetoothSerial/src/BTScan.h @@ -5,8 +5,11 @@ * Author: Thomas M. (ArcticSnowSky) */ -#ifndef __BTSCAN_H__ -#define __BTSCAN_H__ +#pragma once +#include "sdkconfig.h" +#include "soc/soc_caps.h" + +#if SOC_BT_SUPPORTED && defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) #include #include diff --git a/libraries/BluetoothSerial/src/BTScanResultsSet.cpp b/libraries/BluetoothSerial/src/BTScanResultsSet.cpp index 3633c010e..02459b081 100644 --- a/libraries/BluetoothSerial/src/BTScanResultsSet.cpp +++ b/libraries/BluetoothSerial/src/BTScanResultsSet.cpp @@ -6,7 +6,9 @@ */ #include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) +#include "soc/soc_caps.h" + +#if SOC_BT_SUPPORTED && defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) #include diff --git a/libraries/BluetoothSerial/src/BluetoothSerial.cpp b/libraries/BluetoothSerial/src/BluetoothSerial.cpp index 3d00504c1..b7eede93e 100644 --- a/libraries/BluetoothSerial/src/BluetoothSerial.cpp +++ b/libraries/BluetoothSerial/src/BluetoothSerial.cpp @@ -19,8 +19,9 @@ #include #include "freertos/FreeRTOS.h" #include "freertos/task.h" +#include "soc/soc_caps.h" -#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) +#if SOC_BT_SUPPORTED && defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) #ifdef ARDUINO_ARCH_ESP32 #include "esp32-hal-log.h" diff --git a/libraries/BluetoothSerial/src/BluetoothSerial.h b/libraries/BluetoothSerial/src/BluetoothSerial.h index d59fbf1f7..8cb6edb87 100644 --- a/libraries/BluetoothSerial/src/BluetoothSerial.h +++ b/libraries/BluetoothSerial/src/BluetoothSerial.h @@ -16,8 +16,9 @@ #define _BLUETOOTH_SERIAL_H_ #include "sdkconfig.h" +#include "soc/soc_caps.h" -#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) +#if SOC_BT_SUPPORTED && defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) #include "Arduino.h" #include "Stream.h" diff --git a/libraries/SimpleBLE/examples/SimpleBleDevice/ci.json b/libraries/SimpleBLE/examples/SimpleBleDevice/ci.json index d33a23f33..3b6a150b3 100644 --- a/libraries/SimpleBLE/examples/SimpleBleDevice/ci.json +++ b/libraries/SimpleBLE/examples/SimpleBleDevice/ci.json @@ -1,5 +1,6 @@ { "requires": [ + "CONFIG_SOC_BLE_SUPPORTED=y", "CONFIG_BT_ENABLED=y", "CONFIG_BLUEDROID_ENABLED=y" ] diff --git a/libraries/SimpleBLE/src/SimpleBLE.cpp b/libraries/SimpleBLE/src/SimpleBLE.cpp index 3c4ed915c..3f1f2bbd1 100644 --- a/libraries/SimpleBLE/src/SimpleBLE.cpp +++ b/libraries/SimpleBLE/src/SimpleBLE.cpp @@ -13,8 +13,9 @@ // limitations under the License. #include "sdkconfig.h" +#include "soc/soc_caps.h" -#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) +#if SOC_BT_SUPPORTED && defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) #include "SimpleBLE.h" #include "esp32-hal-log.h" diff --git a/libraries/SimpleBLE/src/SimpleBLE.h b/libraries/SimpleBLE/src/SimpleBLE.h index 23c1cdb59..df1ee751f 100644 --- a/libraries/SimpleBLE/src/SimpleBLE.h +++ b/libraries/SimpleBLE/src/SimpleBLE.h @@ -16,8 +16,9 @@ #define _SIMPLE_BLE_H_ #include "sdkconfig.h" +#include "soc/soc_caps.h" -#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) +#if SOC_BT_SUPPORTED && defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) #include #include diff --git a/package/package_esp32_index.template.json b/package/package_esp32_index.template.json index a0d78ebc4..63027704d 100644 --- a/package/package_esp32_index.template.json +++ b/package/package_esp32_index.template.json @@ -51,7 +51,7 @@ { "packager": "esp32", "name": "esp32-arduino-libs", - "version": "idf-master-d930a386-v1" + "version": "idf-master-38628f98-v1" }, { "packager": "esp32", @@ -104,63 +104,63 @@ "tools": [ { "name": "esp32-arduino-libs", - "version": "idf-master-d930a386-v1", + "version": "idf-master-38628f98-v1", "systems": [ { "host": "i686-mingw32", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-master/esp32-arduino-libs-idf-master-d930a386-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-master-d930a386-v1.zip", - "checksum": "SHA-256:0310daa4f08f807f2bf3babd2587c2694df64c70e367863eadf5020636b717ae", - "size": "422376381" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-master/esp32-arduino-libs-idf-master-38628f98-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-master-38628f98-v1.zip", + "checksum": "SHA-256:efc30a38cccff38c36a86fd3db78aeb13594da60ccf49bc7971b7a9f849abcdf", + "size": "398323971" }, { "host": "x86_64-mingw32", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-master/esp32-arduino-libs-idf-master-d930a386-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-master-d930a386-v1.zip", - "checksum": "SHA-256:0310daa4f08f807f2bf3babd2587c2694df64c70e367863eadf5020636b717ae", - "size": "422376381" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-master/esp32-arduino-libs-idf-master-38628f98-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-master-38628f98-v1.zip", + "checksum": "SHA-256:efc30a38cccff38c36a86fd3db78aeb13594da60ccf49bc7971b7a9f849abcdf", + "size": "398323971" }, { "host": "arm64-apple-darwin", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-master/esp32-arduino-libs-idf-master-d930a386-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-master-d930a386-v1.zip", - "checksum": "SHA-256:0310daa4f08f807f2bf3babd2587c2694df64c70e367863eadf5020636b717ae", - "size": "422376381" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-master/esp32-arduino-libs-idf-master-38628f98-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-master-38628f98-v1.zip", + "checksum": "SHA-256:efc30a38cccff38c36a86fd3db78aeb13594da60ccf49bc7971b7a9f849abcdf", + "size": "398323971" }, { "host": "x86_64-apple-darwin", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-master/esp32-arduino-libs-idf-master-d930a386-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-master-d930a386-v1.zip", - "checksum": "SHA-256:0310daa4f08f807f2bf3babd2587c2694df64c70e367863eadf5020636b717ae", - "size": "422376381" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-master/esp32-arduino-libs-idf-master-38628f98-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-master-38628f98-v1.zip", + "checksum": "SHA-256:efc30a38cccff38c36a86fd3db78aeb13594da60ccf49bc7971b7a9f849abcdf", + "size": "398323971" }, { "host": "x86_64-pc-linux-gnu", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-master/esp32-arduino-libs-idf-master-d930a386-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-master-d930a386-v1.zip", - "checksum": "SHA-256:0310daa4f08f807f2bf3babd2587c2694df64c70e367863eadf5020636b717ae", - "size": "422376381" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-master/esp32-arduino-libs-idf-master-38628f98-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-master-38628f98-v1.zip", + "checksum": "SHA-256:efc30a38cccff38c36a86fd3db78aeb13594da60ccf49bc7971b7a9f849abcdf", + "size": "398323971" }, { "host": "i686-pc-linux-gnu", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-master/esp32-arduino-libs-idf-master-d930a386-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-master-d930a386-v1.zip", - "checksum": "SHA-256:0310daa4f08f807f2bf3babd2587c2694df64c70e367863eadf5020636b717ae", - "size": "422376381" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-master/esp32-arduino-libs-idf-master-38628f98-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-master-38628f98-v1.zip", + "checksum": "SHA-256:efc30a38cccff38c36a86fd3db78aeb13594da60ccf49bc7971b7a9f849abcdf", + "size": "398323971" }, { "host": "aarch64-linux-gnu", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-master/esp32-arduino-libs-idf-master-d930a386-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-master-d930a386-v1.zip", - "checksum": "SHA-256:0310daa4f08f807f2bf3babd2587c2694df64c70e367863eadf5020636b717ae", - "size": "422376381" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-master/esp32-arduino-libs-idf-master-38628f98-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-master-38628f98-v1.zip", + "checksum": "SHA-256:efc30a38cccff38c36a86fd3db78aeb13594da60ccf49bc7971b7a9f849abcdf", + "size": "398323971" }, { "host": "arm-linux-gnueabihf", - "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-master/esp32-arduino-libs-idf-master-d930a386-v1.zip", - "archiveFileName": "esp32-arduino-libs-idf-master-d930a386-v1.zip", - "checksum": "SHA-256:0310daa4f08f807f2bf3babd2587c2694df64c70e367863eadf5020636b717ae", - "size": "422376381" + "url": "https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-master/esp32-arduino-libs-idf-master-38628f98-v1.zip", + "archiveFileName": "esp32-arduino-libs-idf-master-38628f98-v1.zip", + "checksum": "SHA-256:efc30a38cccff38c36a86fd3db78aeb13594da60ccf49bc7971b7a9f849abcdf", + "size": "398323971" } ] },