Skip to content

Commit fdc86f8

Browse files
committed
Merge branch 'fix/tee_hal_ci_failures' into 'master'
ci(hal/tee): Fix intermittent hang-ups in `PERI_APM` tests on ESP32-C5 Closes IDFCI-3274, IDFCI-4807, and IDFCI-4808 See merge request espressif/esp-idf!42937
2 parents b9eb99d + bcfe915 commit fdc86f8

File tree

3 files changed

+17
-23
lines changed

3 files changed

+17
-23
lines changed

components/hal/test_apps/tee/components/pms_and_cpu_intr/src/cpu_intr/test_vectors_m.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ _test_panic_handler:
252252

253253
/* Executing the panic handler */
254254
li t0, 0xDEADC0DE
255-
csrr t0, mscratch
255+
csrw mscratch, t0
256256
mv a0, sp
257257
csrr a1, mcause
258258
li t0, VECTORS_MCAUSE_REASON_MASK

components/hal/test_apps/tee/components/pms_and_cpu_intr/src/pms/test_tee_peri_apm.c

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -76,35 +76,29 @@ static const uint32_t test_peri_apm_lp_peri_reg[] = {
7676
BIT64(APM_TEE_LP_PERIPH_LP_PERI) | \
7777
BIT64(APM_TEE_LP_PERIPH_LP_APM))
7878

79-
IRAM_ATTR static uint32_t reg_read(uint32_t addr)
79+
FORCE_INLINE_ATTR uint32_t reg_read(uint32_t addr)
8080
{
81-
uint32_t val;
82-
asm volatile (
83-
"li t0, 0x100\n"
84-
"lw %0, 0(%1)\n"
85-
"1:\n"
86-
"nop\n"
87-
"addi t0, t0, -1\n"
88-
"bnez t0, 1b\n"
89-
: "=r"(val)
81+
uint32_t value;
82+
__asm__ volatile (
83+
"lw %0, 0(%1)\n"
84+
"fence\n"
85+
"nop\nnop\nnop\nnop\n"
86+
: "=r"(value)
9087
: "r"(addr)
91-
: "t0", "memory"
88+
: "memory"
9289
);
93-
return val;
90+
return value;
9491
}
9592

96-
IRAM_ATTR static void reg_write(uint32_t addr, uint32_t value)
93+
FORCE_INLINE_ATTR void reg_write(uint32_t addr, uint32_t value)
9794
{
98-
asm volatile (
99-
"li t0, 0x100\n"
100-
"sw %1, 0(%0)\n"
101-
"1:\n"
102-
"nop\n"
103-
"addi t0, t0, -1\n"
104-
"bnez t0, 1b\n"
95+
__asm__ volatile (
96+
"sw %1, 0(%0)\n"
97+
"fence\n"
98+
"nop\nnop\nnop\nnop\n"
10599
:
106100
: "r"(addr), "r"(value)
107-
: "t0", "memory"
101+
: "memory"
108102
);
109103
}
110104

components/hal/test_apps/tee/pytest_pms_and_cpu_intr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ def test_tee_peri_apm(dut: IdfDut) -> None:
5858
indirect=['config', 'target'],
5959
)
6060
def test_tee_interrupts(dut: IdfDut) -> None:
61-
dut.run_all_single_board_cases()
61+
dut.run_all_single_board_cases(group='CPU')

0 commit comments

Comments
 (0)