Skip to content

Commit 814ed68

Browse files
swift-tkcfriedt
authored andcommitted
tests: fix arm_irq_vector_table fail on Ambiq platforms
Fixed build fail since 4c93fcd. Fixed test run fail on Ambiq platforms. Added Ambiq section in the test. Signed-off-by: Swift Tian <[email protected]>
1 parent 8f5daca commit 814ed68

File tree

5 files changed

+36
-3
lines changed

5 files changed

+36
-3
lines changed

drivers/serial/uart_ambiq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ static void uart_ambiq_pm_policy_state_lock_get(const struct device *dev)
105105
}
106106
}
107107

108+
#if defined(CONFIG_UART_INTERRUPT_DRIVEN) || defined(CONFIG_UART_ASYNC_API)
108109
static void uart_ambiq_pm_policy_state_lock_put_unconditional(void)
109110
{
110111
if (IS_ENABLED(CONFIG_PM)) {
@@ -123,6 +124,7 @@ static void uart_ambiq_pm_policy_state_lock_put(const struct device *dev)
123124
}
124125
}
125126
}
127+
#endif
126128

127129
static int uart_ambiq_configure(const struct device *dev, const struct uart_config *cfg)
128130
{

drivers/timer/ambiq_stimer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
* Copyright (c) 2023 Antmicro <www.antmicro.com>
3+
* Copyright (c) 2025, Ambiq Micro Inc. <www.ambiq.com>
34
*
45
* SPDX-License-Identifier: Apache-2.0
56
*/
@@ -94,7 +95,7 @@ static void ambiq_stimer_delta_set(uint32_t ui32Delta)
9495
#endif
9596
}
9697

97-
static void stimer_isr(const void *arg)
98+
void stimer_isr(const void *arg)
9899
{
99100
ARG_UNUSED(arg);
100101

soc/ambiq/apollo5x/soc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ void soc_early_init_hook(void)
4848
/*
4949
* Set default temperature for spotmgr to room temperature
5050
*/
51-
am_hal_pwrctrl_temp_thresh_t dummy[32];
51+
am_hal_pwrctrl_temp_thresh_t dummy;
5252

53-
am_hal_pwrctrl_temp_update(25.0f, dummy);
53+
am_hal_pwrctrl_temp_update(25.0f, &dummy);
5454

5555
/* Enable Icache*/
5656
sys_cache_instr_enable();
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# start of software interrupt number
2+
CONFIG_ISR_OFFSET=92
3+
CONFIG_UART_INTERRUPT_DRIVEN=n

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,33 @@ const vth __irq_vector_table _irq_vector_table[] = {
243243
#else
244244
#error "GPT timer enabled, but no known SOC selected. ISR table needs rework"
245245
#endif
246+
247+
#elif defined(CONFIG_SOC_FAMILY_AMBIQ)
248+
249+
#if defined(CONFIG_AMBIQ_STIMER_TIMER)
250+
extern void stimer_isr(void);
251+
#define TIMER_IRQ_NUM DT_IRQN(DT_INST(0, ambiq_stimer))
252+
#define TIMER_IRQ_HANDLER stimer_isr
253+
#define IRQ_VECTOR_TABLE_SIZE _ISR_OFFSET > TIMER_IRQ_NUM ? (_ISR_OFFSET + 3) : (TIMER_IRQ_NUM + 2)
254+
#else
255+
#define IRQ_VECTOR_TABLE_SIZE (_ISR_OFFSET + 3)
256+
#endif /* CONFIG_AMBIQ_STIMER_TIMER */
257+
258+
const vth __irq_vector_table _irq_vector_table[IRQ_VECTOR_TABLE_SIZE] = {
259+
[_ISR_OFFSET] = isr0,
260+
[_ISR_OFFSET + 1] = isr1,
261+
[_ISR_OFFSET + 2] = isr2,
262+
#ifdef CONFIG_AMBIQ_STIMER_TIMER
263+
[TIMER_IRQ_NUM] = TIMER_IRQ_HANDLER,
264+
#if defined(CONFIG_SOC_SERIES_APOLLO3X) || defined(CONFIG_SOC_SERIES_APOLLO4X)
265+
[TIMER_IRQ_NUM + 1] = TIMER_IRQ_HANDLER,
266+
#endif
267+
#endif
268+
#ifdef CONFIG_SOC_SERIES_APOLLO5X
269+
[TIMER0_IRQn + AM_HAL_INTERNAL_TIMER_NUM_A] = hal_internal_timer_isr,
270+
#endif
271+
};
272+
246273
#else
247274

248275
#if defined(CONFIG_MCUX_OS_TIMER)

0 commit comments

Comments
 (0)