diff --git a/components/esp_driver_i2c/i2c_master.c b/components/esp_driver_i2c/i2c_master.c index c31dbe4ded..356ff1a0c0 100644 --- a/components/esp_driver_i2c/i2c_master.c +++ b/components/esp_driver_i2c/i2c_master.c @@ -850,7 +850,7 @@ static esp_err_t i2c_master_bus_destroy(i2c_master_bus_handle_t bus_handle) free(i2c_master->i2c_async_ops); for (int i = 0; i < I2C_TRANS_QUEUE_MAX; i++) { if (i2c_master->trans_queues[i]) { - vQueueDelete(i2c_master->trans_queues[i]); + vQueueDeleteWithCaps(i2c_master->trans_queues[i]); } } bus_handle = NULL; @@ -1055,7 +1055,7 @@ esp_err_t i2c_new_master_bus(const i2c_master_bus_config_t *bus_config, i2c_mast ESP_RETURN_ON_FALSE(i2c_master->queues_storage, ESP_ERR_NO_MEM, TAG, "no mem for queue storage"); i2c_transaction_t **pp_trans_desc = (i2c_transaction_t **)i2c_master->queues_storage; for (int i = 0; i < I2C_TRANS_QUEUE_MAX; i++) { - i2c_master->trans_queues[i] = xQueueCreate(bus_config->trans_queue_depth, sizeof(i2c_transaction_t)); + i2c_master->trans_queues[i] = xQueueCreateWithCaps(bus_config->trans_queue_depth, sizeof(i2c_transaction_t), I2C_MEM_ALLOC_CAPS); pp_trans_desc += bus_config->trans_queue_depth; // sanity check @@ -1116,7 +1116,7 @@ esp_err_t i2c_master_bus_add_device(i2c_master_bus_handle_t bus_handle, const i2 i2c_dev->ack_check_disable = dev_config->flags.disable_ack_check; i2c_dev->scl_wait_us = (dev_config->scl_wait_us == 0) ? I2C_LL_SCL_WAIT_US_VAL_DEFAULT : dev_config->scl_wait_us; - i2c_master_device_list_t *device_item = (i2c_master_device_list_t *)calloc(1, sizeof(i2c_master_device_list_t)); + i2c_master_device_list_t *device_item = (i2c_master_device_list_t *)heap_caps_calloc(1, sizeof(i2c_master_device_list_t), I2C_MEM_ALLOC_CAPS); ESP_GOTO_ON_FALSE((device_item != NULL), ESP_ERR_NO_MEM, err, TAG, "no memory for i2c device item`"); device_item->device = i2c_dev; xSemaphoreTake(bus_handle->bus_lock_mux, portMAX_DELAY); diff --git a/components/esp_driver_i2c/test_apps/i2c_test_apps/main/CMakeLists.txt b/components/esp_driver_i2c/test_apps/i2c_test_apps/main/CMakeLists.txt index 2f653da9ae..0727e6f18b 100644 --- a/components/esp_driver_i2c/test_apps/i2c_test_apps/main/CMakeLists.txt +++ b/components/esp_driver_i2c/test_apps/i2c_test_apps/main/CMakeLists.txt @@ -33,5 +33,5 @@ if(CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP AND CONFIG_IEEE802154_ENABLED) endif() idf_component_register(SRCS ${srcs} - PRIV_REQUIRES unity driver test_utils ieee802154 + PRIV_REQUIRES unity driver test_utils ieee802154 esp_psram WHOLE_ARCHIVE) diff --git a/components/esp_driver_i2c/test_apps/i2c_test_apps/sdkconfig.defaults.esp32c5 b/components/esp_driver_i2c/test_apps/i2c_test_apps/sdkconfig.defaults.esp32c5 new file mode 100644 index 0000000000..5df612aa4f --- /dev/null +++ b/components/esp_driver_i2c/test_apps/i2c_test_apps/sdkconfig.defaults.esp32c5 @@ -0,0 +1,3 @@ +CONFIG_SPIRAM=y +CONFIG_SPIRAM_SPEED_80M=y +CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0