Skip to content

Commit 4c93fcd

Browse files
hakehuangnashif
authored andcommitted
tests: arm: sw_vector_table: enhance test configs for frdm_mcxa166
irq 0 in frdm_mcxa166/276 are reserved can not used for testing. add a config to shift test irq, also add support for rt700 also fix irq1 issue on mimxrt1180 as it is a debug trace interrupt fixes: #92877, #92521 Signed-off-by: Hake Huang <[email protected]>
1 parent 7f7690a commit 4c93fcd

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

tests/arch/arm/arm_irq_vector_table/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ config NUM_IRQS
44
int "Number of IRQs for this test, made overridable in the .conf file"
55
default 3
66

7+
config ISR_OFFSET
8+
int "isr offset from vector table"
9+
default 0
10+
711
source "Kconfig.zephyr"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_ISR_OFFSET=39
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_ISR_OFFSET=39
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_ISR_OFFSET=4

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

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#include <zephyr/kernel.h>
78
#include <zephyr/ztest.h>
89
#include <zephyr/arch/cpu.h>
910
#include <cmsis_core.h>
@@ -13,7 +14,7 @@
1314
* Offset (starting from the beginning of the vector table)
1415
* of the location where the ISRs will be manually installed.
1516
*/
16-
#define _ISR_OFFSET 0
17+
#define _ISR_OFFSET CONFIG_ISR_OFFSET
1718

1819
#if defined(CONFIG_SOC_FAMILY_NORDIC_NRF)
1920
#undef _ISR_OFFSET
@@ -108,7 +109,8 @@ ZTEST(vector_table, test_arm_irq_vector_table)
108109
k_sem_take(&sem[2], K_NO_WAIT)));
109110

110111
for (int ii = 0; ii < 3; ii++) {
111-
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) || defined(CONFIG_SOC_TI_LM3S6965_QEMU)
112+
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) || defined(CONFIG_SOC_TI_LM3S6965_QEMU) || \
113+
defined(CONFIG_ARMV8_M_MAINLINE) || defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
112114
/* the QEMU does not simulate the
113115
* STIR register: this is a workaround
114116
*/
@@ -242,7 +244,23 @@ const vth __irq_vector_table _irq_vector_table[] = {
242244
#error "GPT timer enabled, but no known SOC selected. ISR table needs rework"
243245
#endif
244246
#else
245-
const vth __irq_vector_table _irq_vector_table[] = {isr0, isr1, isr2};
247+
248+
#if defined(CONFIG_MCUX_OS_TIMER)
249+
extern void mcux_lpc_ostick_isr(void);
250+
#define TIMER_IRQ_NUM DT_IRQN(DT_INST(0, nxp_os_timer))
251+
#define TIMER_IRQ_HANDLER mcux_lpc_ostick_isr
252+
#define IRQ_VECTOR_TABLE_SIZE _ISR_OFFSET > TIMER_IRQ_NUM ? (_ISR_OFFSET + 3) : (TIMER_IRQ_NUM + 1)
253+
#else
254+
#define IRQ_VECTOR_TABLE_SIZE (_ISR_OFFSET + 3)
255+
#endif /* CONFIG_MCUX_OS_TIMER */
256+
const vth __irq_vector_table _irq_vector_table[IRQ_VECTOR_TABLE_SIZE] = {
257+
[_ISR_OFFSET] = isr0,
258+
[_ISR_OFFSET + 1] = isr1,
259+
[_ISR_OFFSET + 2] = isr2,
260+
#ifndef CONFIG_CORTEX_M_SYSTICK
261+
[TIMER_IRQ_NUM] = TIMER_IRQ_HANDLER,
262+
#endif
263+
};
246264
#endif /* CONFIG_SOC_FAMILY_NORDIC_NRF */
247265

248266
/**

0 commit comments

Comments
 (0)