Skip to content

Commit

Permalink
fix(CMSIS): Vector table address now properly set (#819)
Browse files Browse the repository at this point in the history
Co-authored-by: Jake Carter <[email protected]>
  • Loading branch information
EricB-ADI and Jake-Carter authored Dec 8, 2023
1 parent c778ca3 commit 547540b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
8 changes: 7 additions & 1 deletion Libraries/CMSIS/5.9.0/Core/Include/core_rv32.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,13 @@ __STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
*/
__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn)
{
//NVIC->ISPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* set interrupt pending */
if (IRQn < 32) {
MXC_INTR->irq0_set_pending |= (1 << IRQn);
MXC_EVENT->event0_set_pending |= (1 << IRQn);
} else {
MXC_INTR->irq1_set_pending |= (1 << (IRQn - 32));
MXC_EVENT->event1_set_pending |= (1 << (IRQn - 32));
}
}

/** \brief Clear Pending Interrupt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ __isr_vector:
Reset_Handler:

/* set 0 in mtvec (base for IVT) */
csrrw x0, mtvec, x0

la t0, (__isr_vector + 1)
csrrw x0, mtvec, t0

/* Initialize Stack Pointer */
la sp, __StackTop

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ __isr_vector:
.globl Reset_Handler
.type Reset_Handler, %function
Reset_Handler:

/* set 0 in mtvec (base for IVT) */
csrrw x0, mtvec, x0
/* Load interrupt vector table */
la t0, (__isr_vector + 1)
csrrw x0, mtvec, t0

/* Initialize Stack Pointer */
la sp, __StackTop
Expand Down

0 comments on commit 547540b

Please sign in to comment.