Espressif Benchmark ESP-IDF 4.4 fixes

pull/7037/head
gojimmypi 2023-12-06 13:23:14 -08:00
parent 4bd78e5e31
commit f3a9d4a56e
3 changed files with 28 additions and 10 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0"?>
<VisualGDBProjectSettings2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<VisualGDBProjectSettings2 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Project xsi:type="com.visualgdb.project.external.esp-idf">
<CustomSourceDirectories>
<Directories />
@ -220,7 +220,7 @@
<DebugMethod>
<ID>openocd</ID>
<Configuration xsi:type="com.visualgdb.edp.openocd.settings.esp32">
<CommandLine>-f interface/tigard.cfg -c "adapter_khz 15000" -f target/esp32.cfg</CommandLine>
<CommandLine>-f interface/ftdi/tigard.cfg -c "adapter_khz 15000" -f target/esp32.cfg</CommandLine>
<ExtraParameters>
<Frequency xsi:nil="true" />
<BoostedFrequency xsi:nil="true" />

View File

@ -1274,11 +1274,19 @@ static const char* bench_result_words3[][5] = {
#endif /* WOLFSSL_BENCHMARK_TIMER_DEBUG */
/* The ESP32 (both Xtensa and RISC-V have raw CPU counters). */
#define HAVE_GET_CYCLES
#define INIT_CYCLE_COUNTER do { \
ESP_LOGV(TAG, "INIT_CYCLE_COUNTER"); \
esp_cpu_set_cycle_count(0); \
} while (0);
#if ESP_IDF_VERSION_MAJOR >= 5
/* esp_cpu_set_cycle_count() introduced in ESP-IDF v5 */
#define HAVE_GET_CYCLES
#define INIT_CYCLE_COUNTER do { \
ESP_LOGV(TAG, "INIT_CYCLE_COUNTER"); \
esp_cpu_set_cycle_count(0); \
} while (0);
#else
#define HAVE_GET_CYCLES
#define INIT_CYCLE_COUNTER do { \
ESP_LOGV(TAG, "INIT_CYCLE_COUNTER"); \
} while (0);
#endif
#define BEGIN_ESP_CYCLES do { \
ESP_LOGV(TAG, "BEGIN_ESP_CYCLES"); \
@ -1494,7 +1502,11 @@ static const char* bench_result_words3[][5] = {
* when resetting CPU cycle counter? FreeRTOS tick collison?
* thisVal = esp_cpu_get_cycle_count(); See also, above
* or thisVal = xthal_get_ccount(); */
_esp_cpu_count_last = esp_cpu_get_cycle_count();
#if ESP_IDF_VERSION_MAJOR < 5
_esp_cpu_count_last = xthal_get_ccount();
#else
_esp_cpu_count_last = esp_cpu_get_cycle_count();
#endif
#endif
/* Return the 64 bit extended total from 32 bit counter. */

View File

@ -34,8 +34,9 @@
/* Espressif */
#include <esp_log.h>
#include <esp_err.h>
#include <hal/efuse_hal.h>
#if ESP_IDF_VERSION_MAJOR > 4
#include <hal/efuse_hal.h>
#endif
/* wolfSSL */
#include <wolfssl/wolfcrypt/wolfmath.h> /* needed to print MATH_INT_T value */
#include <wolfssl/wolfcrypt/types.h>
@ -452,7 +453,10 @@ int esp_ShowHardwareAcclerationSettings(void)
*/
int ShowExtendedSystemInfo(void)
{
#if ESP_IDF_VERSION_MAJOR > 4
unsigned chip_rev = -1;
#endif
#ifdef HAVE_ESP_CLK
/* esp_clk.h is private */
int cpu_freq = 0;
@ -470,8 +474,10 @@ int ShowExtendedSystemInfo(void)
"Some extended system details not available.");
#endif /* else not HAVE_WC_INTROSPECTION */
#if ESP_IDF_VERSION_MAJOR > 4
chip_rev = efuse_hal_chip_revision();
ESP_LOGI(TAG, "Chip revision: v%d.%d", chip_rev / 100, chip_rev % 100);
#endif
#ifdef HAVE_ESP_CLK
cpu_freq = esp_clk_cpu_freq();