fix(xip): fixed xip example

This commit is contained in:
armando
2026-04-09 16:04:37 +08:00
parent b07620afb6
commit bb2fd61013
3 changed files with 24 additions and 7 deletions
-4
View File
@@ -305,7 +305,3 @@ examples/system/xip_from_psram:
disable:
- if: IDF_TARGET == "esp32"
reason: target esp32 doesn't support this feature.
disable_test:
- if: IDF_TARGET == "esp32s31"
temporary: true
reason: cannot pass # TODO: IDF-15526
@@ -14,7 +14,7 @@
#include "esp_flash.h"
#include "esp_timer.h"
#if CONFIG_IDF_TARGET_ESP32C5 || CONFIG_IDF_TARGET_ESP32C61
#if CONFIG_IDF_TARGET_ESP32C5 || CONFIG_IDF_TARGET_ESP32C61 || CONFIG_IDF_TARGET_ESP32S31
#define EXAMPLE_TIMER_ALERT_TIME (1 * 3 * 1000)
#else
#define EXAMPLE_TIMER_ALERT_TIME (1 * 10 * 1000)
@@ -64,7 +64,7 @@ void app_main(void)
static IRAM_ATTR void NOINLINE_ATTR oneshot_timer_callback(void* arg)
{
bool in_psram = (bool*) arg;
bool in_psram = *(bool*) arg;
time_cb_start = esp_timer_get_time();
if (in_psram == true) {
cb_in_psram();
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded.dut import Dut
@@ -27,6 +27,27 @@ def test_xip_from_psram_example_generic(dut: Dut) -> None:
assert float(response_time) <= 12
@pytest.mark.generic
@pytest.mark.parametrize(
'config',
[
'generic',
],
indirect=True,
)
@idf_parametrize('target', ['esp32s31'], indirect=['target'])
def test_xip_from_psram_example_s31(dut: Dut) -> None:
dut.expect_exact('found partition')
res = dut.expect(r'callback\(in PSRAM\) response time: (\d{1,3}) us')
response_time = res.group(1).decode('utf8')
assert float(response_time) <= 5
res = dut.expect(r'callback\(in IRAM\) response time: (\d{1,3}) us')
response_time = res.group(1).decode('utf8')
assert float(response_time) <= 5
@pytest.mark.MSPI_F4R8
@pytest.mark.parametrize(
'config',