Skip to content

Commit a1e3083

Browse files
wearyzenkartben
authored andcommitted
tests: arm: adjust test for relocated rom
Add a memory barrier to make sure write to NVIC is completed before continuing with the test fails in scenarios where CONFIG_ROMSTART_RELOCATION_ROM is enabled for boards like MPS3 Corstone310 and k_sem_take is called before the isr's are called. Signed-off-by: Sudan Landge <[email protected]>
1 parent 5f91f17 commit a1e3083

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/arch/arm/arm_irq_vector_table/src/arm_irq_vector_table.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,15 @@ ZTEST(vector_table, test_arm_irq_vector_table)
119119
#endif
120120
}
121121

122+
/*
123+
* It is recommended to have a DSB followed by ISB while
124+
* enabling interrupts using NVIC. Also without this, the
125+
* test fails in scenarios where CONFIG_ROMSTART_RELOCATION_ROM is
126+
* enabled e.g. MPS3 Corstone310.
127+
*/
128+
__DSB(); /* Ensure write to NVIC completes before continuing */
129+
__ISB(); /* Ensure that IRQ is executed */
130+
122131
zassert_false((k_sem_take(&sem[0], K_NO_WAIT) || k_sem_take(&sem[1], K_NO_WAIT) ||
123132
k_sem_take(&sem[2], K_NO_WAIT)),
124133
NULL);

0 commit comments

Comments
 (0)