Skip to content

Commit 3d12e18

Browse files
tests: arch: arm: irq_vector_table: don't printk from ISRs
This rather anchient test suite calls printk from within ISRs. printk() is not declared isr safe, and printk should be avoided from ISRs due to their stack and cpu time requirements. The test suite does not use the printk() output in any case, so the printk() output is simply removed. The README.txt has been updated with the actual output produced by todays test suite, sans the printk() output. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
1 parent 66998ef commit 3d12e18

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

tests/arch/arm/arm_irq_vector_table/README.txt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,20 @@ or
3131

3232
Sample Output:
3333

34-
tc_start() - Test Cortex-M3 IRQ installed directly in vector table
35-
isr0 ran!
36-
isr1 ran!
37-
isr2 ran!
38-
PASS - main.
34+
Running TESTSUITE vector_table
35+
===================================================================
36+
START - test_arm_irq_vector_table
37+
Test Cortex-M IRQs installed directly in the vector table
38+
PASS - test_arm_irq_vector_table in 0.007 seconds
39+
===================================================================
40+
TESTSUITE vector_table succeeded
41+
42+
------ TESTSUITE SUMMARY START ------
43+
44+
SUITE PASS - 100.00% [vector_table]: pass = 1, fail = 0, skip = 0, total = 1 duration = 0.007 seconds
45+
- PASS - [vector_table.test_arm_irq_vector_table] duration = 0.007 seconds
46+
47+
------ TESTSUITE SUMMARY END ------
48+
3949
===================================================================
4050
PROJECT EXECUTION SUCCESSFUL

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ struct k_sem sem[3];
4646

4747
void isr0(void)
4848
{
49-
printk("%s ran!\n", __func__);
5049
k_sem_give(&sem[0]);
5150
z_arm_int_exit();
5251
}
@@ -59,7 +58,6 @@ void isr0(void)
5958

6059
void isr1(void)
6160
{
62-
printk("%s ran!\n", __func__);
6361
k_sem_give(&sem[1]);
6462
z_arm_int_exit();
6563
}
@@ -72,7 +70,6 @@ void isr1(void)
7270

7371
void isr2(void)
7472
{
75-
printk("%s ran!\n", __func__);
7673
k_sem_give(&sem[2]);
7774
z_arm_int_exit();
7875
}
@@ -97,7 +94,7 @@ void isr2(void)
9794
*/
9895
ZTEST(vector_table, test_arm_irq_vector_table)
9996
{
100-
printk("Test Cortex-M IRQs installed directly in the vector table\n");
97+
TC_PRINT("Test Cortex-M IRQs installed directly in the vector table\n");
10198

10299
for (int ii = 0; ii < 3; ii++) {
103100
irq_enable(_ISR_OFFSET + ii);

0 commit comments

Comments
 (0)