Commit a1e3083d authored by Sudan Landge's avatar Sudan Landge Committed by Benjamin Cabé
Browse files

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: default avatarSudan Landge <sudan.landge@arm.com>
parent 5f91f17e
Loading
Loading
Loading
Loading
+9 −0
Changes for tests/arch/arm/arm_irq_vector_table/src/arm_irq_vector_table.c: 9 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -119,6 +119,15 @@ ZTEST(vector_table, test_arm_irq_vector_table)
#endif
	}

	/*
	 * It is recommended to have a DSB followed by ISB while
	 * enabling interrupts using NVIC. Also without this, the
	 * test fails in scenarios where CONFIG_ROMSTART_RELOCATION_ROM is
	 * enabled e.g. MPS3 Corstone310.
	 */
	__DSB(); /* Ensure write to NVIC completes before continuing */
	__ISB(); /* Ensure that IRQ is executed */

	zassert_false((k_sem_take(&sem[0], K_NO_WAIT) || k_sem_take(&sem[1], K_NO_WAIT) ||
		       k_sem_take(&sem[2], K_NO_WAIT)),
		      NULL);