From b1f0ffffc36e7bcd1ebba5a87eae5aa9e4e9a942 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 3 Apr 2020 14:51:37 +0200 Subject: [PATCH 1/2] ci: add UT job --- tools/ci/config/target-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci/config/target-test.yml b/tools/ci/config/target-test.yml index 980b777eb..78e128abb 100644 --- a/tools/ci/config/target-test.yml +++ b/tools/ci/config/target-test.yml @@ -495,7 +495,7 @@ UT_034: UT_035: extends: .unit_test_s2_template - parallel: 32 + parallel: 33 tags: - ESP32S2_IDF - UT_T1_1 From a0e66fef0880dba2caf93e9cb9c65cff7dc9b880 Mon Sep 17 00:00:00 2001 From: "Michael (XIAO Xufeng)" Date: Thu, 2 Apr 2020 14:56:33 +0800 Subject: [PATCH 2/2] spi: fix the memory accessed while cache disabled issue in the bus lock when log level is verbose When CONFIG_LOG_DEFAULT_LEVEL is verbose, the ESP_(EARLY_)LOGx will try to print with format string and tag out of the DRAM while the cache is disabled. This commit puts the TAG into DRAM, and uses the 'ESP_DRAM_LOGx` to fix the cache miss bug. Also fixes a LoadProhibited issue when last_dev is NULL. --- components/driver/spi_bus_lock.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/driver/spi_bus_lock.c b/components/driver/spi_bus_lock.c index 022567045..b50b1ec02 100644 --- a/components/driver/spi_bus_lock.c +++ b/components/driver/spi_bus_lock.c @@ -224,7 +224,7 @@ struct spi_bus_lock_dev_t { uint32_t mask; ///< Bitwise OR-ed mask of the REQ, PEND, LOCK bits of this device }; -static const char TAG[] = "bus_lock"; +DRAM_ATTR static const char TAG[] = "bus_lock"; #define LOCK_CHECK(a, str, ret_val, ...) \ if (!(a)) { \ @@ -656,8 +656,10 @@ IRAM_ATTR bool spi_bus_lock_touch(spi_bus_lock_dev_handle_t dev_handle) { spi_bus_lock_dev_t* last_dev = dev_handle->parent->last_dev; dev_handle->parent->last_dev = dev_handle; - ESP_EARLY_LOGD(TAG, "SPI dev changed from %d to %d", - dev_lock_get_id(last_dev), dev_lock_get_id(dev_handle)); + if (last_dev) { + ESP_DRAM_LOGD(TAG, "SPI dev changed from %d to %d", + dev_lock_get_id(last_dev), dev_lock_get_id(dev_handle)); + } return (dev_handle != last_dev); } @@ -679,7 +681,7 @@ IRAM_ATTR esp_err_t spi_bus_lock_acquire_start(spi_bus_lock_dev_t *dev_handle, T if (err != ESP_OK) return err; } - ESP_LOGV(TAG, "dev %d acquired.", dev_lock_get_id(dev_handle)); + ESP_DRAM_LOGV(TAG, "dev %d acquired.", dev_lock_get_id(dev_handle)); BUS_LOCK_DEBUG_EXECUTE_CHECK(lock->acquiring_dev == dev_handle); //When arrives at here, requests of this device should already be handled